Repository: FDOS/freecom Branch: master Commit: ec6c63f13be0 Files: 750 Total size: 2.6 MB Directory structure: gitextract_1pnn224c/ ├── .gitattributes ├── .github/ │ ├── actions/ │ │ ├── build/ │ │ │ └── action.yml │ │ └── upx-inst/ │ │ └── action.yml │ └── workflows/ │ └── ci-build.yml ├── .gitignore ├── FILE_ID.DIZ ├── README.md ├── VERSION.TXT ├── build.bat ├── build.sh ├── buildall.bat ├── ci_build.sh ├── ci_prereq.sh ├── ci_test.sh ├── clean.bat ├── clean.sh ├── cmd/ │ ├── alias.c │ ├── beep.c │ ├── break.c │ ├── call.c │ ├── cdd.c │ ├── chcp.c │ ├── chdir.c │ ├── cls.c │ ├── cmd.m1 │ ├── cmd.m2 │ ├── copy.c │ ├── ctty.c │ ├── date.c │ ├── del.c │ ├── depend.mk │ ├── dir.c │ ├── dirs.c │ ├── doskey.c │ ├── echo.c │ ├── exit.c │ ├── exit2.c │ ├── fddebug.c │ ├── for.c │ ├── goto.c │ ├── history.c │ ├── if.c │ ├── lfnfor.c │ ├── makefile │ ├── makefile.mak │ ├── memory.c │ ├── mkdir.c │ ├── path.c │ ├── pause.c │ ├── popd.c │ ├── prompt.c │ ├── pushd.c │ ├── rem.c │ ├── ren.c │ ├── rmdir.c │ ├── set.c │ ├── shift.c │ ├── time.c │ ├── truename.c │ ├── type.c │ ├── verify.c │ └── which.c ├── command.lsm ├── config.b ├── config.h ├── config.std ├── criter/ │ ├── context.x │ ├── criter.asm │ ├── criter.txt │ ├── dmy_cbrk.asm │ ├── files.txt │ ├── makefile │ ├── makefile.mak │ ├── resource.id │ └── resource.inc ├── docs/ │ ├── HELP.EN │ ├── _config.yml │ ├── c0.txt │ ├── cmt1.txt │ ├── cmt10.txt │ ├── cmt2.txt │ ├── cmt3.txt │ ├── cmt4.txt │ ├── cmt5.txt │ ├── cmt6.txt │ ├── cmt7.txt │ ├── cmt8.txt │ ├── comments.txt │ ├── compile.txt │ ├── contrib.txt │ ├── download.txt │ ├── faq.txt │ ├── files.txt │ ├── history.txt │ ├── html/ │ │ ├── build48.html │ │ └── commands/ │ │ ├── FreeCOM.html │ │ ├── appendix.html │ │ ├── cmd.html │ │ ├── db2html │ │ ├── info │ │ ├── parse.pl │ │ └── parseHTML │ ├── index.md │ ├── k-swap.txt │ ├── language.txt │ ├── loadhigh.txt │ ├── localize.txt │ ├── module.txt │ ├── notes.txt │ ├── piping.txt │ ├── pt_br/ │ │ ├── config.h │ │ ├── config.mak │ │ ├── download.txt │ │ ├── file_id.diz │ │ └── readme │ ├── ptchldrv.txt │ ├── resource.txt │ ├── todo.txt │ ├── upload.txt │ └── vspawn.txt ├── err_fcts.h ├── include/ │ ├── batch.h │ ├── cmdline.h │ ├── command.h │ ├── context.h │ ├── crossjmp.h │ ├── cswap.h │ ├── datefunc.h │ ├── debug.h │ ├── infores.h │ ├── keys.h │ ├── kswap.h │ ├── large.inc │ ├── lfnfuncs.h │ ├── medium.inc │ ├── misc.h │ ├── model.inc │ ├── module.h │ ├── mux_ae.h │ ├── nls.h │ ├── openf.h │ ├── res.h │ ├── resource.h │ ├── small.inc │ ├── strings.typ │ ├── stuff.inc │ └── timefunc.h ├── lib/ │ ├── absfile.c │ ├── almemblk.c │ ├── alprmblk.c │ ├── alsysblk.c │ ├── app_get.c │ ├── app_set.c │ ├── beep_l.c │ ├── beep_n.c │ ├── brk_get.c │ ├── brk_set.c │ ├── c16.mac │ ├── cbreak.c │ ├── cbs.c │ ├── cd_dir.c │ ├── cgetch.c │ ├── cgettime.c │ ├── chgctxt.c │ ├── chgdrv.c │ ├── chgenv.c │ ├── chgenvc.c │ ├── chgenvr.c │ ├── cmdinput.c │ ├── comfile.c │ ├── compfile.c │ ├── critend.c │ ├── critrchk.c │ ├── ctxt.c │ ├── ctxt_adr.c │ ├── ctxt_as.c │ ├── ctxt_chg.c │ ├── ctxt_clr.c │ ├── ctxt_get.c │ ├── ctxt_inf.c │ ├── ctxt_mk.c │ ├── ctxt_mkb.c │ ├── ctxt_mkn.c │ ├── ctxt_pop.c │ ├── ctxt_psh.c │ ├── ctxt_rnu.c │ ├── ctxt_set.c │ ├── ctxt_ss.c │ ├── ctxt_vw.c │ ├── curdatel.c │ ├── curtime.c │ ├── cwd.c │ ├── dateget.c │ ├── dateset.c │ ├── dbg_c.c │ ├── dbg_mem.c │ ├── dbg_prnt.c │ ├── dbg_s.c │ ├── dbg_sn.c │ ├── delay.c │ ├── depend.mk │ ├── devopen.c │ ├── dfn_err.c │ ├── dispcnt.c │ ├── dispexit.c │ ├── drvnum.c │ ├── efct_001.c │ ├── err1.c │ ├── err10.c │ ├── err11.c │ ├── err12.c │ ├── err13.c │ ├── err14.c │ ├── err15.c │ ├── err16.c │ ├── err17.c │ ├── err18.c │ ├── err19.c │ ├── err2.c │ ├── err20.c │ ├── err21.c │ ├── err22.c │ ├── err23.c │ ├── err24.c │ ├── err25.c │ ├── err26.c │ ├── err27.c │ ├── err28.c │ ├── err29.c │ ├── err3.c │ ├── err30.c │ ├── err31.c │ ├── err32.c │ ├── err33.c │ ├── err34.c │ ├── err35.c │ ├── err36.c │ ├── err37.c │ ├── err38.c │ ├── err39.c │ ├── err4.c │ ├── err40.c │ ├── err41.c │ ├── err42.c │ ├── err43.c │ ├── err44.c │ ├── err45.c │ ├── err46.c │ ├── err47.c │ ├── err48.c │ ├── err49.c │ ├── err5.c │ ├── err50.c │ ├── err51.c │ ├── err52.c │ ├── err53.c │ ├── err54.c │ ├── err55.c │ ├── err56.c │ ├── err57.c │ ├── err58.c │ ├── err59.c │ ├── err6.c │ ├── err60.c │ ├── err61.c │ ├── err62.c │ ├── err63.c │ ├── err64.c │ ├── err65.c │ ├── err66.c │ ├── err67.c │ ├── err68.c │ ├── err69.c │ ├── err7.c │ ├── err70.c │ ├── err71.c │ ├── err72.c │ ├── err73.c │ ├── err74.c │ ├── err75.c │ ├── err76.c │ ├── err77.c │ ├── err78.c │ ├── err79.c │ ├── err8.c │ ├── err80.c │ ├── err81.c │ ├── err82.c │ ├── err83.c │ ├── err84.c │ ├── err85.c │ ├── err86.c │ ├── err87.c │ ├── err9.c │ ├── err_fcts.mk │ ├── err_fcts.src │ ├── exec.c │ ├── exec1.c │ ├── farread.c │ ├── fdattr.c │ ├── fdevopen.c │ ├── fdsattr.c │ ├── filecomp.c │ ├── files.txt │ ├── fillcomp.c │ ├── find.c │ ├── freep.c │ ├── frsysblk.c │ ├── fstpcpy.c │ ├── gallstr.c │ ├── get1mcb.c │ ├── getenv.c │ ├── goxy.c │ ├── grabfcom.c │ ├── gumblink.c │ ├── hdlrctxt.c │ ├── hist_get.c │ ├── hist_set.c │ ├── inputdos.c │ ├── is_empty.c │ ├── is_fnamc.c │ ├── is_fnstr.c │ ├── is_pchr.c │ ├── isadev.c │ ├── keyprsd.c │ ├── kswap_c.c │ ├── lastdget.c │ ├── lastdset.c │ ├── leadopt.c │ ├── lfnfuncs.c │ ├── lib.m1 │ ├── lib.m2 │ ├── lowexec.asm │ ├── ltrimcl.c │ ├── ltrimsp.c │ ├── lwr1wd.c │ ├── makefile │ ├── makefile.mak │ ├── match.c │ ├── messages.c │ ├── mk_rddir.c │ ├── mktmpfil.c │ ├── msg_dflt.c │ ├── msg_dps.c │ ├── msg_fstr.c │ ├── msg_get.c │ ├── msg_gpt.c │ ├── msg_mkey.c │ ├── msg_prmp.c │ ├── mux_ae.c │ ├── myperror.c │ ├── nls.c │ ├── nls_date.c │ ├── nls_time.c │ ├── num_fmt.c │ ├── onoff.c │ ├── openf.c │ ├── optsb.c │ ├── optsi.c │ ├── optss.c │ ├── parsenum.c │ ├── pr_date.c │ ├── pr_prmpt.c │ ├── pr_time.c │ ├── prf.c │ ├── prprompt.c │ ├── readcmd.c │ ├── realnum.c │ ├── res.c │ ├── res_r.c │ ├── res_vald.c │ ├── res_w.c │ ├── resfile.c │ ├── rmtmpfil.c │ ├── rtrimcl.c │ ├── rtrimsp.c │ ├── salloc.c │ ├── samefile.c │ ├── scancmd.c │ ├── scanerr.pl │ ├── scanopt.c │ ├── session.c │ ├── showcmds.c │ ├── skqwd.c │ ├── spfnam.c │ ├── split.c │ ├── sumblink.c │ ├── timeget.c │ ├── timeset.c │ ├── tmpnam.c │ ├── trimcl.c │ ├── trimsp.c │ ├── truepath.c │ ├── truncate.c │ ├── txtlend.c │ ├── unquote.c │ ├── vcgetch.c │ ├── vcgetstr.c │ └── where.c ├── license ├── makefile ├── mkdist.bat ├── mkfiles/ │ ├── bc5.mak │ ├── gcc.mak │ ├── tc2.mak │ ├── turbocpp.mak │ └── watcom.mak ├── scripts/ │ ├── complng.pl │ ├── compsyms.pl │ ├── director.bat │ ├── disp_cmd.asm │ ├── echolib.bat │ ├── echoto.bat │ ├── fetchseg.pl │ ├── findstrg.pl │ ├── makecmd.bat │ ├── mkxref.pl │ ├── rmfiles.bat │ └── sav.btm ├── shell/ │ ├── batch.c │ ├── cb_catch.asm │ ├── cmdtable.c │ ├── command.c │ ├── command.ld │ ├── command.m1 │ ├── command.m2 │ ├── cswap.asm │ ├── cswapc.c │ ├── depend.mk │ ├── dummies.asm │ ├── expalias.c │ ├── init.c │ ├── kswap.c │ ├── loadhigh.c │ ├── makefile │ ├── makefile.mak │ ├── module.c │ ├── redir.c │ ├── termhook.asm │ ├── ver.c │ ├── wlinker.bat │ ├── xms_2e.asm │ ├── xms_brk.asm │ └── xms_crit.asm ├── strings/ │ ├── CHANGED │ ├── DEFAULT.err │ ├── DEFAULT.lng │ ├── depend.mk │ ├── dutch.err │ ├── dutch.lng │ ├── english.err │ ├── english.lng │ ├── finnish.err │ ├── finnish.lng │ ├── fixstrs.c │ ├── french.err │ ├── french.lng │ ├── german.err │ ├── german.lng │ ├── indent.pro │ ├── italian.err │ ├── italian.lng │ ├── makefile │ ├── makefile.mak │ ├── polish.err │ ├── polish.lng │ ├── pt.err │ ├── pt.lng │ ├── pt_br.err │ ├── pt_br.lng │ ├── russian.err │ ├── russian.lng │ ├── serbian.err │ ├── serbian.lng │ ├── slovene.err │ ├── slovene.lng │ ├── spanish.err │ ├── spanish.lng │ ├── strings/ │ │ └── makefile.mak │ ├── swedish.err │ ├── swedish.lng │ ├── turkish.err │ ├── turkish.lng │ ├── ukr.err │ ├── ukr.lng │ ├── yu437.err │ └── yu437.lng ├── suppl/ │ ├── algnbyte.h │ ├── algndflt.h │ ├── appname.h │ ├── clnsuppl.bat │ ├── cntry.h │ ├── compat/ │ │ ├── conio.h │ │ ├── dos.h │ │ ├── io.h │ │ └── process.h │ ├── dfn.h │ ├── dynstr.h │ ├── environ.h │ ├── errcodes.h │ ├── external.h │ ├── fmemory.h │ ├── getopt.h │ ├── makefile.mak │ ├── mcb.h │ ├── msglib.h │ ├── msgs.h │ ├── nls.h │ ├── nls_c.h │ ├── nls_f.h │ ├── p-bc.h │ ├── p-gcc.h │ ├── p-mc.h │ ├── p-pac.h │ ├── p-watcom.h │ ├── portable.h │ ├── psp.h │ ├── readme.txt │ ├── regproto.h │ ├── src/ │ │ ├── _getdcwd.c │ │ ├── addu.c │ │ ├── app_ievx.c │ │ ├── app_ini_.c │ │ ├── app_init.c │ │ ├── app_name.c │ │ ├── app_namx.c │ │ ├── app_vars.c │ │ ├── appname.loc │ │ ├── bugs │ │ ├── byte2par.c │ │ ├── cntry.c │ │ ├── copying │ │ ├── copying.lb │ │ ├── dbgf_chg.c │ │ ├── dbgf_cl.c │ │ ├── dbgf_cle.c │ │ ├── dbgf_clg.c │ │ ├── dbgf_dl.c │ │ ├── dbgf_dpl.c │ │ ├── dbgf_et.c │ │ ├── dbgf_ext.c │ │ ├── dbgf_fl.c │ │ ├── dbgf_flg.c │ │ ├── dbgf_ien.c │ │ ├── dbgf_lgh.c │ │ ├── dbgf_lgi.c │ │ ├── dbgf_lgt.c │ │ ├── dbgf_lk.c │ │ ├── dbgf_log.c │ │ ├── dbgf_lv.c │ │ ├── dbgf_mfi.c │ │ ├── dbgf_mi.c │ │ ├── dbgf_mki.c │ │ ├── dbgf_ml.c │ │ ├── dbgf_pop.c │ │ ├── dbgf_prt.c │ │ ├── dbgf_psh.c │ │ ├── dbgf_var.c │ │ ├── dbgm_chk.c │ │ ├── dbgv_s0.c │ │ ├── dbgv_s10.c │ │ ├── dbgv_s13.c │ │ ├── dbgv_s14.c │ │ ├── dbgv_s15.c │ │ ├── dbgv_s17.c │ │ ├── dbgv_s19.c │ │ ├── dbgv_s2.c │ │ ├── dbgv_s20.c │ │ ├── dbgv_s22.c │ │ ├── dbgv_s23.c │ │ ├── dbgv_s24.c │ │ ├── dbgv_s25.c │ │ ├── dbgv_s3.c │ │ ├── dbgv_s4.c │ │ ├── dbgv_s5.c │ │ ├── dbgv_s6.c │ │ ├── dbgv_s7.c │ │ ├── dbgv_s8.c │ │ ├── dfn.loc │ │ ├── dfndeli2.c │ │ ├── dfndelim.c │ │ ├── dfnexpan.c │ │ ├── dfnfnam.c │ │ ├── dfnfullp.c │ │ ├── dfnmerge.c │ │ ├── dfnpath.c │ │ ├── dfnsplit.c │ │ ├── dfnsquee.c │ │ ├── dfnstat.c │ │ ├── dfntruen.c │ │ ├── dir.loc │ │ ├── dmemcmpf.c │ │ ├── dosalloc.c │ │ ├── dosfree.c │ │ ├── dossize.c │ │ ├── dstrchar.c │ │ ├── dstrfupr.c │ │ ├── dstrleft.c │ │ ├── dstrrepl.c │ │ ├── dstrtrim.c │ │ ├── dstrupr.c │ │ ├── eeopen.c │ │ ├── eestrcon.c │ │ ├── elvis.rc │ │ ├── eno.loc │ │ ├── enoallc.c │ │ ├── enoreal.c │ │ ├── enosdup.c │ │ ├── enosetos.c │ │ ├── env_chg.c │ │ ├── env_del.c │ │ ├── env_dvar.c │ │ ├── env_find.c │ │ ├── env_fora.c │ │ ├── env_free.c │ │ ├── env_insv.c │ │ ├── env_len.c │ │ ├── env_mtch.c │ │ ├── env_new.c │ │ ├── env_nost.c │ │ ├── env_ovrw.c │ │ ├── env_repl.c │ │ ├── env_rlsg.c │ │ ├── env_scnt.c │ │ ├── env_sdup.c │ │ ├── env_size.c │ │ ├── env_strg.c │ │ ├── env_sub.c │ │ ├── env_var1.c │ │ ├── env_var2.c │ │ ├── environ.loc │ │ ├── erfc_00f.c │ │ ├── erfc_015.c │ │ ├── ffmaxbuf.c │ │ ├── fgetpos.c │ │ ├── file_id.diz │ │ ├── filefind.c │ │ ├── fmemchr.c │ │ ├── fmemcmp.c │ │ ├── fmemcpy.c │ │ ├── fmemory.loc │ │ ├── fmemove.c │ │ ├── fnorm.c │ │ ├── fputmc.c │ │ ├── fstrcpy.c │ │ ├── fstrdup.c │ │ ├── fstrlen.c │ │ ├── gm_chgm.c │ │ ├── gm_dup.c │ │ ├── gm_gtmem.c │ │ ├── gm_res.c │ │ ├── initsupl.loc │ │ ├── intr.asm │ │ ├── invokedo.c │ │ ├── makefile.mak │ │ ├── mcb_1st.c │ │ ├── mcb_is.c │ │ ├── mcb_leng.c │ │ ├── mcb_nxt.c │ │ ├── mcb_walk.c │ │ ├── msgs.lng │ │ ├── msgs.loc │ │ ├── msgs_w.loc │ │ ├── nls/ │ │ │ ├── english.err │ │ │ └── english.lng │ │ ├── nls.loc │ │ ├── nlstime.c │ │ ├── s_skipwd.c │ │ ├── s_skipws.c │ │ ├── sstr.src │ │ ├── stpcat.c │ │ ├── stpcpy.c │ │ ├── str.loc │ │ ├── strnum.c │ │ ├── suppldbg.loc │ │ ├── supplio.loc │ │ ├── syslog.loc │ │ └── toupperx.c │ ├── sstr.h │ ├── str.h │ ├── supl_def.h │ ├── suppl.h │ ├── suppldbg.h │ ├── supplio.h │ └── syslog.h ├── tests/ │ ├── args.bat │ ├── bat1.bat │ ├── bat2.bat │ ├── bat3.bat │ ├── benny.bat │ ├── compat.bat │ ├── ctty-nul.bat │ ├── dir-test.txt │ ├── errlvl.bat │ ├── errlvl.c │ ├── fdos.out │ ├── hbp001a.bat │ ├── hbp001b.bat │ ├── hbp002.txt │ ├── hbp_001.txt │ ├── label.bat │ ├── longcmd.bat │ ├── msdos.out │ ├── refl.bat │ ├── t.bat │ ├── test.bat │ ├── test1.bat │ ├── test2.bat │ ├── test3.bat │ ├── test4.bat │ ├── testenv.c │ ├── tst-if.bat │ └── tstcmdln.bat ├── tools/ │ ├── 28.asm │ ├── 50.asm │ ├── debug.h │ ├── depend.mk │ ├── files.txt │ ├── icmd_1.nas │ ├── icmd_2.nas │ ├── icmd_3.nas │ ├── icmd_inc.inc │ ├── icmd_tpl.nas │ ├── kssf.asm │ ├── load_icd.c │ ├── makefile │ ├── makefile.1 │ ├── ptchldrv.c │ ├── ptchsize.c │ ├── resource.h │ ├── tools.m1 │ ├── tools.m2 │ └── vspawn.asm ├── utils/ │ ├── MAKECMD.BAT │ ├── chunk.c │ ├── debug.h │ ├── depend.mk │ ├── files.txt │ ├── makefile │ ├── makefile.mak │ ├── misc.h │ ├── mkctxt.c │ ├── mkinfres.c │ ├── mktools.c │ ├── ptchsize.c │ └── resource.h ├── utilsc/ │ ├── critstrs.c │ ├── fixstrs.c │ └── makefile.mak └── version.h ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ * text eol=crlf *.sh text eol=lf *.com -text *.ico -text elvis.rc -text ci_*.sh text eol=lf .github/workflows/*.yml text eol=lf # On checkout it is the specified encoding, but git internal # representation is UTF-8 so that diffs work correctly strings/DEFAULT.??? working-tree-encoding=CP437 text eol=auto strings/english.??? working-tree-encoding=CP437 text eol=auto strings/yu437.??? working-tree-encoding=CP437 text eol=auto strings/dutch.??? working-tree-encoding=CP850 text eol=auto strings/finnish.??? working-tree-encoding=CP850 text eol=auto strings/french.??? working-tree-encoding=CP850 text eol=auto strings/german.??? working-tree-encoding=CP850 text eol=auto strings/italian.??? working-tree-encoding=CP850 text eol=auto strings/pt_br.??? working-tree-encoding=CP850 text eol=auto strings/spanish.??? working-tree-encoding=CP850 text eol=auto strings/swedish.??? working-tree-encoding=CP850 text eol=auto strings/serbian.??? working-tree-encoding=CP852 text eol=auto strings/slovene.??? working-tree-encoding=CP852 text eol=auto strings/turkish.??? working-tree-encoding=CP857 text eol=auto strings/pt.??? working-tree-encoding=CP860 text eol=auto strings/russian.??? working-tree-encoding=CP866 text eol=auto strings/ukr.??? working-tree-encoding=CP866 text eol=auto # Does not exist in iconv, so have to do it manually # strings/polish.??? working-tree-encoding=CP991 text eol=auto strings/polish.??? text eol=auto ================================================ FILE: .github/actions/build/action.yml ================================================ name: cross-compile-build description: Cross-compile inputs: cmd: description: 'build cmd' default: '' required: false type: string # runs: using: composite steps: - name: build (Windows) if: runner.os == 'Windows' run: | copy config.b config.bat copy config.std config.mak ${{inputs.cmd}} shell: cmd - name: build (OSX, Linux) if: runner.os != 'Windows' run: | ${{inputs.cmd}} shell: bash ================================================ FILE: .github/actions/upx-inst/action.yml ================================================ name: install-upx description: Load UPX # runs: using: composite steps: - name: UPX install (OSX) if: runner.os == 'macOS' run: brew install upx shell: bash - name: UPX install (Linux, Windows) if: runner.os != 'macOS' uses: crazy-max/ghaction-upx@v3 with: install-only: true ================================================ FILE: .github/workflows/ci-build.yml ================================================ name: Build on: pull_request: types: - opened - edited - ready_for_review - reopened - synchronize push: jobs: build: if: contains(github.event.head_commit.message, '[skip ci]') == false runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: prerequisites run: ./ci_prereq.sh env: TC201_ARCHIVE_PATHNAME: ${{ vars.TC201_ARCHIVE_PATHNAME }} TC201_ARCHIVE_FILENAME: ${{ vars.TC201_ARCHIVE_FILENAME }} TC201_ARCHIVE_PASSPHRASE: ${{ secrets.TC201_ARCHIVE_PASSPHRASE }} - name: build run: ./ci_build.sh - name: test run: ./ci_test.sh - name: make snapshot name id: snapshotname run: | ( today=`date -u +%F | tr '\n' '-'` s_sha=`echo -n ${GITHUB_SHA} | cut -c1-8` printf "fname=snapshot-%s%s\n" $today $s_sha >> $GITHUB_OUTPUT ) - name: upload if: github.repository == 'FDOS/freecom' && (github.event_name == 'push' || github.event.pull_request.merged == true) uses: actions/upload-artifact@v4 with: name: ${{ steps.snapshotname.outputs.fname }} path: _output test-ow-cross-compile: if: contains(github.event.head_commit.message, '[skip ci]') == false strategy: matrix: ow: - name: '1.9' id: '1.9' - name: '2.0' id: '2.0-64' host: - name: 'Windows' id: 'nt' image: 'windows-latest' cmd: 'build.bat watcom upx english' - name: 'Mac OSX-ARM' id: 'osx' image: 'macos-latest' cmd: './build.sh watcom upx english' - name: 'Linux' id: 'linux' image: 'ubuntu-latest' cmd: './build.sh watcom upx english' exclude: - { ow: { name: '1.9' }, host: { id: 'osx' } } runs-on: ${{matrix.host.image}} name: Test OW ${{matrix.ow.name}} cross-compile (${{matrix.host.name}}) steps: - uses: actions/checkout@v4 - name: Nasm install uses: ilammy/setup-nasm@v1 - name: UPX install uses: "./.github/actions/upx-inst" - name: Open Watcom install uses: open-watcom/setup-watcom@v0 with: version: ${{matrix.ow.id}} - name: build uses: "./.github/actions/build" with: cmd: ${{matrix.host.cmd}} ================================================ FILE: .gitignore ================================================ *.cfg *.com *.exe *.icd *.lib *.lst *.map *.o *.obj *.rsp *.tmp # CI build /_downloads/** /_output/** /_watcom/** /build/** /strings/strings/** !/strings/strings/makefile.mak /**/echolib.bat /**/echoto.bat !/scripts/** /**/gnumake.mak /config.bat /config.mak /context.h_c /context.inc /gnuconf.mak /infores /info.txt /strings.h /criter/context.def /criter/context.h_c /criter/context.inc /criter/criter /criter/criter1 /shell/command.err /strings/strings.dat /strings/strings.err /strings/strings.h /strings/strings.log /strings/xmsswap.cln /tools/makefile.mak ================================================ FILE: FILE_ID.DIZ ================================================ This is the FreeDOS Command Shell (command.com). For the latest version and information, visit http://wiki.freedos.org/wiki/index.php/FreeCOM See LICENSE for license information. ================================================ FILE: README.md ================================================ # FreeCom - The DOS Command Line Interface # ******************************************** Source code distribution of FreeCOM - a Command line interface program, which substitutes COMMAND.COM [![Build](../../workflows/Build/badge.svg)](../../actions) ## About ## This software is part of the FreeDOS project. Please visit the freedos web page at http://www.freedos.org/ for more information about FreeDOS. FreeCOM 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. Additionally, 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. ## More information ## [Changes since last official release](https://github.com/FDOS/freecom/commits/master) [How to compile FreeCOM](docs/compile.txt) ## Bugs and Help ## The COMMAND.COM web site (including source hosting) is at https://github.com/FDOS/freecom Bugs may be filed at https://github.com/FDOS/freecom/issues or you may send any bug reports, comments or other info to the one of the FreeDOS mailing lists. For subscription and archives, see: http://www.freedos.org/forums/ This 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). Please note that this software is separate from the DOS-C kernel and is 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). ## Installation ## To use this shell, just run the COMMAND.COM file. You can also add this to your CONFIG.SYS file: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHELL= e.g. SHELL=C:\FREEDOS\COMMAND.COM /P ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See http://help.fdos.org/en/hhstndrd/command.htm for description of command line options. ## Current Features ## - environment handling with prompt and path support - directory utilities - command-line history with doskey-like features + filename completion (TAB) - batch file processing - input/output redirection and piping - loadhigh support - alias support - flow control (IF, FOR, GOTO, labels) - support for error and other messages in multiple languages ================================================ FILE: VERSION.TXT ================================================ FreeCom version 0.87 - WATCOMC [???] ================================================ FILE: build.bat ================================================ @echo off set SWAP=YES-DXMS-SWAP____________________ if NOT "%SWAP%"=="YES-DXMS-SWAP____________________" goto err1 : BEGIN Internal stuff for ska -- If one of these three commands : fail for you, your distribution is broken! Please report. for %%a in (lib\makefile.mak cmd\makefile.mak shell\makefile.mak) do if not exist %%a set SWAP=NO if "%SWAP%"=="NO" set XMS_SWAP= if "%SWAP%"=="NO" call dmake dist : END set SWAP= set COMPILER=TURBOCPP if not exist config.bat goto err3 if not exist config.mak goto err2 call config.bat if exist lastmake.mk call clean.bat if "%1"=="-r" call clean.bat if "%1"=="-r" shift if "%1"=="clean" clean.bat if "%1"=="clean" goto ende if "%1"=="-h" goto help if "%1"=="-?" goto help set XMS_SWAP=1 :loop_commandline if "%1"=="no-xms-swap" goto special if "%1"=="xms-swap" goto special if "%1"=="xmsswap" goto special if "%1"=="debug" goto special if "%1"=="plainedt" goto plainedt if "%1"=="watcom" goto special if "%1"=="wc" goto special if "%1"=="tc" goto special if "%1"=="tcpp" goto special if "%1"=="bc" goto special if "%1"=="upx" goto special goto run :special if "%1"=="no-xms-swap" set XMS_SWAP= if "%1"=="xms-swap" set XMS_SWAP=1 if "%1"=="xmsswap" set XMS_SWAP=1 if "%1"=="debug" set DEBUG=1 if "%1"=="watcom" set COMPILER=WATCOM if "%1"=="wc" set COMPILER=WATCOM if "%1"=="tc" set COMPILER=TC2 if "%1"=="tcpp" set COMPILER=TURBOCPP if "%1"=="bc" set COMPILER=BC5 if "%1"=="upx" set WITH_UPX=1 shift if not "%1" == "" goto loop_commandline if not "%1"=="-h" goto run :help echo Build FreeCOM echo Usage: %0 [-r] [clean] [no-xms-swap] [debug] [language] echo -r: Rebuild -- Clean before proceed echo clean: Remove *.OBJ, *.COM, *.LIB, etc. files, then exit echo no-xms-swap: Build FreeCOM without XMS-Only Swap support echo debug: Build FreeCOM with debug settings. echo plainedt: Build FreeCOM without enhanced line editing/history echo You can select for which language to built FreeCOM by setting echo the environment variable LNG before running this script, e.g.: echo SET LNG=german echo selects the German language. For available language see STRINGS\*.LNG goto ende :plainedt if exist config.$$$ del config.$$$ ren config.h config.$$$ echo #define IGNORE_ENHANCED_INPUT >config.h type config.$$$ >>config.h shift if not "%1" == "" goto loop_commandline ::goto run :run if not x%1==x set LNG=%1 if "%lng%"=="" set LNG=english echo Building FreeCOM for language %LNG% if not "%MAKE%" == "" goto skip_make if "%COMPILER%" == "TC2" set MAKE=%TC2_BASE%\make -fmakefile.mak if "%COMPILER%" == "TURBOCPP" set MAKE=%TP1_BASE%\bin\make -f makefile.mak if "%COMPILER%" == "BC5" set MAKE=%BC5_BASE%\bin\make -f makefile.mak if "%COMPILER%" == "WATCOM" set MAKE=wmake -ms -h -f makefile.mak echo Make is %MAKE%. :skip_make echo. echo Checking SUPPL library cd suppl if exist skip goto endSuppl echo Building SUPPL library %MAKE% all if errorlevel 1 goto ende cd src %MAKE% all if errorlevel 1 goto ende cd .. :endSuppl cd .. echo. echo Making basic utilities for build process echo. cd utils %MAKE% all if errorlevel 1 goto ende cd ..\utilsc %MAKE% all if errorlevel 1 goto ende cd .. echo. echo Making STRINGS resource echo. cd strings %MAKE% all if errorlevel 1 goto ende cd strings %MAKE% all if errorlevel 1 goto ende cd ..\.. echo. echo Making CRITER resource echo. cd criter %MAKE% all if errorlevel 1 goto ende cd .. echo. echo Making misc library echo. cd lib %MAKE% all if errorlevel 1 goto ende cd .. echo. echo Making commands library echo. cd cmd %MAKE% all if errorlevel 1 goto ende cd .. echo. echo Making COMMAND.COM echo. cd shell %MAKE% all if errorlevel 1 goto ende cd .. utils\mkinfres.exe /tinfo.txt infores shell\command.map shell\command.exe :: save version without lang specific files and version with strings embedded if NOT "%XMS_SWAP%"=="" SET CMD_NAME=strings\xmsswap.cln if "%XMS_SWAP%"=="" SET CMD_NAME=strings\command.cln copy /b shell\command.exe + infores + criter\criter1 + criter\criter %CMD_NAME% copy /b %CMD_NAME% + strings\strings.dat command.com if not exist command.com goto ende echo. echo Making supplemental tools echo. cd tools type tools.m1 >makefile.mak ..\utils\mktools.exe >>makefile.mak type tools.m2 >>makefile.mak %MAKE% all if errorlevel 1 goto ende cd .. echo. echo Patching heap size to 8KB echo. utils\ptchsize.exe command.com +8KB utils\ptchsize.exe %CMD_NAME% +8KB if %WITH_UPX%x == x goto alldone if exist command.upx del command.upx >nul upx --8086 --best -o command.upx command.com :alldone echo. echo All done. COMMAND.COM is ready for use! echo. if NOT "%XMS_SWAP%"=="" goto ende echo Note: To build FreeCOM without XMS-Only Swap, re-run echo BUILD.BAT -r no-xms-swap %LNG% goto ende :err3 echo Please copy CONFIG.B into CONFIG.BAT and update the echo settings therein. goto ende :err2 echo Please copy CONFIG.STD into CONFIG.MAK and update the echo settings therein. goto ende :err1 echo Environment full (cannot add environment variables) echo Cannot proceed :ende set XMS_SWAP= set DEBUG= set MAKE= set COMPILER= set TC2_BASE= set TP1_BASE= set BC5_BASE= set XNASM= set LNG= set WITH_UPX= set CMD_NAME= if exist config.$$$ del config.h if exist config.$$$ ren config.$$$ config.h ================================================ FILE: build.sh ================================================ #!/bin/bash set -e WITH_UPX="no" SED=sed #workaround for Windows (set to binary mode) if [ "$(expr substr $(uname -s) 1 5)" == 'MINGW' ]; then SED='sed -b' fi export SWAP=YES-DXMS-SWAP____________________ # BEGIN Internal stuff for ska -- If one of these three commands # fail for you, your distribution is broken! Please report. for a in lib/makefile.mak cmd/makefile.mak shell/makefile.mak; do if [ ! -f $a ]; then export SWAP=NO; fi; done if [ "$SWAP" == "NO" ]; then unset XMS_SWAP dmake dist fi # end export SWAP= if [ ! -f config.mak ]; then echo File config.mak missing, copying config.std to it cp config.std config.mak || exit 1 fi export XNASM=nasm export COMPILER=watcom if [ -z "$WATCOM" ]; then export WATCOM=$HOME/watcom export PATH=$PATH:$WATCOM/binl fi export PATH=$PATH:. if [ -f lastmake.mk ] || [ "$1" == "-r" ]; then ./clean.sh; fi if [ "$1" == "-r" ]; then ./clean.sh; shift; fi if [ "$1" == "clean" ]; then ./clean.sh; exit 0; fi export XMS_SWAP=1 while (( "$#" )); do case "$1" in -h) echo Build FreeCOM echo Usage: %0 [-r] [clean] [no-xms-swap] [debug] [language] echo -r: Rebuild -- Clean before proceed echo clean: Remove *.OBJ, *.COM, *.LIB, etc. files, then exit echo no-xms-swap: Build FreeCOM without XMS-Only Swap support echo debug: Build FreeCOM with debug settings. echo You can select for which language to built FreeCOM by setting echo the environment variable LNG before running this script, e.g.: echo EXPORT LNG=german echo selects the German language. For available language see STRINGS\*.LNG exit 0 ;; no-xms-swap) unset XMS_SWAP ;; debug) export DEBUG=1 ;; watcom) export COMPILER=watcom ;; wc) export COMPILER=watcom ;; gcc) export COMPILER=gcc ;; upx) WITH_UPX="yes" ;; *) break ;; esac shift done if [ -n "$1" ]; then export LNG=$1; fi if [ -z "$LNG" ]; then export LNG=english; fi echo Building FreeCOM for language $LNG if [ -z "$MAKE" ]; then case "$COMPILER" in watcom) export MAKE="wmake -ms -h -f makefile.mak" ;; gcc) export MAKE="make -f gnumake.mak" ;; *) ;; esac echo Make is $MAKE. fi # substitutions for GNU Make gnumake_subst () { $SED -e 's@^!@@' \ -e 's@^include "\(.*\)"@include \1@' \ -e 's@^include $(TOP)/config.mak@include $(TOP)/gnuconf.mak@' \ -e 's@if \(.*\) == \(.*\)[\r$]@ifeq (\1,\2)@' \ -e 's@^CC =@CC :=@' \ -e 's@^INCLUDEPATH =@INCLUDEPATH :=@' \ -e 's/\(-f obj.*$<\)/\1 -o $@/' \ < $1/$2 > $1/$3 } if $MAKE -? 2>&1 | grep -q gnu; then gnumake_subst . config.mak gnuconf.mak for i in suppl utils utilsc strings criter lib cmd; do gnumake_subst $i makefile.mak gnumake.mak done gnumake_subst suppl/src makefile.mak gnumake.mak gnumake_subst strings/strings makefile.mak gnumake.mak gnumake_subst shell makefile.mak gnumake.mak fi echo echo Checking SUPPL library cd suppl if [ ! -f skip ]; then echo Building SUPPL library $MAKE all cd src $MAKE all cd .. fi cd .. echo echo Making basic utilities for build process echo cd utils $MAKE all cd ../utilsc $MAKE all cd .. echo echo Making STRINGS resource echo cd strings $MAKE all cd strings $MAKE all cd ../.. echo echo Making CRITER resource echo cd criter $MAKE all cd .. echo echo Making misc library echo cd lib $MAKE all cd .. echo echo Making commands library echo cd cmd $MAKE all cd .. echo echo Making COMMAND.COM echo cd shell $MAKE all cd .. utils/mkinfres.exe -Tinfo.txt infores shell/command.map shell/command.exe cat shell/command.exe infores criter/criter1 criter/criter strings/strings.dat > command.com [ -f command.com ] || exit 1 echo echo Making supplemental tools echo cd tools cat tools.m1 > makefile.mak ../utils/mktools.exe >>makefile.mak cat tools.m2 >>makefile.mak if $MAKE -? 2>&1 | grep -q gnu; then gnumake_subst . makefile.mak gnumake.mak fi $MAKE all cd .. echo echo Patching heap size to 8KB echo utils/ptchsize.exe command.com +8KB if [ $WITH_UPX = "yes" ]; then rm -f command.upx upx --8086 --best -o command.upx command.com fi echo echo All done. COMMAND.COM is ready for use! echo if [ -z "$XMS_SWAP" ]; then echo Note: To build FreeCOM without XMS-Only Swap, re-run echo ./build.sh -r no-xms-swap $LNG fi ================================================ FILE: buildall.bat ================================================ @ECHO OFF REM we use BUILD_COMPILER as build.bat sets and clears COMPILER env var if "%BUILD_COMPILER%"=="" set BUILD_COMPILER=wc if NOT "%1"=="" goto %1 rd /s /q build call clean mkdir build mkdir build\localize copy VERSION.TXT build\localize\ copy command.lsm build\localize\ copy docs\localize.txt build\localize\ REM make FreeDOS package structure md build\package SET pkgdir=build\package md %pkgdir%\APPINFO md %pkgdir%\BIN md %pkgdir%\DOC md %pkgdir%\DOC\COMMAND md %pkgdir%\HELP md %pkgdir%\NLS md %pkgdir%\SOURCE md %pkgdir%\SOURCE\FREECOM pushd . 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 EN English set buildfile=%0 call %0 buildall padding %languages% ::for %%a in (Dutch Spanish German Finnish French Italian Polish PT_BR Russian Swedish Serbian Slovene Turkish Ukr YU437 English) DO %0 %%a popd pushd . cd build\localize 7z a -mx9 -tzip ..\localize.zip . popd REM source with filetimes matching commit pushd . cd build md source cd source git clone https://github.com/FDOS/freecom.git cd freecom REM this is from git-tools, it is not included with git git restore-mtime REM remove git references rd /s /q .git rd /s /q .github del .gitattributes del .gitignore cd .. 7z a -mx9 -tzip ..\freecom-source.zip . popd REM make FreeDOS package pushd . copy command.lsm %pkgdir%\APPINFO\COMMAND.LSM copy bin\fdcom.ico %pkgdir%\BIN\FDCOM.ICO copy build\English\xmsswap\command.com %pkgdir%\BIN\COMMAND.COM copy FILE_ID.DIZ %pkgdir%\DOC\COMMAND\FILE_ID.DIZ copy README.md %pkgdir%\DOC\COMMAND\README.MD copy VERSION.TXT %pkgdir%\DOC\COMMAND\VERSION.TXT copy docs\HELP.EN %pkgdir%\HELP\COMMAND.EN copy docs\html\commands\cmd.html %pkgdir%\DOC\COMMAND\CMD.HTM copy docs\html\commands\FreeCOM.html %pkgdir%\DOC\COMMAND\FREECOM.HTM copy utils\MAKECMD.BAT %pkgdir%\NLS\MAKECMD.BAT :: language specific versions copied into NLS during build copy build\freecom-source.zip %pkgdir%\SOURCE\FREECOM\SOURCES.ZIP cd %pkgdir% 7z a -mx9 -tzip ..\command.zip . popd call clean SET languages= SET pkgdir= SET buildfile= ECHO Done bulding all! goto end :buildall rem skip past buildall dummy on first pass, skip last language on each successive pass shift shift rem %1 and %2 are abbr and language name if "%1"=="" goto end pushd . ECHO building %2 (%1) call %buildfile% dobuild %2 popd copy build\%2\xmsswap\command.com %pkgdir%\NLS\CMD-%1.COM goto buildall :dobuild rem skip past dobuild shift rem %1 is the language name (should match one of the *.LNG files) mkdir build\%1 copy VERSION.TXT build\%1\ copy command.lsm build\%1\ mkdir build\%1\xmsswap call build -r %BUILD_COMPILER% xms-swap %1 copy command.com build\%1\xmsswap\ copy tools\28.com build\%1\ copy tools\50.com build\%1\ copy tools\load_icd.exe build\%1\ copy strings\xmsswap.cln build\localize\ copy strings\fixstrs.exe build\localize\ copy strings\default.lng build\localize\ copy strings\%1.lng build\localize\ copy strings\strings.dat build\localize\%1.dat copy tools\28.com build\localize\ copy tools\50.com build\localize\ copy tools\load_icd.exe build\localize\ mkdir build\%1\kswap call build -r %BUILD_COMPILER% no-xms-swap %1 copy command.com build\%1\kswap\ copy docs\k-swap.txt build\%1\kswap\ copy tools\kssf.com build\%1\kswap\ copy tools\vspawn.com build\%1\kswap\ copy strings\command.cln build\localize\ copy tools\kssf.com build\localize\ copy tools\vspawn.com build\localize\ mkdir build\%1\debug call build -r %BUILD_COMPILER% xms-swap debug %1 copy command.com build\%1\debug\ mkdir build\%1\plainedt call build -r %BUILD_COMPILER% xms-swap plainedt %1 copy command.com build\%1\plainedt\ pushd . cd build\%1 7z a -mx9 -tzip ..\%1.zip . popd :end ================================================ FILE: ci_build.sh ================================================ #!/bin/sh set -e if [ ! -z "${TRAVIS_BUILD_DIR}" ] ; then CI_BUILD_DIR=${TRAVIS_BUILD_DIR} else CI_BUILD_DIR=$(pwd) fi echo CI_BUILD_DIR is \"${CI_BUILD_DIR}\" # Open Watcom Environment Setup export WATCOM=$CI_BUILD_DIR/_watcom export PATH=$CI_BUILD_DIR/bin:$PATH:$WATCOM/binl64 # Output directory rm -rf _output mkdir _output # Which ones to build LANGUAGES="english dutch finnish french german italian polish pt pt_br russian serbian slovene spanish swedish turkish ukr yu437" # GCC for lng in ${LANGUAGES} ; do # Do full clean for rebuild of each language echo "Do full clean" git clean -q -x -d -f -e _output -e _watcom -e _download export LNG=${lng} ./build.sh gcc TGT="_output/gcc/${LNG}" mkdir -p ${TGT} mv -i command.com ${TGT}/. done # Watcom for lng in ${LANGUAGES} ; do # Do full clean for rebuild of each language echo "Do full clean" git clean -q -x -d -f -e _output -e _watcom -e _download export LNG=${lng} ./build.sh wc TGT="_output/wc/${LNG}" mkdir -p ${TGT} mv -i command.com ${TGT}/. done # Let's use the just compiled command.com for the DOS builds and get some # testing of it for free. Note case insensitive target in case the freecom # package ever has an upper or mixed case file. echo Copying the GCC Linux built command.com to use for the DOS builds cp -v _output/gcc/english/command.com ${HOME}/.dosemu/drive_c/[Cc][Oo][Mm][Mm][Aa][Nn][Dd].[Cc][Oo][Mm] # Watcom (DOS) (slow so just English) mkdir -p _output/wc_dos/english git clean -q -x -d -f -e _output -e _watcom -e _download { echo set COMPILER=WATCOM echo set WATCOM='C:\\devel\\watcomc' echo set MAKE=wmake /ms /h /f makefile.mak echo set XNASM='C:\\devel\\nasm\\nasm' echo set XUPX=upx --8086 --best echo set OLDPATH=%PATH% echo set PATH='%WATCOM%\\binw;C:\\bin;%OLDPATH%' echo set DOS4G=QUIET } | unix2dos > config.bat cp config.std config.mak dosemu -td -q -K . -E "build.bat wc" mv -i command.com _output/wc_dos/english/. # Turbo C 2.01 (DOS) (slow so just Spanish) if [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then export LNG=spanish mkdir -p _output/tc2_dos/${LNG} git clean -q -x -d -f -e _output -e _watcom -e _downloads { echo set LNG=${LNG} echo set COMPILER=TC2 echo set TC2_BASE='C:\\tc201' echo set XNASM=nasm echo set XUPX=upx --8086 --best echo set OLDPATH=%PATH% echo set PATH='%TC2_BASE%;C:\\devel\\nasm;C:\\bin;%WATCOM%\\binw;%OLDPATH%' } | unix2dos > config.bat cp config.std config.mak dosemu -td -q -K . -E "build.bat" mv -i command.com _output/tc2_dos/${LNG}/. fi echo done ================================================ FILE: ci_prereq.sh ================================================ #!/bin/sh set -e sudo add-apt-repository -y ppa:dosemu2/ppa sudo add-apt-repository ppa:tkchia/build-ia16 sudo apt update # Common tools sudo apt install nasm upx sudo apt install dosemu2 dos2unix # GCC-IA16 for Linux sudo apt install gcc-ia16-elf libi86-ia16-elf # Tools for DOS builds mkdir -p _downloads mkdir -p _watcom cd _downloads HERE=$(pwd) # download and unpack Open Watcom snapshot [ -f ow-snapshot.tar.xz ] || wget --no-verbose https://github.com/open-watcom/open-watcom-v2/releases/download/Current-build/ow-snapshot.tar.xz tar -C ../_watcom -xf ow-snapshot.tar.xz #IBIBLIO_PATH='http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos' IBIBLIO_PATH='https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3' BASE=${IBIBLIO_PATH}/base # get FreeDOS kernel [ -f kernel.zip ] || wget --no-verbose ${BASE}/kernel.zip # get FreeCOM [ -f freecom.zip ] || wget --no-verbose ${BASE}/freecom.zip DEVEL=${IBIBLIO_PATH}/devel # get gnumake for DOS [ -f djgpp_mk.zip ] || wget --no-verbose ${DEVEL}/djgpp_mk.zip # get nasm for DOS [ -f nasm.zip ] || wget --no-verbose ${DEVEL}/nasm.zip # get upx for DOS [ -f upx.zip ] || wget --no-verbose ${DEVEL}/upx.zip # get Watcom for DOS [ -f watcomc.zip ] || wget --no-verbose ${DEVEL}/watcomc.zip # get Turbo C 2.01 (maybe encrypted) tar file if [ -n "${TC201_ARCHIVE_FILENAME}" ] && [ ! -f ${TC201_ARCHIVE_FILENAME} ] ; then echo "Downloading Turbo C 2.01" wget --no-verbose ${TC201_ARCHIVE_PATHNAME}/${TC201_ARCHIVE_FILENAME} fi # Unpack the DOS binaries mkdir -p ${HOME}/.dosemu/drive_c cd ${HOME}/.dosemu/drive_c && ( mkdir -p bin # Boot files unzip -LL -q ${HERE}/kernel.zip cp -p bin/kernl386.sys ./kernel.sys unzip -LL -q ${HERE}/freecom.zip cp -p bin/command.com ./command.com cp -p /usr/share/dosemu/dosemu2-cmds-0.3/c/fdconfig.sys . # Development files unzip -LL -q ${HERE}/djgpp_mk.zip cp -p devel/djgpp/bin/make.exe bin/. unzip -LL -q ${HERE}/upx.zip cp -p devel/upx/upx.exe bin/. echo PATH to make and upx binaries is 'c:/bin' unzip -LL -q ${HERE}/nasm.zip echo PATH to nasm binary is 'c:/devel/nasm' unzip -LL -q ${HERE}/watcomc.zip echo PATH to watcom binaries is 'c:/devel/watcomc/binw' # Turbo C if [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] && [ -n "${TC201_ARCHIVE_PASSPHRASE}" ] ; then echo Decrypting and unpacking Turbo C 2.01 echo "${TC201_ARCHIVE_PASSPHRASE}" | gpg --decrypt --batch --passphrase-fd 0 ${HERE}/${TC201_ARCHIVE_FILENAME} | tar -jxf - elif [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] ; then echo Unpacking Turbo C 2.01 tar -jxf ${HERE}/${TC201_ARCHIVE_FILENAME} else echo No Turbo C 2.01 archive available fi ) ================================================ FILE: ci_test.sh ================================================ #!/bin/sh echo No tests created yet! exit 0 ================================================ FILE: clean.bat ================================================ @echo off if "%1"=="" goto main for %%i in (%2 %3 %4 %5 %6 %7 %8 %9) do if exist %1%%i del %1%%i>nul goto end :main cd suppl call clnsuppl.bat cd .. call %0 .\ command.com command.upx call %0 .\ lastmake.mk context.h_c context.inc strings.h infores info.txt gnuconf.mak call %0 criter\ criter criter1 context.def context.inc context.h_c call %0 strings\ command.cln xmsswap.cln strings.h strings.err strings.dat strings.log call %0 strings\strings\ makefile strings.mak call %0 strings\strings\*. c call %0 tools\ makefile.mak call %0 tools\*. icd for %%i in (cmd lib strings strings\strings) do call %0 %%i\*. lib lst for %%i in (cmd lib shell strings strings\strings tools utils utilsc) do call %0 %%i\*. obj o cfg map exe com rsp for %%i in (cmd lib shell strings strings\strings tools utils utilsc) do call %0 %%i\ echoto.bat echolib.bat gnumake.mak for %%i in (. criter) do call %0 %%i\ gnumake.mak :end ================================================ FILE: clean.sh ================================================ #!/bin/sh cd suppl rm -f all_done untar.exe untar.com untar.obj untar.map gnumake.mak rm -f compile.me suppl*.lib suppl*.lst echoto.bat vars.bat *.cfg cd src rm -f *.obj suppllib.rsp echoto.bat echolib.bat *.cfg gnumake.mak suppl*.lib suppl*.lst cd ../.. rm -f command.com command.upx rm -f lastmake.mk context.h_c context.inc strings.h infores info.txt cd strings && rm -f strings.h strings.err strings.dat strings.log cd ../criter && rm -f criter criter1 context.def context.inc context.h_c cd ../strings/strings && rm -f *.c makefile strings.mak cd ../../tools && rm -f makefile.mak *.icd cd .. for i in cmd lib strings strings/strings; do rm -f $i/*.lib $i/*.lst; done for i in cmd lib shell strings strings/strings tools utils utilsc; do rm -f $i/gnumake.mak $i/*.obj $i/*.o $i/*.cfg $i/*.map $i/*.exe rm -f $i/*.com $i/*.rsp $i/echoto.bat $i/echolib.bat done for i in . criter; do rm -f $i/gnumake.mak; done ================================================ FILE: cmd/alias.c ================================================ /* $Id$ * ALIAS.C - alias administration module * */ #include "../config.h" #include #include "../err_fcts.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../include/misc.h" #include "../strings.h" int cmd_alias(char *param) { char *value; /* Bail on every option */ if(leadOptions(¶m, 0, 0) != E_None) return 1; /* *param != whitespace */ switch(breakVarAssign(ctxtAlias, param, &value)) { case 1: /* no equal sign */ error_syntax(0); return 1; case 0: /* displayed */ return 0; #ifdef DEBUG case 2: break; default: dprintf(("[ALIAS: Invalid response from breakVarAssign()]\n")); return 1; #endif } /* param[] == alias name -> check its validity */ rtrimsp(param); /* spaces are ignored at its end */ if(!*param) { error_syntax(0); return 1; } if(!is_fnstr(param)) { error_no_alias_name(param); return 1; } StrFUpr(param); /* Aliases are case-insensitive */ value = trimsp(value); return chgCtxt(CTXT_TAG_ALIAS, param, *value? value: 0); } ================================================ FILE: cmd/beep.c ================================================ /* $Id$ * BEEP.C - beep command. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * */ #include "../config.h" #include "../include/command.h" #include "../include/misc.h" int cmd_beep (char * param) { (void)param; beep (); return 0; } ================================================ FILE: cmd/break.c ================================================ /* $Id$ * BREAK.C - break command. * * Comments: * * 14-Aug-1998 (John P Price) * started. * */ #include "../config.h" #include "../err_fcts.h" #include "../include/command.h" #include "../include/misc.h" #include "../strings.h" int cmd_break(char *param) { switch(onoffStr(param)) { default: error_on_off(); return 1; case OO_Null: case OO_Empty: displayString(TEXT_MSG_BREAK_STATE, getbreak() ? D_ON : D_OFF); break; case OO_Off: setbreak(0); break; case OO_On: setbreak(1); break; } return 0; } ================================================ FILE: cmd/call.c ================================================ /* $Id$ * CALL.C - batch file call command. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 04-Aug-1998 (Hans B Pufal) * - added lines to initialize for pointers (HBP004) This fixed the * lock-up that happened sometimes when calling a batch file from * another batch file. * * 10-Aug-1998 ska * - changed: initialize bcontext with function * */ #include "../config.h" #include #include #include #include "../include/batch.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/kswap.h" static int optS = 0; /* force to swap out FreeCOM during call */ static int optN = 0; /* force to NOT swap (superceeds optS) */ optScanFct(opt_call) { (void)arg; switch(ch) { case 'S': return optScanBool(optS); case 'N': return optScanBool(optN); case 'Y': return optScanBool(tracemode); } optErr(); return E_Useage; } /* * Perform CALL command. * * Allocate a new batch context and add it to the current chain. * Call parsecommandline passing in our param string * If No batch file was opened then remove our newly allocted * context block. */ int cmd_call (char * param) { struct bcontext *n = newBatchContext(); int ec; (void)param; if (n == 0) { /* Not in a batch file */ return 1; } optS = optN = 0; if((ec = leadOptions(¶m, opt_call, 0)) != E_None) return ec; if(swapOnExec != ERROR) { if(optS) swapOnExec = TRUE; if(optN) swapOnExec = FALSE; } parsecommandline(param, FALSE); if(swapOnExec != ERROR) swapOnExec = FALSE; if (bc->bfile == 0 && bc->bfnam == 0) { /* Wasn't a batch file so remove context */ bc = bc->prev; free(n); } return 0; } ================================================ FILE: cmd/cdd.c ================================================ /* $Id$ * CDD - changes drive and directory */ #include "../config.h" #include "../include/command.h" int cmd_cdd(char *param) { return cd_dir(param, 1, "CDD"); } ================================================ FILE: cmd/chcp.c ================================================ /* $Id$ * CHCP.C - CHCP command. CHCP [codepage] via DOS-66-01/02 $Log$ Revision 1.3 2004/07/19 18:13:39 skaus bugfix: CHCP: use n to set new codepage [Eduardo Casino] Revision 1.2 2003/03/05 17:43:51 skaus bugfix: cached NLS data not flushed Revision 1.1 2002/11/12 21:47:16 skaus add: CHCP (disabled by default) */ #include "../config.h" #include #include #include #include #include "../err_fcts.h" #include "../include/command.h" #include "../include/cmdline.h" #include "../include/nls.h" #include "../strings.h" int cmd_chcp(char *param) { USEREGS unsigned curCP, sysCP; _AX = 0x6601; _BX = 0xffffU; geninterrupt(0x21); curCP = _BX; sysCP = _DX; if(_CFLAG || curCP == 0xffffU) { error_get_codepage(); return 1; } if(!param || !*param) { /* display current codepage */ displayString(TEXT_DISPLAY_CODEPAGE, curCP, sysCP); } else { char *p; unsigned n = 0; /* set code page */ if(!isdigit(*param)) { error_syntax(param); return 1; } p = param; do n = n * 10 + (*p - '0'); while (isdigit(*++p)); if(*ltrimcl(p)) { error_syntax(param); return 1; } invalidateNLSbuf(); _DX = sysCP; _BX = n; _AX = 0x6602; geninterrupt(0x21); if(_CFLAG) { error_set_codepage(); return 1; } } return 0; } ================================================ FILE: cmd/chdir.c ================================================ /* $Id$ * CD / CHDIR - changes the current working directory of a drive */ #include "../config.h" #include "../include/command.h" int cmd_chdir(char *param) { return cd_dir(param, 0, "CHDIR"); } ================================================ FILE: cmd/cls.c ================================================ /* $Id$ * CLS.C - clear screen internal command * * Comments: * * Issues ^L (Form Feed), then: * if file descriptor #1 (aka stdout) is connected to a device _and_ * is not the NUL: device, uses the BIOS to clear the screen * and home the cursor to the upper left. * * 07/27/1998 (John P. Price) * started. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 30-Nov-1998 (John P Price ) * - CLS now sets the text colors to lightgray on black before clearing the * screen. * * $Log$ * Revision 1.9 2006/09/05 01:44:32 blairdude * Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. * * Revision 1.8 2006/06/12 04:55:42 blairdude * 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 * significantly smaller. * * Revision 1.7 2006/06/11 02:06:11 blairdude * * * All of FreeCOM now uses write instead of putchar and intr instead of int86[x] or intdos[x] * * Revision 1.6 2004/08/19 19:10:49 skaus * fix: CLS: cut debug message * * Revision 1.5 2004/06/29 14:14:54 skaus * fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} * * Revision 1.4 2004/06/15 19:27:43 skaus * bugfix: CLS: use BIOS, unless fd1 is file or NUL {Eric Auer} * */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/openf.h" #include "../include/misc.h" int cmd_cls (char * param) { int attr = fdattr(1); (void)param; outc( '\xc' ); /* ^L Form feed */ /* Output stream is standard CON device */ if((attr & 0x9f) == 0x93) { unsigned attr = 0x0700; int mode; IREGS r; /* Get the current video mode */ r.r_ax = 0x0f00; /* Scroll window up // entire window */ intrpt(0x10, &r); mode = r.r_ax & 0x7f; switch (mode) { case 0x04: /* CGA 320x200 */ case 0x05: /* CGA 320x200, grayscale */ case 0x09: /* PCjr 320x200 */ case 0x0a: /* PCjr 640x200 */ case 0x0b: /* Tandy 1000 SL/TL */ case 0x0d: /* EGA/VGA 320x200, 16 colors */ case 0x0e: /* EGA/VGA 640x200, 16 colors */ case 0x0f: /* EGA/VGA 640x350, mono */ case 0x10: /* EGA/VGA 640x350, 4 or 16 colors */ case 0x11: /* VGA 640x480, mono */ case 0x12: /* VGA 640x480, 16 colors */ case 0x13: /* VGA 320x200, 256 colors */ case 0x59: /* SVGA 800x600, 16 colors */ attr = 0; break; default: ; } /* Now roll the screen */ r.r_ax = 0x0600; /* Scroll window up // entire window */ r.r_bx = attr; /* Attribute to write */ r.r_cx = 0x0000; /* Upper left */ r.r_dx = ((SCREEN_ROWS - 1) << 8) | (SCREEN_COLS - 1); /* Lower right */ intrpt(0x10, &r); goxy(1, 1); /* home the cursor */ } else if((attr & 0x9c) == 0x80) { /* character device neither NUL nor CLOCK$ nor standard CON (guess AUX or COMn, which is connected commmon serial terminal) */ outs( "\x1b[2J" ); } return 0; } ================================================ FILE: cmd/cmd.m1 ================================================ .AUTODEPEND CFG_DEPENDENCIES = makefile.mak !include "..\config.mak" all: $(CFG) cmds.lib ================================================ FILE: cmd/cmd.m2 ================================================ ================================================ FILE: cmd/copy.c ================================================ /* $Id$ * COPY.C -- Internal Copy Command * * 1999/05/10 ska * rewritten, based upon previous COPY.C of FreeCom v0.76b * * Known bugs: * + Multiple '+' plus signs are scanned as a single one. * * 1999/07/08 ska * bugfix: destination is a drive letter only * * 2000/07/17 Ron Cemer * bugfix: destination ending in "\\" must be a directory, but fails * within dfnstat() * * 2000/07/24 Ron Cemer * bugfix: Suppress "Overwrite..." prompt if destination is device * * 2001/02/17 ska * add: interactive command flag * bugfix: copy 1 + 2 + 3 <-> only first and last file is stored */ #include "../config.h" #include #include #include #include #include #include #include #include #include #include /*#define DEBUG*/ #include "dfn.h" #include "suppl.h" #include "supplio.h" #include "../include/lfnfuncs.h" #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../strings.h" #include "../include/openf.h" #define ASCII 1 #define BINARY 2 #define IS_DIRECTORY 5 static struct CopySource { struct CopySource *nxt; /* next source */ struct CopySource *app; /* list of files to append */ int flags; /* ASCII / Binary */ char *fnam; /* filename */ } *head, *last, *lastApp; static int appendToFile; /* Append the next file rather than new source */ static char *destFile; /* destination file/directory/pattern */ static int destFlags; static int optY, optV, optA, optB; optScanFct(opt_copy) { (void)arg; switch(ch) { case 'Y': return optScanBool(optY); case 'V': return optScanBool(optV); case 'A': case 'B': return E_Ignore; } optErr(); return E_Useage; } optScanFct(opt_copy1) { int ec, *opt = NULL, *optReset = NULL; (void)arg; switch(ch) { #ifndef NDEBUG default: fprintf(stderr, "Invalid option: file '%s' in line %d\n" , __FILE__, __LINE__); abort(); #endif case 'A': opt = &optA; optReset = &optB; break; case 'B': opt = &optB; optReset = &optA; break; } if((ec = optScanBool(*opt)) == E_None && *opt) *optReset = 0; return ec; } static void initContext(void) { appendToFile = 0; last = lastApp = 0; } static void killContext(void) { if(last) { assert(head); do { if((lastApp = head->app) != 0) do { lastApp = (last = lastApp)->app; free(last); } while(lastApp); head = (last = head)->nxt; free(last); } while(head); } } /* faster copy, using large (far) buffers */ /* a) this copies data, using a 60K buffer b) if transfer is slow (or on a huge file), indicate some progress */ static int BIGcopy(int fdout, int fdin, int asc) { char far *buffer; unsigned size; unsigned rd; int retval = 0; /* stat stuff */ unsigned startTime, lastTime=0, now, doStat = 0, deviceIn; unsigned long copied = 0, toCopy = filelength(fdin); char *statString; char far *ctrlz; /* Fetch the largest available buffer */ for(size = 60*1024u; size != 0; size -= 4*1024) { #ifdef FARDATA /* use last-fit allocation to work well with large model */ buffer = MK_SEG_PTR(void, DOSalloc(size/16,2)); #else buffer = MK_SEG_PTR(void, DOSalloc(size/16,0)); #endif if(buffer != NULL) goto ok; } return 3; /* out of memory error */ ok: dprintf( ("[MEM: BIGcopy() allocate %u bytes @ 0x%04x]\n" , size, FP_SEG(buffer)) ); deviceIn = isadev(fdin); statString = getString(deviceIn ? TEXT_COPY_COPIED_NO_END : TEXT_COPY_COPIED); startTime = *(unsigned far *)MK_FP(0x40,0x6c); ctrlz = 0; while((rd = farread(fdin, buffer, size)) != 0) { if(rd == 0xffff) { retval = 1; goto _exit; } if(asc) { ctrlz = _fmemchr(buffer, 0x1a, rd); if(ctrlz != 0) rd = (unsigned)(ctrlz - buffer); } if(farwrite(fdout, buffer, rd) != rd) { if(!isadev(fdout)) retval = 2; goto _exit; } /* statistics */ copied += rd; now = *(unsigned far *)MK_FP(0x40,0x6c); if(!doStat && now - startTime > 15 * 18 && isatty(fileno(stdout))) doStat = TRUE; if(now - lastTime > 18) { if(doStat) printf(statString, copied/1024, toCopy/1024); if(cbreak) { retval = 3; goto _exit; } lastTime = now; } if(ctrlz || (rd < size && !(deviceIn && asc))) break; } _exit: if(doStat) printf("%30s\r",""); dprintf( ("[MEM: BIGcopy() release memory @ 0x%04x]\n" , FP_SEG(buffer)) ); DOSfree(FP_SEG(buffer)); free(statString); return retval; } static int is_valid_disk(int tstdsk) { int savdsk = getdisk(); int newdsk; /* Change to new disk */ setdisk(tstdsk); newdsk = getdisk(); /* Restore */ setdisk(savdsk); return (newdsk == tstdsk); } static int copy(char *dst, char *pattern, struct CopySource *src , int openMode) { struct dos_ffblk ff; struct CopySource *h; char rDest[MAXPATH], rSrc[MAXPATH]; int fdin, fdout; int rc; FLAG keepFTime; #if defined(__WATCOMC__) && __WATCOMC__ < 1280 unsigned short date, time; #elif defined(__TURBOC__) struct ftime fileTime; #else unsigned date, time; #endif char *srcFile; FLAG wildcarded; /*FLAG isfirst = 1;*/ FLAG singleFileCopy = src->app == NULL; assert(dst); assert(pattern); assert(src); if(strpbrk(pattern, "*?") == 0) { srcFile = dfnfilename(pattern); wildcarded = 0; } else if(dos_findfirst(pattern, &ff, FA_RDONLY | FA_ARCH) != 0) { error_sfile_not_found(pattern); return 0; } else { srcFile = ff.ff_name; wildcarded = 1; } do { /* if( wildcarded && !strpbrk( dst, "*?" ) && !isfirst ) openMode = O_APPEND; */ fillFnam(rDest, dst, srcFile); if(rDest[0] == 0) return 0; h = src; do { /* to prevent to open a source file for writing, e.g. for COPY *.c *.? */ fillFnam(rSrc, h->fnam, srcFile); if(rSrc[0] == 0) { return 0; } rc = samefile(rDest, rSrc); if(rc < 0) { error_out_of_memory(); return 0; } else if(rc) { error_selfcopy(rDest); return 0; } } while((h = h->app) != 0); /* Concenation of files uses ASCII by default */ if(src->app) { for(h = src; h && !h->flags; h = h->app) h->flags = ASCII; if(!destFlags) destFlags = ASCII; } if(interactive_command /* Suppress prompt if in batch file */ && openMode != O_APPEND && !optY && (fdout = dos_open(rDest, O_RDONLY)) >= 0) { int destIsDevice = isadev(fdout); dos_close(fdout); if(!destIsDevice) { /* Devices do always exist */ if((fdin = devopen(rSrc, O_RDONLY)) < 0) { /* Source doesn't exist */ error_open_file( rSrc ); return 0; } else { dos_close(fdin); switch(userprompt(PROMPT_OVERWRITE_FILE, rDest)) { default: /* Error */ case 4: /* Quit */ return 0; case 3: /* All */ optY = 1; case 1: /* Yes */ break; case 2: /* No */ continue; } } } } if(cbreak) { return 0; } if((fdout = devopen(rDest, openMode)) < 0) { error_open_file(rDest); return 0; } keepFTime = 1; if(isadev(fdout)) { if(destFlags & BINARY) { /* in forced binary mode character devices are set to raw */ fdsetattr(fdout, (fdattr(fdout) & 0xff) | 0x20); } keepFTime = 0; } h = src; keepFTime = (keepFTime && h->app == 0); do { fillFnam(rSrc, h->fnam, srcFile); if(rSrc[0] == 0) { dos_close(fdout); unlink(rDest); /* if device -> no removal, ignore error */ return 0; } if((fdin = devopen(rSrc, O_RDONLY)) < 0) { error_open_file(rSrc); dos_close(fdout); unlink(rDest); /* if device -> no removal, ignore error */ return 0; } if(isadev(fdin)) { keepFTime = 0; /* Cannot keep file time of devices */ if(h->flags & BINARY) /* in forced binary mode character devices are set to raw */ fdsetattr(fdin, (fdattr(fdin) & 0xff) | 0x20); else /* make sure to stop at Ctrl-Z */ h->flags |= ASCII; } if(keepFTime) #ifdef __TURBOC__ if(getftime(fdin , &fileTime)) #else if(_dos_getftime(fdin , &date , &time)) #endif keepFTime = 0; /* if error: turn it off */ displayString(TEXT_MSG_COPYING, rSrc , (openMode == 'a' || h != src)? "=>>": "=>", rDest); if(cbreak) { dos_close(fdin); dos_close(fdout); unlink(rDest); /* if device -> no removal, ignore error */ return 0; } /* Now copy the file */ rc = 1; { FLAG sizeChanged = !(h->flags & ASCII) && singleFileCopy && !isadev(fdin) && !isadev(fdout); if(sizeChanged) { /* faster copy, *MUCH* faster on floppies change destination filesize to wanted size. this a) writes all required entries to the FAT (faster) determines, if there is enough space on the destination device no need to copy file, if it won't fit */ /* No test if chsize() fails for MS DOS 5/6 bug see RBIL DOS-40 */ /* Don't use chsize() as Turbo RTL fills with '\0' bytes, which is not useful here */ lseek(fdout, filelength(fdin), SEEK_SET); if(truncate(fdout) != 0 || lseek(fdout, 0, SEEK_SET) == -1) { error_write_file_disc_full(rDest, filelength(fdin)); rc = 0; } else { dprintf( ("[COPY chsize(%s, %lu)]\n", rDest, filelength(fdin)) ); } } if(rc != 0) switch(BIGcopy(fdout, fdin, h->flags & ASCII)) { case 0: if(sizeChanged) /* probably the source file got truncated */ /* we silently ignore any failure here, because it is assumed that we never extend, but truncate the file only (or do not change the length at all) */ truncate(fdout); break; case 1: error_read_file(rSrc); rc = 0; break; case 2: error_write_file(rDest); rc = 0; break; default: error_copy(); rc = 0; break; } } if(cbreak) rc = 0; dos_close(fdin); if(!rc) { dos_close(fdout); unlink(rDest); /* if device -> no removal, ignore error */ return 0; } } while((h = h->app) != 0); rc = 0; if((destFlags & ASCII) && !isadev(fdout)) { /* append the ^Z as we copied in ASCII mode */ if (dos_write(fdout, "\x1a", 1) != 1) rc = 1; } if(keepFTime) #ifdef __TURBOC__ setftime(fdout, &fileTime); #else _dos_setftime(fdout, date, time); #endif if(dos_close(fdout) != 0) rc = 1; if(rc) { error_write_file(rDest); unlink(rDest); /* if device -> no removal, ignore error */ return 0; } } while (wildcarded && dos_findnext(&ff) == 0); /*} while(wildcarded && FINDNEXT(&ff) == 0 && !(isfirst = 0)); */ dos_findclose(&ff); return 1; } static int copyFiles(struct CopySource *h) { int differ, rc; rc = 0; #define dst destFile if((differ = samefile(h->fnam, dst)) < 0) error_out_of_memory(); else if(!differ) rc = copy(dst, h->fnam, h, O_WRONLY|O_TRUNC|O_CREAT); else if(h->app) rc = copy(dst, h->fnam, h->app, O_WRONLY|O_APPEND); else error_selfcopy(dst); #undef dst return rc; } static int cpyFlags(void) { return (optA? ASCII: 0) | (optB? BINARY: 0); } static struct CopySource *srcItem(char *fnam) { struct CopySource *h; if((h = malloc(sizeof(struct CopySource))) == 0) { error_out_of_memory(); return 0; } h->fnam = fnam; h->nxt = h->app = 0; h->flags = cpyFlags(); return h; } static int addSource(char *p) { struct CopySource *h; char *q; assert(p); q = strtok(p, "+"); assert(q && *q); if(appendToFile) { appendToFile = 0; if(!lastApp) { error_leading_plus(); return 0; } } else { /* New entry */ if(0 == (h = srcItem(q))) return 0; if(!last) last = lastApp = head = h; else last = lastApp = last->nxt = h; if((q = strtok(0, "+")) == 0) /* no to-append file */ return 1; } /* all the next files are to be appended to the source in "last" */ assert(q); assert(lastApp); do { if(0 == (h = srcItem(q))) return 0; lastApp = lastApp->app = h; } while((q = strtok(0, "+")) != 0); return 1; } int cmd_copy(char *rest) { char **argv, *p; int argc, opts, argi; struct CopySource *h; char **argBuffer = 0; /* Initialize options */ optA = optB = optV = optY = 0; /* read the parameters from env */ if ((argv = scanCmdline(p = getEnv("COPYCMD"), opt_copy, 0, &argc, &opts)) == 0) { free(p); return 1; } free(p); freep(argv); /* ignore any parameter from env var */ if((argv = scanCmdline(rest, opt_copy, 0, &argc, &opts)) == 0) return 1; initContext(); /* Now parse the remaining arguments into the copy file structure */ for(argi = 0; argi < argc; ++argi) if(isoption(p = argv[argi])) { /* infix /a or /b */ if(leadOptions(&p, opt_copy1, 0) != E_None) { killContext(); freep(argv); return 1; } /* Change the flags of the previous argument */ if(lastApp) lastApp->flags = cpyFlags(); } else { /* real argument */ if(*p == '+') { /* to previous argument */ appendToFile = 1; while(*++p == '+'); if(!*p) continue; } if(!addSource(p)) { killContext(); freep(argv); return 1; } } if(appendToFile) { error_trailing_plus(); killContext(); freep(argv); return 1; } if(!last) { /* Nothing to do */ error_nothing_to_do(); killContext(); freep(argv); return 1; } assert(head); /* Check whether the source items are files or directories */ h = head; argc = 0; /* argBuffer entries */ do { struct CopySource *p = h; do { char *s = strchr(p->fnam, '\0') - 1; if(*s == '/' || *s == '\\' /* forcedly be directory */ || 0 != (dfnstat(p->fnam) & DFN_DIRECTORY)) { char **buf; char *q; if(*s == ':') q = dfnmerge(0, p->fnam, 0, "*", "*"); else q = dfnmerge(0, 0, p->fnam, "*", "*"); if(0 == (buf = realloc(argBuffer, (argc + 2) * sizeof(char*))) || !q) { free(q); error_out_of_memory(); goto errRet; } argBuffer = buf; buf[argc] = p->fnam = q; buf[++argc] = 0; } else if(*s == ':' && (s - p->fnam) > 1) { /* Device name LPT1:, but not X: */ if(!isDeviceName(p->fnam)) { error_invalid_parameter(p->fnam); goto errRet; } } } while(0 != (p = p->app)); } while(0 != (h = h->nxt)); destFlags = last->flags; if(last != head) { /* The last argument is to be the destination */ if(last->app) { /* last argument is a + b syntax -> no dst! */ error_copy_plus_destination(); goto errRet; } destFile = last->fnam; h = head; /* remove it from argument list */ while(h->nxt != last) { assert(h->nxt); h = h->nxt; } free(last); (last = h)->nxt = 0; } else { /* Nay */ destFile = ".\\*.*"; } #define dst destFile /* If the destination specifies a drive, check that it is valid */ if (dst[0] && dst[1] == ':' && !is_valid_disk(toupper(dst[0]) - 'A')) { error_invalid_drive(toupper(dst[0]) - 'A'); return 0; } #undef dst /* Now copy the files */ h = head; while(copyFiles(h) && (h = h->nxt) != 0); errRet: killContext(); freep(argv); freep(argBuffer); return 0; } ================================================ FILE: cmd/ctty.c ================================================ /* $Id$ * CTTY.C - ctty command. * * Comments: * * Current possible problems: -- 2000/01/14 ska * * Problem: Only the first three handles are changed to the passed device. * --> * As far as I know to CTTY (Change TTY) it is not sufficient just to * change the handles 0-2 (stdin, stdout, stderr), but one must inform * the system that another driver is the default STDIN/OUT device, * what would include to: * + return ienabled STDIN/STDOUT bits when the device attributes are * retreived via IOCTL, * + change the pointer at LoL+0C. * My original implication that INT-29 is effected, too, is wrong in * the Win98 DOSbox. * * FreeDOS kernel 2017f passes the DOS1-compatible IO functions to * the handle based ones, so maybe most simply programs will work?! * * 14 Aug 1998 (John P Price) * - Created dummy command. * * 2000/01/14 ska * + Added to change the first three handles to the given device name * + Supports only redirection of stdin and stdout, e.g.: * C:\> CTTY COM1 >file * -or- * C:\> echo Hallo | CTTY COM1 | echo du * The CTTY command effects the commands on the _next_ line. */ #include "../config.h" #include #ifdef DEBUG #include #endif #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/openf.h" #include "../strings.h" #include "../include/lfnfuncs.h" #ifdef DEBUG static void devAttr(int fd) { int attr; if((attr = fdattr(fd)) == 0) { dprintf(("[Failed to read attributes of fd #%d]\n", fd)); } else { dbg_print("[fd #%d is", fd); if(attr & 0x80) { if(attr & 7) { if(attr & 1) dbg_outs(" STDIN"); if(attr & 2) dbg_outs(" STDOUT"); if(attr & 4) dbg_outs(" NUL"); } else dbg_outs(" a device"); } else dbg_outs(" a file"); dbg_outsn("]"); } } #endif int cmd_ctty(char *param) { int f, attr, failed; if(!param || !*param) { displayString(TEXT_CMDHELP_CTTY); return 1; } #ifdef DEBUG devAttr(0); devAttr(1); devAttr(2); #endif if((f = devopen(param, O_RDWR)) < 0) { error_no_rw_device(param); return 1; } if(((attr = fdattr(f)) & 0x80) == 0 || dos_write(f, "\r\n", 2) != 2) { /* need \r as in bin mode */ dos_close(f); error_no_rw_device(param); return 1; } /* Now inform the system that this device is the new console now; STDIN and STDOUT flag are the most lowest two bits */ fdsetattr(f, (attr & 0xFF) | 0x03); /* Now change the file descriptors: 0 := rdonly 1,2 := wronly if CTTY is called within a pipe or its I/O is redirected, oldinfd or oldoutfd is not equal to -1. In such case the old*fd is modified in order to effect the file descriptor after the redirections are restored. Otherwise a pipe or redirection would left CTTY in a half-made status. */ failed = dup2(f, 2); /* no redirection support */ if(oldinfd != -1) dos_close(oldinfd); oldinfd = f; if(oldoutfd != -1) dos_close(oldoutfd); if((oldoutfd = dup(f)) == -1) failed = 1; if(failed) error_ctty_dup(param); else { setCurrentConDev(param); /* workaround: do not use enhanced input if switched device is not standard 'CON' */ set_readcommandType( (attr & 0x9f) == 0x93 ); } return failed; } ================================================ FILE: cmd/date.c ================================================ /* $Id$ * DATE.C - date internal command * * Comments: * * 08 Jul 1998 (John P. Price) * started. * * 20 Jul 1998 (John P. Price) * - corrected number of days for December from 30 to 31. * (Thanx to Steffen Kaiser for bug report) * * 27-Jul-1998 (John P Price ) * - added config.h include * * 29-Jul-1998 (Rob Lake) * - fixed stand-alone mode. Added Pacific C compatible dos_getdate functions * * 1999/03/17 ska * bugfix: detection for invalid date strings. * Now the whole string must match: ^\s*\d+(.(\d+(.\d*)?)?)?\s*$ * The numbers can be delimited by any character from the 7-bit ASCII set, * which is printable, but not alphanumerical. * One need not specify all three parts (in which case the delimiter * may be omitted, too). If one specify; * 1 number --> only the day changes * 2 numbers --> month/day; year remains unchanged * 3 numbers --> month/day/year * * 2001/02/08 ska * chg: two-digit year -> 2000 if less than 80 * add: DATE /D and TIME /T * * 2001/02/14 ska * fix: years in range 80..199 are promoted to century 1900 * allows to parse dates created with year100 bug (by Arkady) */ #include "../config.h" #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../include/nls.h" #include "../strings.h" static int noPrompt = 0; optScanFct(opt_date) { (void)arg; switch(ch) { case 'D': case 'T': return optScanBool(noPrompt); } optErr(); return E_Useage; } static int my_setdate(const char *s) { struct dosdate_t d; switch(parsedate(s, &d)) { case E_None: /* success -> set the date */ _dos_setdate(&d); _dos_setdate(&d); /* In WinNT the date is often one day +/- */ /* fall through */ case E_Empty: /* empty line */ return 1; /* success */ } return 0; /* failure */ } int cmd_date(char *param) { char s[40]; int ec; noPrompt = 0; #ifdef FEATURE_NLS refreshNLS(); #endif if((ec = leadOptions(¶m, opt_date, 0)) != E_None) return ec; if (!*param) { char *date; if((date = curDateLong()) == 0) return 1; /* out of mem */ displayString(TEXT_MSG_CURRENT_DATE, date); free(date); param = 0; } while(1) { /*forever loop */ if (!param) { int len; if(noPrompt) return 0; displayString(TEXT_MSG_ENTER_DATE_AMERICAN #ifdef FEATURE_NLS + nlsBuf->datefmt, nlsBuf->dateSep, nlsBuf->dateSep #else , "-", "-" #endif ); len = dos_read(0, s, sizeof(s) - 1); if(cbreak || len < 0) return 1; s[len] = '\0'; param = s; } if(my_setdate(param)) break; error_invalid_date(); /* force input the next time around. */ param = 0; } return 0; } ================================================ FILE: cmd/del.c ================================================ /* $Id$ * DEL.C - del command. * * Comments: * * 06/29/98 (Rob Lake rlake@cs.mun.ca) * rewrote del to support wildcards * added my name to the contributors * * 07/13/98 (Rob Lake) * - fixed bug that caused del not to delete file with out attribute. * - moved set, del, ren, and ver to there own files * * 27-Jul-1998 (John P Price ) * - added config.h include * * 09-Aug-1998 (Rob Lake ) * - changed check for ^C * - alloced mem for char **arg * * 10-Aug-1998 ska * - fixed allocation of char **arg incl. out-of-memory check * * 1998/12/04 ska * - chg: vcgetchar() displays a space rather beep()s for no-printable * characters. the caller can beep() * - chg: moved vcgetchar() to misc.c as it is multiply used now * - chg: use vcgetcstr() instead of vcgetchar() loop * * 1999/04/27 ska * chg: uniform command line parser * add: allow multiple patterns on command line * add: delete count * * 1999/07/02 ska * chg: replaced stat() by dfnstat() [reduces size of image] */ #include "../config.h" #include #include #include #include #include #include #include "suppl.h" #include "dfn.h" #include "../include/lfnfuncs.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../strings.h" #ifdef FEATURE_LONG_FILENAMES #define abspath( x, y ) abspath( getshortfilename( x ), y ) #endif static int optP, verbose; optScanFct(opt_del) { (void)arg; switch(ch) { case 'P': return optScanBool(optP); case 'V': return optScanBool(verbose); } optErr(); return E_Useage; } int cmd_del(char *param) { int ec = E_None; /* exit code */ int i; unsigned count = 0; struct dos_ffblk f; /* Make fullname somewhat larger to ensure that appending a matched name, one backslash and one hope. */ char fullname[MAXPATH + sizeof(f.ff_name) + 2], *p, *q; int len; char **arg; int argc, optc; /* initialize options */ verbose = optP = 0; if((arg = scanCmdline(param, opt_del, 0, &argc, &optc)) == 0) return E_Other; if(!argc) { error_req_param_missing(); ec = E_Useage; } else { i = 0; do { assert(arg[i]); /* Get the pattern fully-qualified */ /* Note: An absolute path always contains: A:\\ --> It's always three bytes long at minimum and always contains a backslash */ p = abspath(arg[i], 1); if(!p) return E_Other; assert(strlen(p) >= 3); if((len = strlen(p)) >= MAXPATH) { error_filename_too_long(p); free(p); ec = E_Other; goto errRet; } strcpy(fullname, p); /* Operating over a local buffer simplifies the process; rather than keep the pattern within dynamic memory */ free(p); p = fullname + len; /* check if it is a directory */ if(dfnstat(fullname) & DFN_DIRECTORY) { if (p[-1] != '\\') *p++ = '\\'; } if(p[-1] == '\\') /* delete a whole directory */ p = stpcpy(p, "*.*"); /* p := address to copy the filename to to form the fully-qualified filename */ /* There is at least one backslash within fullname, because of dfnexpand() */ while(*--p != '\\') ; ++p; /* make sure user is sure if all files are to be * deleted */ /* * Also make sure to find the LAST '.', as long filenames * are allowed to contain several */ if(!optP && *p == '*' && ((q = strrchr(p, '.')) == 0 || q[1] == '*')) { int r; p[-1] = 0; r = userprompt(PROMPT_DELETE_ALL, fullname); p[-1] = '\\'; if (r != 1) { ec = E_Other; goto errRet; } } if (dos_findfirst(fullname, &f, FA_ARCH)) { error_sfile_not_found(fullname); } else do { strcpy(p, f.ff_name); /* Make the full path */ if(optP) { switch(userprompt(PROMPT_DELETE_FILE, fullname)) { case 4: /* Quit/^Break pressed */ ec = E_CBreak; goto errRet; case 3: /* all */ optP = 0; case 1: break; /* yes, delete */ default: case 2: continue; /* no, don't delete */ } } else if(cbreak) { /* is also probed for in vcgetstr() */ ec = E_CBreak; goto errRet; } #ifdef NODEL /* define NODEL if you want to debug */ puts(fullname); #else if(verbose && !optP) displayString(TEXT_DELETE_FILE, fullname); if(unlink(fullname) != 0) { myperror(fullname); /* notify the user */ } else ++count; #endif } while (dos_findnext(&f) == 0); } while(++i < argc && *arg[i]);/* arg[i] can be NULL with LFNS?? */ } errRet: dos_findclose(&f); if(echo) dispCount(count, TEXT_MSG_DEL_CNT_FILES); freep(arg); return ec; } ================================================ FILE: cmd/depend.mk ================================================ cmd .SEQUENTIAL : utils err_fcts.h strings context lib cmd_dir cmd_dir .SETDIR=cmd : @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += cmd_clean cmd_clean .SETDIR=cmd : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += cmd_clobber cmd_clobber .SETDIR=cmd : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += cmd_dist cmd_dist .SETDIR=cmd : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: cmd/dir.c ================================================ /* $Id$ * DIR.C - dir internal command * * Comments: * * 01/29/97 (Tim Norman) * started. * * 06/13/97 (Tim Norman) * Fixed code. * * 07/12/97 (Tim Norman) * Fixed bug that caused the root directory to be unlistable * * 07/12/97 (Marc Desrochers) * Changed to use maxx, maxy instead of findxy() * * 06/08/98 (Rob Lake) * Added compatibility for /w in dir * * Compatibility for dir/s started 06/09/98 -- Rob Lake * 06/09/98 (Rob Lake) * -Tested that program finds directories off root fine * * * 06/10/98 (Rob Lake) * -do_recurse saves the cwd and also stores it in Root * -build_tree adds the cwd to the beginning of * its' entries * -Program runs fine, added print_tree -- works fine.. as EXE, * program won't work properly as COM. * * 06/11/98 (Rob Lake) * -Found problem that caused COM not to work * * 06/12/98 (Rob Lake) * -debugged... * -added free mem routine * * 06/13/98 (Rob Lake) * -debugged the free mem routine * -debugged whole thing some more * Notes: * -ReadDir stores Root name and _Read_Dir does the hard work * -PrintDir prints Root and _Print_Dir does the hard work * -KillDir kills Root _after_ _Kill_Dir does the hard work * -Integrated program into DIR.C(this file) and made some same * changes throughout * * 06/14/98 (Rob Lake) * -Cleaned up code a bit, added comments * * 06/16/98 (Rob Lake) * - Added error checking to my previously added routines * * 06/17/98 (Rob Lake) * - Rewrote recursive functions, again! Most other recursive * functions are now obsolete -- ReadDir, PrintDir, _Print_Dir, * KillDir and _Kill_Dir. do_recurse does what PrintDir did * and _Read_Dir did what it did before along with what _Print_Dir * did. Makes /s a lot faster! * - Reports 2 more files/dirs that DOS actually reports * when used in root directory(is this because dir defaults * to look for read only files?) * - Added support for /b, /a and /l * - Made error message similar to DOS error messages * - Added help screen * * 06/20/98 (Rob Lake) * - Added check for /-(switch) to turn off previously defined * switches * - Added ability to check for DIRCMD in environment and * process it * * 06/21/98 (Rob Lake) * - Fixed up /B * - Now can dir *.ext/X, no spaces! * * 06/29/98 (Rob Lake) * - error message now found in command.h * * 07/08/1998 (John P. Price) * - removed extra returns; closer to MSDOS * - fixed wide display so that an extra return is not displayed when * there is five filenames in the last line. * * 07/12/98 (Rob Lake) * - Changed error messages * * 27-Jul-1998 (John P Price ) * - added config.h include * * 09-Aug-1998 (Rob Lake ) * - fixed bug that caused blank lines to be printed * - renamed _Read_Dir to Read_Dir * * 10-Aug-1998 ska * - added checks for ^break * * 03-Dec-1998 John P Price * - Rewrote DIR command. fixed problem with "DIR .COM" and other bugs * Recursive switch does not work now, but it will be added soon. * * 31-Jan-1999 (John P. Price) * - Changed dir_print_header to use function INT21,AH=69 instead of the * function it was using. I'm not sure if this will fix anything or not. * Also fixed bug with changing and restoring the current drive. * * 1999/04/23 ska * bugfix: cmd_dir(): dircmd can be NULL * * 25-Apr-1999 (John P. Price) * - changed dir so it always shows the bytes free. * * 29-Apr-1999 (John P. Price) * - Changed so that "dir command" with no extension will do as * "dir command.*" (as it should). Also made the display of the directory * not include the whole filespec, but only the directory * * 2000/01/05 ska (Reported by Jeremy Greiner 2000/01/03) * bugfix: Last modification time displays year 2000 as 100 * --> Should be revised to allow 4-digit year * Note: This fix differs from Jeremy Greiner's by that it does * still display a 2-digit year rather than a 4-digit one. * A four-digit year would break all batch files scanning the * output of DIR. * * 2000/07/07 Ron Cemer * Added code to detect a pattern of "." or "" and convert to ".\*.*", * to prevent "file not found" errors from command.com when executed * from the root of drive C: and "DIR" is typed without any arguments, * or if you type "DIR C:" and the current directory on drive C: is \. * Also added code to convert \.\ in paths to \ (eliminate the .\ when * not needed). Hopefully this will help to bypass any findfirst/findnext * bugs which may exist in the kernel. * * 2000/07/16 Ron Cemer * Fixed "DIR .." or "DIR C:\FREEDOS\COM079\..". * Fixed "DIR /S". * No longer reallocate the "path" variable in dir_list(). This would break * "DIR /S" because dir_list() is recursive and simply tacks on additional * subdirectories to the end of the "path" variable. So the "path" variable * must NOT be moving around in memory, so I pre-allocate it to 270 characters * to allow plenty of room to tack on subdirectories while recursing. * Changed formatting to exactly match DOS's formatting as much as possible, * except that the "bytes free" count is still printed in bytes instead of * KB or MB. * * 2001/02/16 ska * chg: using STRINGS resource */ #include "../config.h" #include #include #include #include #ifndef FA_DEVICE #define FA_DEVICE 0x0040u #endif #include #include #include #include #include #include #include #include /* Not available with TURBOC++ 1.0 or earlier: */ #if defined __GNUC__ #define pause cmdpause #elif ( (!defined(__WATCOMC__) && !defined(__TURBOC__)) || (__TURBOC__ > 0x297) ) #include #endif #include "dfn.h" #define __LFNFUNCS_C #include "../include/lfnfuncs.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/nls.h" #include "../strings.h" /* useful macros */ #define MEM_ERR error_out_of_memory(); return 1; #define WIDE_COLUMNS 5 /* FINDFIRST() file mask used if no /A has been given */ #define ATTR_DEFAULT FA_RDONLY | FA_ARCH | FA_DIREC /* FINDFIRST() file mask used if /A (no args) has been given */ #define ATTR_ALL FA_RDONLY | FA_ARCH | FA_DIREC | FA_HIDDEN | FA_SYSTEM; /* Definitions for optO */ #define ORDER_BY_SIZE 2 #define ORDER_BY_DATE 4 #define ORDER_BY_NAME 8 #define ORDER_BY_EXT 0x10 #define ORDER_INVERSE 0x01 #define ORDER_DIRS_FIRST 0x20 #define ORDER_DIRS_LAST 0x40 #define ORDER_BY_MASK 0x1e #define DEFAULT_SORT_ORDER "NG" static unsigned char optOdir = 0; static char optOorderby[5]; /* Array: One byte longer than order methods, the last unused orderby[] byte is zero by design always --> eases implementation, e.g. memcpy() in scanOrder() and for() loop in orderFuntion() */ struct currDir { unsigned linecount; /* for /B */ }; static int optS, optP, optW, optB, optL, longyear, optO; #ifdef FEATURE_LONG_FILENAMES static int dispLFN; #endif #ifdef FEATURE_DESCRIPT_ION static int descriptionExists; static int fDescription; static void showDescription(const char *shortName, char *ext); #endif static struct ffblk _seg *orderArray; static unsigned attrMay, attrMask, attrMatch; /* within/right after the parsing of the options: what attributes "may" be on (but need not), which "must" be set and which "must not" be set. attrMay is just passed into FINDFIRST(), attrMask and attrMatch are aggregated so that & mask == match selects all valid files */ static char *path; static unsigned line; static int need_nl; /* FAT32: file sizes are less then unsigned long, but accumulated directory sizes may be up to 2 TB so here comes simple 'large integer' arithmetic with billions separate */ typedef struct _bignum { unsigned long low; unsigned billions; } bignum; static void bignum_add(bignum *big, bignum *to_add) { big->billions += to_add->billions; big->low += to_add->low; if (big->low >= 1000000000ul) { /* carry propagation, school style */ big->low -= 1000000000ul; big->billions++; } } #ifdef FEATURE_LONG_FILENAMES static void printLFNname(char *shortName, char *ext) { IREGS r; char pathbuffer[128]; char longname[270]; int pathlen; /* reconstruct the path+filename */ pathlen = strrchr(path,'\\') - path; sprintf(pathbuffer,"%*.*s\\%s%c%s" , pathlen , pathlen , path , shortName , *ext ? '.' : 0x0 , *ext ? ext : 0x0); dprintf(("[LFN: path %s\n",pathbuffer)); /* LFN get canonical LFN */ r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7160; r.r_cx = 0x8002; r.r_si = FP_OFF( pathbuffer ); r.r_ds = FP_SEG( pathbuffer ); r.r_di = FP_OFF( longname ); r.r_es = FP_SEG( longname ); intrpt(0x21, &r); if( r.r_flags & 1 || r.r_ax == 0x7100 || !__supportlfns ) { dprintf(("[LFN: not supported %x]\n",r.r_ax)); return; } if(samefile(longname, ".")) strcpy(longname, "\\."); if(dfnstat("..") != 0 && samefile(longname, "..")) strcpy(longname, "\\.."); printf(" %.30s ", &strrchr(longname, '\\')[1]); } #endif #ifdef FEATURE_DESCRIPT_ION static int incline(void); /* forward reference */ /* this will read in next non-blank line from fDescription, and stores next token (ie filename or description). returns 0 on any error or no more entries in file *buf will equal '\0' or successfully read in filename */ static int descGetNextToken(char *buf, int fn, int maxlen) { /* skip blank lines and any initial spaces, also exit early on any read error */ do { if (dos_read(fDescription, buf, 1) != 1) { /*printf("[read error]\n");*/ *buf = '\0'; return 0; } } while ( (*buf == ' ') || (fn && isspace(*buf)) ); /* read in characters until end of line/file (or space) is found */ do { if (maxlen > 1) /* reuse last char in buffer, but don't exceed maxlen */ { maxlen--; buf++; } if (dos_read(fDescription, buf, 1) != 1) break; } while ( (*buf!='\r') && (*buf!='\n') && (*buf!=0x4/*Ctrl-D*/) && (*buf!=26/*Ctrl-Z*/) && (!fn || (fn && !isspace(*buf))) ); /* if read in description, then skip to end of line */ /* note: because we stop at \r, next read may seem like blank line (\n) */ if (!fn) while ( (*buf!='\r') && (*buf!='\n') ) { if (dos_read(fDescription, buf, 1) != 1) break; } /* terminate filename read in */ *buf = '\0'; return 1; } /* if a DESCRIPT.ION file was found (and opened) in current directory, then sequentially (as it's unsorted) read through it and print matching descriptions if found. Basic format are lines of filename description text [Ctrl-D ...] | */ static void showDescription(const char *shortName, char *ext) { char fn[14], dummy[1], buf[128]; /* 4096 is max line size officially supported */ assert(fDescription != 0); if (*shortName == '.') return; /* ignore . and .. entries */ sprintf(fn, "%s%c%s", shortName, (*ext)?'.':0x0, ext); /* fn is 8.3 filename[.extension] */ fn[13]='\0'; lseek(fDescription, 0, SEEK_SET); /* start at beginning of unsorted description file */ while (descGetNextToken(buf,1,sizeof(buf)) && (strcmpi(fn,buf) != 0)) { descGetNextToken(dummy,0,sizeof(dummy)); /* skip rest of this line & try again */ } if (*buf) /* found line in DESCRIPT.ION file matching this file */ { descGetNextToken(buf,0,sizeof(buf)); /* loop displaying upto 34 characters of description at a time. */ #define DESCLEN 34 { char *p = buf; while (strlen(p) > DESCLEN) /* display in chunks */ { char t; /* start at end of chunk, try to split word at whitespace [or any punctuation]; don't split if word too big. i set to where '\0' will be stored. */ int i = DESCLEN+1; while ((i>(DESCLEN/2)) && !isspace(*(p+i)) /*&& !ispunct(*(p+i))*/) i--; if (i<=(DESCLEN/2)) i = DESCLEN+1; else if (i<=DESCLEN) i++; t = *(p+i); /* store character */ *(p+i) = '\0'; /* temp force end of string */ printf("\n"); incline(); /* handle dir /p */ printf("%44c%s", ' ', p); /* display the substring */ p += i; /* skip past portion shown */ *p = t; /* restore saved character */ while(isspace(*p)) p++; /* skip past whitespace splitting words at line edge */ } /* and print the final (or only) chunk of description */ printf("\n"); incline(); /* handle dir /p */ printf("%44c%s", ' ', p); /* printf("\n%44c%s", ' ', (*buf)? buf : ""); */ } } /* else printf("\n%44c%s", ' ', "NO MATCH FOUND"); */ } #endif /* The DIR command accepts more than one /A options, the later ones replaces former ones */ static int scanAttr(const char *p) { unsigned attr; attrMask = attrMatch = 0; /* purge previous /A*** */ attrMay = ATTR_ALL; if(p && *p) { for(--p;;) { switch(toupper(*++p)) { case 'R': attr = FA_RDONLY; break; case 'A': attr = FA_ARCH; break; case 'D': attr = FA_DIREC; break; case 'H': attr = FA_HIDDEN; break; case 'S': attr = FA_SYSTEM; break; /* case 'L': WinXP has this one too? */ /* case '+': */ case '-': continue; case '\0': goto done; default: /* error */ error_illformed_option(p); return E_Useage; } switch(p[-1]) { case '-': /* disable */ attrMatch &= ~attr; break; default: /* enable */ attrMatch |= attr; break; /* case '+': / * anyway * / break; */ } attrMask |= attr; /* "mustNot" is dropped later, must need to be ORed later anyway */ } done: /* no need to fetch entries with disabled attributes */ attrMay &= ~attrMask | attrMatch; } /* else no specifying arguments --> display all */ return E_None; } static int scanOrder(const char *p) { if(!p || !*p) p = DEFAULT_SORT_ORDER; restart: memset(optOorderby, 0, sizeof(optOorderby)); optOdir = 0; if(p && *p) { for(;;p++) { int inverse = p[-1] == '-'; int option; int i; switch(toupper(*p)) { case '-': continue; case 'S': option = ORDER_BY_SIZE; break; case 'D': option = ORDER_BY_DATE; break; case 'N': option = ORDER_BY_NAME; break; case 'E': option = ORDER_BY_EXT; break; case 'G': optOdir = inverse? ORDER_DIRS_LAST: ORDER_DIRS_FIRST; continue; case 'U': ++p; goto restart; case '\0': goto done; default: /* error */ error_illformed_option(p); return E_Useage; } for(i = 0; i < sizeof(optOorderby); ++i) { if(optOorderby[i] == 0) break; if((optOorderby[i] & ORDER_BY_MASK) == option) { memcpy(optOorderby+i, optOorderby+i+1 , (sizeof(optOorderby)-1-i)*sizeof(optOorderby[0])); } } optOorderby[i] = option | inverse; #ifdef DEBUG while(++i < sizeof(sizeof(optOorderby))) { assert(!optOorderby[i]); } #endif } done:; } optO = optOorderby[0] | optOdir; return E_None; } optScanFct(opt_dir) { (void)arg; switch(ch) { case 'S': return optScanBool(optS); case 'P': return optScanBool2(optP); /* multiple uses, /P /P, do not cancel, only /-P */ case 'W': return optScanBool(optW); case 'B': return optScanBool(optB); case 'O': if(!bool) return scanOrder(strarg); break; case 'A': if(!bool) return scanAttr(strarg); break; case 'L': return optScanBool(optL); case '4': case 'Y': return optScanBool(longyear); case 0: /* Longname option, e.g. /A without argument sign */ switch(*optstr) { case 'A': case 'a': /* /A*** */ if(!bool && !optHasArg()) return scanAttr(optstr + 1); break; case 'O': case 'o': /* /O*** */ if(!bool && !optHasArg()) return scanOrder(optstr + 1); break; #ifdef FEATURE_LONG_FILENAMES case 'L': case 'l': /* enable to display LFNs? */ if(optLong("LFN")) return optScanBool(dispLFN); break; #endif } } optErr(); return E_Useage; } /* * pause * * pause until a key is pressed */ static int pause(void) { cmd_pause(0); return 0; } /* * incline * * increment our line if paginating, display message at end of screen */ static int incline(void) { if (!optP) return E_None; if (++line >= MAX_Y) { line = 0; return pause(); } return 0; } static int flush_nl(void) { if(need_nl) { outc('\n'); return incline(); } return E_None; } /* * dir_print_header * * print the header for the dir command */ static int dir_print_header(int drive) { # include "algnbyte.h" struct media_id { int info_level; int serial1; int serial2; char vol_id[11]; char file_sys[8]; } media; # include "algndflt.h" struct ffblk f; IREGS r; int currDisk; int rv; if (cbreak) return E_CBreak; if (optB) return 0; currDisk = getdisk(); if(changeDrive(drive+1) != 0) { setdisk(currDisk); return 1; } /* get the media ID of the drive */ /* Format of disk info: Offset Size Description (Table 01766) 00h WORD 0000h (info level) 02h DWORD disk serial number (binary) 06h 11 BYTEs volume label or "NO NAME " if none present 11h 8 BYTEs (AL=00h only) filesystem type (see #01767) */ r.r_ax = 0x6900; r.r_bx = drive + 1; r.r_ds = FP_SEG(&media); r.r_dx = FP_OFF(&media); intrpt( 0x21, &r ); /* print drive info */ displayString(TEXT_DIR_HDR_VOLUME, drive + 'A'); if (sfnfindfirst("\\*.*", &f, FA_LABEL) == 0) { /* Added to remove "." from labels which are longer than 8 characters (as DOS does), but must pad name with spaces. */ char *dotptr = strchr(f.ff_name, '.'); if (dotptr != 0) { char *mptr = f.ff_name+8; /* shift extension either back over dot or to end of space padding */ memmove(mptr, dotptr+1, 4); /* 4=max 3 char ext + \0 */ /* add spaces for padding / overwrite with spaces shifted extension */ while (dotptr < mptr) *dotptr++ = ' '; /* pad with space and increment */ } displayString(TEXT_DIR_HDR_VOLUME_STRING, f.ff_name); } else { displayString(TEXT_DIR_HDR_VOLUME_NONE); } setdisk(currDisk); if ((rv = incline()) == 0) { /* print the volume serial number if the return was successful */ if (!( r.r_flags & 1 )) { displayString(TEXT_DIR_HDR_SERIAL_NUMBER , media.serial2, media.serial1); rv = incline(); } } /* Added to exactly match DOS's formatting. */ if ( (optS) && (rv == 0) ) { outc('\n'); rv = incline(); } return rv; } #ifdef INCLUDE_CMD_DIR /* * print_summary: prints dir summary */ static int print_summary(unsigned long files , bignum *bytes) { char buffer[32]; if (optB) return 0; convert(files, 0, buffer); displayString(TEXT_DIR_FTR_FILES, buffer); convert(bytes->low, bytes->billions, buffer); displayString(TEXT_DIR_FTR_BYTES, buffer); need_nl = 1; return incline(); } static int print_total (unsigned long files, bignum *bytes) { int rv; if(optB) return 0; rv = flush_nl(); if(rv == E_None) { displayString(TEXT_DIR_FTR_TOTAL_NUMBER); if((rv = incline()) == E_None) return print_summary(files, bytes); } return rv; } static int dir_print_free(unsigned long dirs) { char buffer[32]; IREGS r; struct { unsigned short whatever; unsigned short version; unsigned long sectors_per_cluster; unsigned long bytes_per_sector; unsigned long free_clusters; unsigned long total_clusters; unsigned long available_physical_sectors; unsigned long total_physical_sectors; unsigned long free_allocation_units; unsigned long total_allocation_units; unsigned char reserved[8]; } FAT32_Free_Space; static char rootname[] = "C:\\"; unsigned long clustersize; if(optB) return 0; /* print number of dirs and bytes free */ convert(dirs, 0, buffer); displayString(TEXT_DIR_FTR_DIRS, buffer); rootname[0] = toupper(*path); r.r_flags = 1; /* CY before 21.73 calls! */ r.r_ax = 0x7303; r.r_ds = FP_SEG(rootname); r.r_dx = FP_OFF(rootname); r.r_es = FP_SEG(&FAT32_Free_Space); r.r_di = FP_OFF(&FAT32_Free_Space); r.r_cx = sizeof(FAT32_Free_Space); intrpt( 0x21, &r); /* Note: RBIL carry clear and al==0 also means unimplemented alternately carry set and ax==undefined (usually unchanged) for unimplemented ecm: RBIL is wrong, CF unchanged al=0 is the typical error return. EDR-DOS returns NC ax=0 so checking for al!=0 here was wrong. */ if(!( r.r_flags & 1 ) && ( r.r_ax != 0x7300 ) ) { dprintf(("[DIR: Using FAT32 info]\n")); clustersize = FAT32_Free_Space.sectors_per_cluster * FAT32_Free_Space.bytes_per_sector; /* The following loop is intended to handle large free space amounts and huge [fake] cluster sizes, such as NTFS4DOS driver on large HDs. */ if (clustersize) if (FAT32_Free_Space.free_clusters >= 0x80000000ul / clustersize) { int shift; for (shift = 21; --shift;) { if ((clustersize & 1) == 0) clustersize >>= 1; else FAT32_Free_Space.free_clusters >>= 1; } convert(FAT32_Free_Space.free_clusters * clustersize, 0, buffer); strcat(buffer, " Mega"); goto output; } } r.r_ax = 0x3600; r.r_dx = toupper(*path) - 'A' + 1; intrpt(0x21, &r); convert((unsigned long)r.r_ax * r.r_bx * r.r_cx, 0, buffer); output: displayString(TEXT_DIR_FTR_BYTES_FREE, buffer); return incline(); } static int DisplaySingleDirEntry(struct ffblk *file, struct currDir *cDir) { int rv = E_None; if (cbreak) return E_CBreak; if (optL) strlwr(file->ff_name); if (optW) { char buffer[sizeof(file->ff_name) + 3]; if (file->ff_attrib & FA_DIREC) { sprintf(buffer, "[%s]", file->ff_name); } else { strcpy(buffer, file->ff_name); } displayString(TEXT_DIR_LINE_FILENAME_WIDE, buffer); if (++cDir->linecount == WIDE_COLUMNS) { /* outputted 5 columns */ outc('\n'); rv = incline(); cDir->linecount = 0; } } else if (optB) { if (strcmp(file->ff_name, ".") == 0 || strcmp(file->ff_name, "..") == 0) return E_None; if (optS) outs(path); displayString(TEXT_DIR_LINE_FILENAME_BARE, file->ff_name); rv = incline(); } else { char buffer[sizeof(long) * 4 + 2], *ext = ""; if (file->ff_name[0] == '.') displayString(TEXT_DIR_LINE_FILENAME_SINGLE, file->ff_name); else { ext = strrchr(file->ff_name, '.'); if (!ext) ext = ""; else *ext++ = '\0'; displayString(TEXT_DIR_LINE_FILENAME, file->ff_name, ext); } if (file->ff_attrib & FA_DIREC) { displayString(TEXT_DIR_LINE_SIZE_DIR); } else { convert(file->ff_fsize, 0, buffer); displayString(TEXT_DIR_LINE_SIZE, buffer); } { char *p; int year, month, day; int hour, minute; year = (file->ff_fdate >> 9) + 80; if(longyear) year += 1900; else year %= 100; day = file->ff_fdate & 0x001f; month = (file->ff_fdate >> 5) & 0x000f; hour = file->ff_ftime >> 5 >> 6; minute = (file->ff_ftime >> 5) & 0x003f; p = nls_makedate(0, year, month, day); if(!p) { error_out_of_memory(); return E_NoMem; } outc(' '); outs(p); free(p); p = nls_maketime(NLS_MAKE_SHORT_AMPM, hour, minute, -1, 0); if(!p) { error_out_of_memory(); return E_NoMem; } outc(' '); outs(p); free(p); #ifdef FEATURE_LONG_FILENAMES if( dispLFN ) printLFNname(file->ff_name, ext); #endif #ifdef FEATURE_DESCRIPT_ION if (descriptionExists) showDescription(file->ff_name, ext); #endif outc('\n'); } rv = incline(); } return cbreak? E_CBreak: rv; } /* return -1,0,1 where -1 if p1 is before p2, 0 if same, 1 if p2 is before p1 */ static int orderFunction(const void *p1, const void *p2) { int i1 = *(int*)p1; int i2 = *(int*)p2; int rv = 0; int i; struct ffblk f1, f2; _fmemcpy(&f1, orderArray + i1 , sizeof(f1)); _fmemcpy(&f2, orderArray + i2 , sizeof(f2)); if(optOdir && (f1.ff_attrib & FA_DIREC) != (f2.ff_attrib & FA_DIREC)) return (optOdir & ORDER_DIRS_FIRST ? f1.ff_attrib: f2.ff_attrib) & FA_DIREC ? -1 : 1; for (i = 0; rv == 0; i++) { int opt = optOorderby[i]; assert(i < sizeof(optOorderby)); switch(opt & ORDER_BY_MASK) { case 0: return rv; /* is 0 actually */ case ORDER_BY_SIZE: if(f1.ff_fsize > f2.ff_fsize) rv = 1; else if(f1.ff_fsize < f2.ff_fsize) rv = -1; break; case ORDER_BY_DATE: rv = f1.ff_fdate - f2.ff_fdate; if(!rv) rv = f1.ff_ftime - f2.ff_ftime; break; case ORDER_BY_EXT: { char *x1 = strchr(f1.ff_name, '.'); char *x2 = strchr(f2.ff_name, '.'); if(!x1 && !x2) /* both are equal */ continue; if (x1 && x2) rv = strcmp(x1, x2); else if (!x1 && x2) rv = -1; else rv = 1; /* x1 && !x2 */ } break; case ORDER_BY_NAME: rv = strcmp(f1.ff_name,f2.ff_name); break; } if (opt & ORDER_INVERSE) rv = - rv; } /* if criteria (size, date, etc) compare equal then return results lexically by filename */ if (rv == 0) rv = strcmp(f1.ff_name,f2.ff_name); return rv; } static int flushOrder(struct ffblk _seg *orderArray, int *orderIndex, int orderCount, struct currDir *cDir) { int i; struct ffblk file; for (i = 0; i < orderCount; i++) orderIndex[i] = i; qsort(orderIndex, orderCount, sizeof(orderIndex[0]), orderFunction); for (i = 0; i < orderCount; i++) { int rv; _fmemcpy(&file, &orderArray[orderIndex[i]], sizeof(file)); if((rv = DisplaySingleDirEntry(&file, cDir)) != E_None) return rv; } return E_None; } /* * dir_list * * list the files in the directory */ static int dir_list(int pathlen , char *pattern , unsigned long *dcnt , unsigned long *fcnt , bignum *bcnt ) { struct ffblk file; bignum bytecount = {0}; unsigned long filecount = 0; unsigned long dircount = 0; int rv = E_None; struct currDir cDir = {0}; #define MAX_ORDER (0xffff / sizeof(struct ffblk)) int *orderIndex = NULL; int orderCount; assert(path); assert(pattern); assert(pathlen >= 2); /* at least root */ if(optO) { orderIndex = malloc(MAX_ORDER * sizeof(unsigned)); if(!orderIndex) { error_out_of_memory(); optO = 0; } else { #ifdef FARDATA /* use last-fit allocation to work well with large model */ orderArray = MK_SEG_PTR(void, DOSalloc(0x1000,2)); #else orderArray = MK_SEG_PTR(void, DOSalloc(0x1000,0)); #endif if(!orderArray) { free(orderIndex); error_out_of_dos_memory(); optO = 0; } orderCount = 0; } } /* Search for matching entries */ path[pathlen - 1] = '\\'; #ifdef FEATURE_DESCRIPT_ION strcpy(&path[pathlen], "DESCRIPT.ION"); descriptionExists = ((fDescription = dos_open(path, O_RDONLY)) >= 0); #endif strcpy(&path[pathlen], pattern); if (sfnfindfirst(path, &file, attrMay) == 0) { int printDirectoryEntry = !optB; /* For counting columns of output */ cDir.linecount = 0; /* if optB && optS the path with trailing backslash is needed, also for optS below do {} while */ strcpy(&path[pathlen - 1], "\\"); if(rv == E_None) do if((file.ff_attrib & attrMask) == attrMatch) { assert(strlen(file.ff_name) < 13); /* moved down here because if we are recursively searching and * don't find any files, we don't want just to print * Directory of C:\SOMEDIR * with nothing else * 2003-02-03 moved down even further to handle attribute selection. */ if(printDirectoryEntry) { printDirectoryEntry = 0; rv = flush_nl(); if(rv == E_None) { /* path without superflous '\' at its end */ if(pathlen == 3) /* root directory */ path[pathlen] = '\0'; /* path := path w/o filename */ else path[pathlen - 1] = '\0'; displayString(optS ? TEXT_DIR_DIRECTORY: TEXT_DIR_DIRECTORY_WITH_SPACE , path); path[pathlen - 1] = '\\'; /* need this below */ if((rv = incline()) == E_None) { outc('\n'); rv = incline(); } } } if (cbreak) rv = E_CBreak; else if (rv == E_None && file.ff_attrib != FA_DEVICE) { if(file.ff_attrib & FA_DIREC) { dircount++; } else { bignum tmp; filecount++; tmp.low = (unsigned long)file.ff_fsize % 1000000000ul; tmp.billions = (unsigned long)file.ff_fsize / 1000000000ul; bignum_add(&bytecount, &tmp); } if(optO) { _fmemcpy(&orderArray[orderCount], &file, sizeof(file)); orderCount++; if(orderCount >= MAX_ORDER) { rv = flushOrder(orderArray,orderIndex,orderCount,&cDir); orderCount = 0; } } else rv = DisplaySingleDirEntry(&file, &cDir); } } while (rv == E_None && sfnfindnext(&file) == 0); } #ifdef FEATURE_DESCRIPT_ION if (descriptionExists) dos_close(fDescription); #endif if(optO) { if(rv == E_None) rv = flushOrder(orderArray,orderIndex,orderCount,&cDir); free(orderIndex); DOSfree(FP_SEG(orderArray)); } if (rv == E_None && optW && (cDir.linecount != 0)) { outc('\n'); rv = incline(); } if(rv == E_None) { if(filecount || dircount) rv = print_summary(filecount, &bytecount); else if(!optS) { error_file_not_found(); rv = E_Other; } } if(rv == E_None /* no error */ && optS) { /* do recursively */ /* already set for optB && optS before do {} while above path[pathlen - 1] = '\\'; */ strcpy(&path[pathlen], "*.*"); /* Import attributes S & H from "maybe" */ if (sfnfindfirst(path, &file, attrMay | FA_DIREC) == 0) do { if((file.ff_attrib & FA_DIREC) != 0 /* is directory */ && strcmp(file.ff_name, ".") != 0 /* not cur dir */ && strcmp(file.ff_name, "..") != 0) { /* not parent dir */ if (optL) strlwr(file.ff_name); strcpy(&path[pathlen], file.ff_name); rv = dir_list(pathlen + strlen(file.ff_name) + 1, pattern , &dircount, &filecount, &bytecount ); } } while (rv == E_None && sfnfindnext(&file) == 0); } *dcnt += dircount; *fcnt += filecount; bignum_add(bcnt, &bytecount); return rv; } static int dir_print_body(char *arg, unsigned long *dircount) { int rv; unsigned long filecount; bignum bytecount = {0}; char *pattern, *cachedPattern; char *p; #if 0 char altarg[ MAXPATH ]; if( ( p = strrchr( arg, '\\' ) ) == NULL && arg[ 1 ] ) { if( *arg = '.' ) { sprintf( altarg, "*%s", arg ); } else if( strchr( arg, '.' ) == NULL ) { sprintf( altarg, "%s.*", arg ); } } else if( p[ 1 ] ) { if( *arg = '.' ) { } } #endif /* Modified to pre-allocate path to 270 bytes so that we don't have to realloc() it later. That was causing "DIR /S" not to work properly. The path variable cannot be reallocated once dir_list() is called, because dir_list() is recursive. This will also help to reduce memory fragmentation. */ if((p = abspath(arg, 1)) == 0) { return E_NoMem; } if((path = realloc(p, 270*sizeof(char))) == 0) { free(p); error_out_of_memory(); return E_NoMem; } filecount = 0; /* print the header */ if((rv = dir_print_header(toupper(path[0]) - 'A')) == 0) { /* There are some directory specs that are not detected by dfnstat() as they are no part of the filesystem in DOS */ pattern = dfnfilename(path); assert(p); if(!*pattern || (dfnstat(path) & DFN_DIRECTORY) != 0) { pattern = strchr(pattern, '\0'); if(pattern[-1] != '\\') ++pattern; rv = dir_list(pattern - path, "*.*", dircount, &filecount , &bytecount ); } else { if((cachedPattern = strdup(pattern)) == 0) { error_out_of_memory(); rv = E_NoMem; } else { rv = dir_list(pattern - path, cachedPattern, dircount , &filecount, &bytecount ); free(cachedPattern); } } } if(optS) { if(filecount) rv = print_total(filecount, &bytecount); else { error_file_not_found(); rv = E_Other; } } if(!rv) rv = dir_print_free(*dircount); free(path); return rv; } /* * dir * * internal dir command */ int cmd_dir (char * rest) { char **argv; char *p; int argc, opts; int rv; /* return value */ unsigned long dircount; int appState; /* DOS/APPEND state */ /* initialize options */ attrMask = attrMatch = optO = longyear = optS = optP = optW = optB = optL = 0; #ifdef FEATURE_LONG_FILENAMES dispLFN = 0; #endif attrMay = ATTR_DEFAULT; /* read the parameters from env */ if ((argv = scanCmdline(p = getEnv("DIRCMD"), opt_dir, 0, &argc, &opts)) == 0) { free(p); return 1; } free(p); freep(argv); /* ignore any parameter from env var */ line = 0; /* read the parameters */ if ((argv = scanCmdline(rest, opt_dir, 0, &argc, &opts)) == 0) return 1; /* critEnableRepeatCheck(); */ appState = appendDisable(); dircount = 0; if(argc) for(opts = 0 ; opts < argc && (rv = dir_print_body(argv[opts], &dircount)) == 0 ; ++opts) ; else rv = dir_print_body(".", &dircount); /* critEndRepCheck(); */ appendRestore(appState); freep(argv); return rv; } #endif #ifdef INCLUDE_CMD_VOL /* * vol * * internal vol command */ int cmd_vol (char * rest) { int drive; assert(rest); /* save the current directory info */ line = 0; optB = 0; if (rest && *rest) { /* trim whitespace after drive indicator, else extra spaces cause syntax error */ rtrimcl(rest); if ((strlen(rest) != 2) || (rest[1] != ':')) { error_syntax(rest); return E_Useage; } drive = toupper(rest[0]) - 'A'; } else drive = getdisk(); return dir_print_header(drive); } #endif ================================================ FILE: cmd/dirs.c ================================================ /* $Id$ * DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS * * Outputs directory stack contents */ #include "../config.h" #include "../include/context.h" #include "../include/command.h" #include "../strings.h" int cmd_dirs (char * param) { (void)param; return ctxtView (CTXT_TAG_DIRSTACK, TEXT_DIRSTACK_EMPTY); } ================================================ FILE: cmd/doskey.c ================================================ /* $Id$ * DOSKEY -- command line editor extender <-> incorporated, but * not loadable */ #include "../config.h" #include "../include/command.h" #include "../strings.h" int cmd_doskey (char * param) { (void)param; displayString (TEXT_MSG_DOSKEY); return 0; } ================================================ FILE: cmd/echo.c ================================================ /* $Id$ * ECHO.C - echo command. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 1999/04/27 ska * add: "ECHO." displays empty line */ #include "../config.h" #include #include #include #include #include #include "../include/batch.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../strings.h" int cmd_echo(char *param) { int nostatus; dprintf( ("[ECHO: %s]\n", param) ); if(param && *param) { nostatus = !isspace(*param); /* Unlike other internal commands, puncation characters are not removed by ECHO */ ++param; } else nostatus = 0; switch(onoffStr(param)) { case OO_Null: case OO_Empty: default: if(nostatus) outc('\n'); else displayString(TEXT_MSG_ECHO_STATE, echo ? D_ON : D_OFF); break; case OO_Off: echo = 0; break; case OO_On: echo = 1; break; case OO_Other: puts(param); } return 0; } ================================================ FILE: cmd/exit.c ================================================ /* $Id$ * EXIT -- exits current instance of FreeCOM or leave all batch files * * set the exitflag to true */ #include "../config.h" #include "../include/command.h" int internal_exit (char * rest) { (void)rest; exitflag = 1; return 0; } ================================================ FILE: cmd/exit2.c ================================================ /* $Id$ * EXIT -- exits current instance of FreeCOM or leave all batch files * * set the exitflag to true * and _force_ exit */ #include "../config.h" #include "../include/command.h" int force_exit (char * rest) { (void)rest; canexit = exitflag = 1; return 0; } ================================================ FILE: cmd/fddebug.c ================================================ /* $Id$ * FDDEBUG.C - verify command. * * Comments: Turn on/off the debug flag * * 30-Mar-2000 (John P Price ) * started. * * 2001/02/16 ska * add: redirect output into file */ #include "../config.h" #include #include #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../strings.h" #ifdef DEBUG extern FILE *dbg_logfile; extern char *dbg_logname; int cmd_fddebug(char *param) { switch(onoffStr(param)) { default: { FILE *f; char *p; if((p = strdup(trimcl(param))) == 0) { error_out_of_memory(); return 1; } if(stricmp(param, "stderr") == 0) f = stderr; else if(stricmp(param, "stdout") == 0) f = stdout; else if((f = fopen(param, "at")) == 0) { error_open_file(param); return 2; } if(dbg_logfile != stderr && dbg_logfile != stdout) fclose(dbg_logfile); dbg_logfile = f; free(dbg_logname); dbg_logname = p; /* FALL THROUGH */ } case OO_On: fddebug = 1; break; case OO_Null: case OO_Empty: displayString(TEXT_MSG_FDDEBUG_STATE, fddebug ? D_ON : D_OFF); displayString(TEXT_MSG_FDDEBUG_TARGET , dbg_logname? dbg_logname: "stdout"); break; case OO_Off: fddebug = 0; break; } return 0; } #endif ================================================ FILE: cmd/for.c ================================================ /* $Id$ * FOR.C - for command. * * Synopsises: * a) FOR { '%' } v IN (...) DO ... * b) FOR [{ '%' }] name [ '%' ] IN (...) DO ... * v ::= a single alphabetic character * name ::= a name; at least two characters that may be used in * filenames as well; name != "IN" */ #include "../config.h" #include #include #include #include #include #include "../include/batch.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../err_fcts.h" #include "../strings.h" /* If set --> toupper(varE[-1]) */ #define FLAG_HACKERY_FOR 1 typedef enum { OK, badVar, noIN, noParens, noDO, noCMD } forErrors; static forErrors checkFOR(char * param /* in: command line */ , char ** varS, char ** varE /* out: start/end variable name */ , char ** paramS, char ** paramE /* out: start/end paramter list */ , char ** cmd, int *flags) /* out */ { assert(param); assert(varS); assert(varE); assert(paramS); assert(paramE); assert(cmd); assert(flags); *flags = 0; /* skip past and process any option flags /D filespec is for directories instead of files /F ??? - not currently supported, parse file instead of perform findfirst/next /R [basepath] - not currently supported, repeat for each subdir of basepath */ if (*param == '/' || *param == '-') { param++; switch(toupper(*param++)) { case 'D': *flags |= FLAG_OPT_DIRECTORY; break; #if 0 case 'F': *flags |= FLAG_OPT_FILEPARSE; break; case 'R': *flags |= FLAG_OPT_RECURSE; break; #endif default: return badVar; } param = ltrimcl(param + 1); /* skip whitespaces */ } /* Check that it starts with a % then an alpha char followed by space */ *varS = param; if(*param == '%') { /* Check for FOR %%%%v IN syntax */ while(*++param == '%'); if(isalpha(*param) && isargdelim(param[1])) { /* hackery FOR variable */ *flags |= FLAG_HACKERY_FOR; *varE = ++param; goto varfound; } } #if 0 /* the standard release does not support normal variables as FOR variables */ return badVar; #else /* Use a normal variable; strip leading %'s */ *varE = param = skipfnam(*varS = param); if(*param == '%') /* ignore _one_ trailing percent sign */ ++param; if(!*param || !isargdelim(*param) || *varE - *varS < 2 /* || (*varE - *varS == 2 && memicmp(*varS, "IN", 2) == 0) */ ) { return badVar; } #endif varfound: param = ltrimcl(param + 1); /* skip whitespaces */ /* Check next element is 'IN' */ if(!matchtok(param, "in")) { return noIN; } /* Followed by a '(', find also matching ')' */ if(*param != '(') return noParens; *paramS = param + 1; { /* Search for right ) */ int inQuote = 0; while(*++param) if(is_quote(*param)) { if(inQuote) inQuote = 0; else inQuote = *param; } else if(*param == ')' && !inQuote && isargdelim(param[1]) /* COMMAND bug: sees right parens only if followed by whitespace */ ) goto rightParansFound; return noParens; } rightParansFound: *paramE = param; param = ltrimcl(param + 1); /* Check if DO follows */ if(!matchtok(param, "do")) return noDO; /* Check that command tail is not empty */ if(!*param) return noCMD; *cmd = param; return OK; } static int doFOR (char * varname, char * varE, char * param, char * paramE, char *cmd, int flags) { #if 0 char *oldContents; char **argv; /* pattern list */ int argc; int rv; #endif assert(varname); assert(varE); assert(param); assert(paramE); assert(cmd); *varE = 0; *paramE = 0; /* OK all is correct, build the exec contexts */ #if 1 assert(*varname == '%'); { char parsedParam[MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8]; if(!expandEnvVars(param, parsedParam)) { error_line_too_long(); return 1; } if(!newBatchContext()) return 1; if((bc->forproto = strdup(cmd)) == 0 || (bc->forvar = strdup(varname)) == 0) { error_out_of_memory(); exit_batch(); /* remove the newly created batch context */ return 1; } if(!setBatchParams(parsedParam)) { /* Split out list */ exit_batch(); return 1; } bc->shiftlevel = 1; /* skip %0 <=> filename */ bc->forFlags = flags; } return 0; #else rv = E_None; /* 1st: C/FORVAR|SET hidden context */ if(*varname == '%') { /* special FOR variable */ switch(ctxtGetS(1, CTXT_TAG_IVAR, varname, &oldContents)) { #ifdef DEBUG default: dprintf(("[FOR: Invalid return value from ctxtGetS]\n")); rv = E_None; break; case 1: /* no such item */ #else default: #endif rv = ecMkc("IVAR %@VERBATIM()", varname, (char*)0); break; case 0: /* Got it */ rv = ecMkc("IVAR %@VERBATIM()", varname, "=" , oldContents, (char*)0); myfree(oldContents); break; case 2: /* Out of memory */ error_out_of_memory(); return 1; } } else { /* normal variable */ oldContents = getEnv(varname); /* getEnv() will also update the varname array with the current case of the particular characters */ rv = ecMkc("SET /C %@VERBATIM()", varname, "=", oldContents, (char*)0); free(oldContents); } if(rv == E_None) { if((argv = split(param, &argc)) == 0) { error_out_of_memory(); return E_NoMem; } /* Make the F context */ if(argc) rv = ecMkF(argv, argc, varname, cmd); /* else silently ignore an empty argument line */ freep(argv); } return rv; #endif } int cmd_for(char *param) { /* * First check syntax is correct : FOR %v IN ( ) DO * v must be alphabetic, must not be empty. * * If all is correct build a new F exec context. * If also preserves the old contents of the FOR variable * * varname := name of FOR variable * param := parameters within '(...)' * cmd := command */ char *varname, *varE, *cmd, *paramE; int flags; switch(checkFOR(param, &varname, &varE, ¶m, ¶mE, &cmd, &flags)) { case badVar: error_for_bad_var(); return 1; case noIN: error_for_in(); return 1; case noParens: error_for_parens(); return 1; case noDO: error_for_do(); return 1; case noCMD: error_for_no_command(); return 1; case OK: break; default: #ifdef DEBUG dprintf(("[FOR: Invalid return value from checkFOR()]\n")); #endif return 1; } return doFOR(varname, varE, param, paramE, cmd, flags); } int cmd_for_hackery(char *Xparam) { char *param; char *varname, *varE, *cmd, *paramE; int flags; if(!matchtok(Xparam, "for") || checkFOR(Xparam, &varname, &varE, ¶m, ¶mE, &cmd, &flags) != OK) return 0; /* Ignore the return value as this is a FOR cmd now, but if it fails here, some other error caused it */ doFOR(varname, varE, param, paramE, cmd, flags); return 1; } ================================================ FILE: cmd/goto.c ================================================ /* $Id$ * GOTO.C - goto command. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 28 Jul 1998 (Hans B Pufal) [HBP_003] * Terminate label on first space character, use only first 8 chars of * label string * * 10-Aug-1998 ska * - moved code into readbatchline() that automatically supports * modifyable scripts & ^Break checks * * 1999/11/02 ska * bugfix: some DOS shells except a colon before the label * * 2000/07/05 Ron Cemer * bugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol */ #include "../config.h" #include #include #include #include #include #include "../include/batch.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../strings.h" int cmd_goto(char *param) { /* * Perform GOTO command. * * Only valid if batch file current. */ char *tmp; while(bc && bc->forvar) /* is FOR context */ exit_batch(); /* remove it */ if(bc == 0) { /*!! not in batch error */ return 1; } assert(param); if(*param == ':') /* some old DOS shell excepts a colon */ param = skipdm(param + 1); if(*param == '\0') { error_goto_label(); exit_batch(); return 1; } tmp = skip_word(param); *tmp = '\0'; tmp = strdup(param); if(!tmp) { error_out_of_memory(); return 1; } /* Restart the batch file from the beginning */ bc->brewind = 1; bc->blabel = tmp; return 0; } ================================================ FILE: cmd/history.c ================================================ /* $Id$ command line history This file bases on HISTORY.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:09:06 skaus chg: New structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/command.h" #include "../include/context.h" #include "../strings.h" #include "../err_fcts.h" int cmd_history(char *param) { if(param && *param) { unsigned long x; x = atol(param); if(x < 256 || x > 32768U) { error_history_size(param); return 1; } puts("HISTORY: To change to size of the history is not implemented, yet"); return 0; } return ctxtView(CTXT_TAG_HISTORY, TEXT_HISTORY_EMPTY); } ================================================ FILE: cmd/if.c ================================================ /* $Id$ * IF.C - if command. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 1999/11/04 ska * + bugfix: if: case-insensitive compare in "==" format * + bugfix: if: added support for quoted operands of "==" format * + add: if: detailed error messages * + bugfix: if: keyword "EXIST" misspelled * * 2000/07/05 Ron Cemer * bugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol */ #include "../config.h" #include #include #include #include #include #include #include #include "../include/lfnfuncs.h" #include "../include/batch.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #ifdef XMS_SWAP #include "../include/cswap.h" #endif int cmd_if(char *param) { #define X_EXEC 1 char *pp; int x_flag = 0; /* when set cause 'then' clause to be exec'ed */ int negate = 0; /* NOT keyword present */ int ignore_case = 0; /* /I option, case insensitive compare */ /* First check if param exists */ assert(param); /* check for options, note non-options must be treated as part of comparision */ /* also check if param string begins with word 'not' */ /* users will expect /I NOT and NOT /I to both work */ if (matchtok(param, "NOT")) negate = X_EXEC; /* Remember 'NOT' */ if (matchtok(param, "/I")) ignore_case++; if (matchtok(param, "NOT")) negate = X_EXEC; /* Remember 'NOT' */ /* Check for 'exist' form */ if(matchtok(param, "exist")) { struct dos_ffblk f; isr olderrhandler; if(!*param) { /* syntax error */ error_if_exist(); return 0; } pp = skip_word(param); *pp = '\0'; pp++; /* don't show abort/retry/fail if no disk in drive */ get_isr(0x24, olderrhandler); #ifdef XMS_SWAP set_isrfct(0x24, autofail_err_handler); /* always fails */ #else set_isrfct(0x24, dummy_criter_handler); /* always fails */ #endif if(dos_findfirst(param, &f, FA_NORMAL|FA_ARCH|FA_SYSTEM|FA_RDONLY|FA_HIDDEN) == 0) x_flag = X_EXEC; dos_findclose(&f); /* restore critical error handler */ set_isrfct(0x24, olderrhandler); } /* Check for 'errorlevel' form */ else if(matchtok(param, "errorlevel")) { int n = 0; #if 0 if(!isdigit(*param)) { error_if_errorlevel(); return 0; } pp = param; do n = n * 10 + (*pp - '0'); while (isdigit(*++pp)); if(*pp && !isargdelim(*pp)) { error_if_errorlevel_number(); return 0; } #else /* Add this COMMAND bug as someone tries to use: IF ERRORLEVEL H -or- IF ERRORLEVEL x to match the errorlevel against drive letters. NOT supported by 4dos or WinNT. HA --> maps to errorlevel 1 xa --> same HB & xb --> to 2 a.s.o. */ if(!*param) { error_if_errorlevel(); return 0; } pp = param; do n = n * 10 + (*pp - '0'); while(*++pp && !isargdelim(*pp)); n &= 255; dprintf( ("IF: checking for ERRORLEVEL >= %u\n", n) ); #endif if(errorlevel >= n) x_flag = X_EXEC; } /* Check that '==' is present, syntax error if not */ else { size_t len_l, len_r; char *r; /* right operand */ pp = skipqword(param, "=="); /* skip past any garbage characters before the == */ while (*pp && (*pp != '=') && !isargdelim(*pp)) pp++; if(*pp != '=' || pp[1] != '=') { error_syntax(0); return 0; } *pp = '\0'; /* param[] points to the left operand */ /* skip over the '==' and subsquent spaces */ r = ltrimcl(pp + 2); /* and assign the end of the right operator to pp */ pp = skipqword(r, 0); /* now: param := beginning of the left operand r := beginning of the right operand pp := end of right operand */ rtrimcl(param); /* ensure that spurious whitespaces are ignored */ len_l = strlen(param); len_r = strlen(r); dprintf(("left side=[%s] %i\n", param, len_l)); dprintf(("rigt side=[%s] %i\n", r, len_r)); /* check if strings differ */ if ( (len_l == len_r) && ((ignore_case && strnicmp(param, r, len_l) == 0) || (memcmp(param, r, len_l) == 0)) ) x_flag = X_EXEC; } if(x_flag ^ negate) { /* perform the command */ if(!*(pp = ltrimcl(pp))) error_if_command(); else parsecommandline(pp, FALSE); } return 0; } ================================================ FILE: cmd/lfnfor.c ================================================ /* $Id$ * LFNFOR.C - lfnfor command (MS-DOS 7.0). * * Comments: * * 22-June-2006 (Blair Campbell) * started. * */ #include "../config.h" #include #include "../err_fcts.h" #include "../include/command.h" #include "../include/misc.h" #include "../strings.h" unsigned char lfnfor = 0; unsigned char lfncomplete = 0; int cmd_lfnfor(char *param) { if(strnicmp(param, "COMPLETE", 8) == 0) { switch(onoffStr(¶m[8])) { default: error_on_off(); return 1; case OO_Null: case OO_Empty: displayString(TEXT_MSG_LFNFOR_COMPLETE_STATE, lfncomplete ? D_ON : D_OFF ); break; case OO_Off: lfncomplete = 0; break; case OO_On: lfncomplete = 1; break; } } else switch(onoffStr(param)) { default: error_on_off(); return 1; case OO_Null: case OO_Empty: displayString(TEXT_MSG_LFNFOR_STATE, lfnfor ? D_ON : D_OFF); break; case OO_Off: lfnfor = 0; break; case OO_On: lfnfor = 1; break; } return 0; } ================================================ FILE: cmd/makefile ================================================ # $Id$ # # Makefile for the FreeCOM library # # $Log$ # Revision 1.5 2002/11/12 21:56:14 skaus # v0.83 Beta 52: # # Revision 1.4 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.3 2001/12/03 20:15:54 skaus # v0.83 Beta 32: # bugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure. # add: if DEBUG enabled: internal command EXIT!! that ignores /P # chg: FEATURE_BOOT_KEYS: mandory boot keys (F5/F8) turned into # optional compile-time option; disabled by default now as the # kernel provides F5/F8 checking # chg: some document updates # # Revision 1.2 2001/06/10 17:17:23 skaus # bugfix: Single point of configuration CONFIG.MAK/.H # # Revision 1.1 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # # .INCLUDE : ../_config.mk # Sources of this make target SRC = alias.c beep.c break.c call.c cdd.c chcp.c chdir.c cls.c copy.c \ ctty.c date.c del.c dir.c dirs.c doskey.c echo.c exit.c exit2.c \ fddebug.c for.c goto.c history.c if.c memory.c mkdir.c path.c pause.c \ popd.c prompt.c pushd.c rem.c ren.c rmdir.c set.c shift.c time.c \ truename.c type.c verify.c which.c OBJ = alias.obj beep.obj break.obj call.obj cdd.obj chcp.obj chdir.obj \ cls.obj copy.obj ctty.obj date.obj del.obj dir.obj dirs.obj doskey.obj \ echo.obj exit.obj exit2.obj fddebug.obj for.obj goto.obj history.obj \ if.obj memory.obj mkdir.obj path.obj pause.obj popd.obj prompt.obj \ pushd.obj rem.obj ren.obj rmdir.obj set.obj shift.obj time.obj \ truename.obj type.obj verify.obj which.obj HDR = ..\config.h ..\err_fcts.h ..\include/batch.h ..\include/cmdline.h \ ..\include/command.h ..\include/context.h ..\include/datefunc.h \ ..\include/debug.h ..\include/kswap.h ..\include/misc.h ..\include/nls.h \ ..\include/openf.h ..\include/timefunc.h # Default target all: cmds.lib dist: makefile.mak %.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist ### Utils are required by build process .INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl .IF $(THISMAKE) == $(LASTMAKE) verscheck :; .ELSE verscheck : @+-echo Changed Make parameters, already made files invalid! +-echo LASTMAKE = $(THISMAKE) >lastmake.mk $(RUNMAKE) clobber .IF $(CFG) $(RUNMAKE) $(CFG) .ENDIF .ENDIF __errl: @+-if exist errlist del errlist >nul -ctags *.c ..\lib\*.c ..\shell\*.c $(FREEDOS)\SRC\LIB\SUPPL\*.c cmds.lib .LIBRARY : $(OBJ) #MAKEDEP START mkdir.obj : mkdir.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h memory.obj : memory.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h goto.obj : goto.c \ ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \ ../include/command.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h copy.obj : copy.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/openf.h ../include/timefunc.h ../strings.h shift.obj : shift.c \ ../config.h ../include/batch.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h rmdir.obj : rmdir.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h pause.obj : pause.c \ ../config.h ../include/batch.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h date.obj : date.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/nls.h ../include/timefunc.h ../strings.h chcp.obj : chcp.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h dir.obj : dir.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/nls.h ../include/timefunc.h ../strings.h truename.obj : truename.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h rem.obj : rem.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ctty.obj : ctty.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/openf.h \ ../include/timefunc.h ../strings.h ren.obj : ren.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h break.obj : break.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h for.obj : for.c \ ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \ ../include/command.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h chdir.obj : chdir.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h alias.obj : alias.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/context.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h cdd.obj : cdd.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h set.obj : set.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/context.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h exit2.obj : exit2.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h path.obj : path.c \ ../config.h ../include/cmdline.h ../include/command.h \ ../include/context.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h if.obj : if.c \ ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \ ../include/command.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h history.obj : history.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h dirs.obj : dirs.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h which.obj : which.c \ ../config.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h popd.obj : popd.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h exit.obj : exit.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h call.obj : call.c \ ../config.h ../context.h_c ../err_fcts.h ../include/batch.h \ ../include/cmdline.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/kswap.h ../include/misc.h \ ../include/timefunc.h beep.obj : beep.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h echo.obj : echo.c \ ../config.h ../include/batch.h ../include/cmdline.h \ ../include/command.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h type.obj : type.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/openf.h ../include/timefunc.h ../strings.h prompt.obj : prompt.c \ ../config.h ../include/cmdline.h ../include/command.h \ ../include/context.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h cls.obj : cls.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h pushd.obj : pushd.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h time.obj : time.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/nls.h ../include/timefunc.h ../strings.h doskey.obj : doskey.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h fddebug.obj : fddebug.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h verify.obj : verify.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h del.obj : del.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h DYNSOURCES = #MAKEDEP STOP clobber : clean $(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist makefile.mak : makefile cmd.m1 cmd.m2 +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 $@ ================================================ FILE: cmd/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak TOP = .. !include "$(TOP)/config.mak" all: $(CFG) cmds.lib OBJS1 = alias.obj beep.obj break.obj call.obj cdd.obj chcp.obj chdir.obj OBJS2 = cls.obj copy.obj ctty.obj date.obj del.obj dir.obj dirs.obj OBJS3 = doskey.obj echo.obj exit.obj exit2.obj fddebug.obj for.obj goto.obj OBJS4 = history.obj if.obj lfnfor.obj memory.obj mkdir.obj path.obj pause.obj OBJS5 = popd.obj prompt.obj pushd.obj rem.obj ren.obj rmdir.obj set.obj OBJS6 = shift.obj time.obj truename.obj type.obj verify.obj which.obj cmds.rsp : $(ECHOLIBDEP) makefile.mak $(RMFILES) cmds.rsp $(ECHOLIB) cmds.rsp $(OBJS1) $(ECHOLIB) cmds.rsp $(OBJS2) $(ECHOLIB) cmds.rsp $(OBJS3) $(ECHOLIB) cmds.rsp $(OBJS4) $(ECHOLIB) cmds.rsp $(OBJS5) $(ECHOLIB) cmds.rsp $(OBJS6) cmds.lib : $(CFG) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) cmds.rsp $(RMFILES) cmds.lib $(AR) cmds.lib @cmds.rsp $(LIBLIST) cmds.lst ================================================ FILE: cmd/memory.c ================================================ /* $Id$ Internal command MEMORY to display the amount of memory used by the various internal data structures. */ #include "../config.h" #ifdef __TURBOC__ #include #endif #include #include #include "../include/context.h" #include "../include/command.h" #include "../strings.h" static void displayTag(int string, Context_Tag tag) { ctxt_info_t *info; info = &CTXT_INFO_STRUCT(tag); displayString(string, info->c_sizemax, info->c_sizecur , info->c_nummin < info->c_nummax ? info->c_nummax - info->c_nummin : 0); } static void displayTag1(int string, Context_Tag tag) { ctxt_info_t *info; info = &CTXT_INFO_STRUCT(tag); displayString(string, info->c_sizecur , info->c_nummin < info->c_nummax ? info->c_nummax - info->c_nummin : 0); } int cmd_memory (char * param) { (void)param; displayString(TEXT_MEMORY_ENVIRONMENT , mcb_length(env_glbSeg), env_freeCount(env_glbSeg)); displayString(TEXT_MEMORY_CONTEXT , mcb_length(ctxt), env_freeCount(ctxt)); displayTag(TEXT_MEMORY_CTXT_ALIAS, CTXT_TAG_ALIAS); displayTag(TEXT_MEMORY_CTXT_HISTORY, CTXT_TAG_HISTORY); displayTag(TEXT_MEMORY_CTXT_DIRSTACK, CTXT_TAG_DIRSTACK); displayTag1(TEXT_MEMORY_CTXT_LASTDIR, CTXT_TAG_LASTDIR); /* displayTag1(TEXT_MEMORY_CTXT_BATCH, CTXT_TAG_BATCH); not used, yet -- 2001/06/11 ska*/ displayTag1(TEXT_MEMORY_CTXT_SWAPINFO, CTXT_TAG_SWAPINFO); #ifdef __TURBOC__ displayString(TEXT_MEMORY_HEAP, (unsigned long)coreleft()); #endif return 0; } ================================================ FILE: cmd/mkdir.c ================================================ /* $Id$ * MD / MKDIR - makes a call to directory_handler to do its work */ #include "../config.h" #include #include #include "suppl.h" #include "dfn.h" #ifdef DBCS # include "mbcs.h" #endif #include "../include/command.h" #include "../include/misc.h" #include "../include/lfnfuncs.h" int recursive_mkdir(const char * path, int recursiveMode, int quiet) { if (recursiveMode) { char fullname[MAXPATH]; char *p = fullname; int flag_not_done = 0; int ret; strcpy(fullname, path); /* so we can modify in place */ dprintf(("fullpath = %s\n", fullname)); do { while (*p && ((*p != '\\') && (*p != '/'))) { #ifdef DBCS p += MbLen(p); #else p++; #endif } flag_not_done = *p; /* == 0 when end of path found, nonzero if \ or / */ *p = '\0'; dprintf(("mkdir(%s)\n", fullname)); /* validate if path exists and is a directory */ ret = dfnstat(fullname); if (ret) { /* found, verify it is a directory */ if (!(ret & DFN_DIRECTORY)) { /* path component exists but not a directory */ ret = E_Other; } else { ret = 0; /* no error */ } } else { /* not found (or other error) so attempt to make directory */ ret = mkdir(fullname); } if (ret) { if (!quiet) { /* TODO show error message */ } return ret; } if (flag_not_done) *p++ = '\\'; } while(flag_not_done); return ret; } else { return mkdir(path); } } int cmd_mkdir(char *param) { return mk_rd_dir(param, recursive_mkdir, "MKDIR"); } ================================================ FILE: cmd/path.c ================================================ /* $Id$ * PATH.C - path command. * * Comments: * * 17 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 12-Aug-1998 ska * - added: SUPPL environment handling * currently "PATH=" will delete the environment variable PATH; * if an empty one shall be created, replace chgEnv1() by chgEnv() */ #include "../config.h" #include #include #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../strings.h" #define PATHVAR "PATH" int cmd_path(char *param) { char *p; /* >>PATH ;<< must remove the string entirely */ if(!param || (!*(p = ltrimcl(param)) && !strchr(param, ';'))) { p = getEnv(PATHVAR); displayString(p? TEXT_MSG_PATH: TEXT_MSG_PATH_NONE, p); free(p); return 0; } rtrimcl(p); /* remove trailing spaces */ return chgEnvRemove(PATHVAR, p); } ================================================ FILE: cmd/pause.c ================================================ /* $Id$ * PAUSE.C - pause command. * * FREEDOS extension : If resteter is specified use that as the pause * message. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 1999/05/03 ska * bugfix: '\n' issued after waiting for keypress */ #include "../config.h" #include #include #include "../include/batch.h" #include "../include/command.h" #include "../strings.h" int cmd_pause (char * param) { if(param && *param) dos_write( 1, param, strlen(param) ); else displayString(TEXT_MSG_PAUSE); cgetchar(); outc('\n'); return 0; } ================================================ FILE: cmd/popd.c ================================================ /* $Id$ * DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS * * POPD [*] * * Pops a directory off the stack, and sets it as cwd. * Accepts the parameter '*', causing it to wipe the stack. */ #include "../config.h" #include #include "../include/context.h" #include "../include/command.h" #include "../include/misc.h" #include "../strings.h" int cmd_popd(char *param) { if(!param || *param != '*') { char *todir; if(ctxtPop(CTXT_TAG_DIRSTACK, &todir)) { int rc; rc = cmd_cdd(todir); free(todir); return rc; } displayString(TEXT_DIRSTACK_EMPTY); } /* Wipe the dirstack */ ctxtClear(CTXT_TAG_DIRSTACK); return 0; } ================================================ FILE: cmd/prompt.c ================================================ /* $Id$ * PROMPT.C - prompt handling. * */ #include "../config.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../include/misc.h" int cmd_prompt(char *param) { if(param && *param == '=') /* skip '=' & spaces */ param = ltrimcl(param + 1); /* NO rtrim()! */ return chgEnvRemove(PROMPTVAR, param); } ================================================ FILE: cmd/pushd.c ================================================ /* $Id$ * DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS * * PUSHD * * Pushes the current directory onto the stack. If the length of * the directory string exceeds the remainer of the stack, it pops the first * entry, adjusts, and proceeds with the push. * Also: changes to the directory specified on the command line. */ #include "../config.h" #include #include "../include/context.h" #include "../include/command.h" #include "../include/misc.h" int cmd_pushd(char *param) { char *curdir; if((curdir = cwd(0)) != 0) { int rc; rc = ctxtPush(CTXT_TAG_DIRSTACK, curdir); free(curdir); if(rc == E_None) { /* Change to directory specified on command line */ if(param && *param) return cmd_cdd(param); return 0; } } return 1; } ================================================ FILE: cmd/rem.c ================================================ /* $Id$ * REM -- includes comments "remarks" into batch scripts */ #include "../config.h" #include "../include/command.h" int cmd_rem (char * param) { (void)param; return 0; } ================================================ FILE: cmd/ren.c ================================================ /* $Id$ * REN.C - rename command * * 27-Jul-1998 (John P Price ) * - added config.h include * 15-Mar-2003 (Wolf Bergenheim ) * - added support for * and ? * */ #include "../config.h" #include #include #include #include #include /*#define DEBUG*/ #include #include #include #include "../include/lfnfuncs.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/misc.h" #include "../err_fcts.h" void myfnsplit( const char *path, char *buf, char *drv, char **dir, char **name, char **ext ) { const char* end; const char* p; const char* s; if( path[ 0 ] && path[ 1 ] == ':' ) { if( drv ) { *drv++ = *path++; *drv++ = *path++; *drv = '\0'; } } else if( drv ) *drv = '\0'; for( end = path; *end && *end != ':'; ) end++; for( p = end; p > path && *--p != '\\'/* && *p != '/'*/; ) if( *p == '.' ) { end = p; break; } if ( ext ) { *ext = buf; for( s = end; ( *buf++ = *s++ ) != '\0'; ); } for( p = end; p > path; ) if( *--p == '\\'/* || *p == '/'*/) { /* * '/' can't happen as a path seperator in FreeCOM because it's treated * as a switch character no matter where it's found */ p++; break; } if( name ) { *name = buf; for( s = p; s < end; ) *buf++ = *s++; *buf++ = '\0'; } if ( dir ) { *dir = buf; for( s = path; s < p; ) *buf++ = *s++; *buf = '\0'; } } void myfnmerge( char *path, const char *drive, const char *dir, const char *fname, const char *ext ) { if( *drive ) { strcpy( path, drive ); #if 0 /* Unused */ if( !drive[ 1 ] )strcat( path, ":" ); #endif } else ( *path ) = 0; if( *dir ) { strcat( path, dir ); if( *( dir + strlen( dir ) - 1 ) != '\\' ) strcat( path, "\\" ); } if( *fname ) { strcat( path, fname ); if( ext && *ext ) { #if 0 /* Unused */ if( *ext != '.' ) strcat( path, "." ); #endif strcat( path, ext ); } } } int cmd_rename(char *param) { char **argv; int argc, opts, ec = E_None; struct dos_ffblk ff; int appState; if((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0) return 1; appState = appendDisable(); if(argc < 2) { error_req_param_missing(); ec = E_Useage; } else if(argc > 2) { error_too_many_parameters(param); ec = E_Useage; } else if(dos_findfirst(argv[0], &ff , FA_NORMAL|FA_DIREC|FA_ARCH|FA_SYSTEM|FA_RDONLY|FA_HIDDEN) != 0) { error_sfile_not_found(argv[0]); /* ec == E_None */ } else { #if 0 /* * There is some dynamic memory bug in relation to dfnmerge * Let's spare ourselves the whole mucking about in dynamic memory * thing, and we can use myfnmerge/myfnsplit to make everything work. * Unless of course someone wants to fix the bug in dfnmerge/split * So... the old code is still here if anyone wants to give it a shot * AND, if anyone tries to blame the _REGISTER usage in lfnfuncs.c as * the culprit, it already uses intr instead :-) */ char *s_drv = NULL, *s_dir = NULL, *s_fil = NULL, *s_ext = NULL; char *d_drv = NULL, *d_dir = NULL, *d_fil = NULL, *d_ext = NULL; char *newname = 0, *sn = 0, *dn = 0; char *oldFname; #define p oldFname if(!dfnsplit(argv[0], &s_drv, &s_dir, &s_fil, &s_ext) || !dfnsplit(argv[1], &d_drv, &d_dir, &d_fil, &d_ext) || (sn = dfnmerge(0, s_drv, s_dir, "", NULL)) == 0 || (p = realloc(sn, strlen(sn) + sizeof(ff.ff_name) + 1)) == 0) { /* build dir to use */ error_out_of_memory(); ec = E_NoMem; goto errRet; } sn = p; p = strchr(sn, '\0'); #undef p #else char s_drv[ MAXDRIVE ], d_drv[ MAXDRIVE ]; char *s_dir, *d_dir, *d_fil, *d_ext; char s_buf[ MAXPATH ], d_buf[ MAXPATH ], *sn, dn[ MAXPATH ], newname[MAXPATH]; myfnsplit( argv[ 0 ], s_buf, s_drv, &s_dir, NULL, NULL ); myfnsplit( argv[ 1 ], d_buf, d_drv, &d_dir, &d_fil, &d_ext ); #endif /* if drive or path in second arg, return with syntax error */ if((d_drv[ 0 ]) || (d_dir[ 0 ])) { error_syntax(argv[1]); ec = E_Useage; goto errRet; } #if 0 if((dn = dfnmerge(0, s_drv, s_dir, d_fil, d_ext)) == 0) { /* build dir to use */ error_out_of_memory(); ec = E_NoMem; goto errRet; } #else myfnmerge( dn, s_drv, s_dir, d_fil, d_ext ); /* d_buf no longer used after this */ sn = d_buf; #endif do { fillFnam(newname, dn, ff.ff_name); #if 0 if(newname[0] == 0) { error_out_of_memory(); ec = E_NoMem; break; } #endif myfnmerge( sn, s_drv, s_dir, ff.ff_name, NULL ); dprintf(("rename(%s, %s)\n", sn, newname) ); if(rename(sn, newname) != 0) { myperror("rename"); ec = E_Other; break; } /*free(newname);*/ newname[0] = 0; } while(dos_findnext(&ff) == 0); errRet: dos_findclose(&ff); #if 0 /* free(newname) isn't even necessary because it is free'd above */ free(s_drv); free(s_dir); free(s_fil); free(s_ext); free(d_drv); free(d_dir); free(d_fil); free(d_ext); free(newname); free(sn); free(dn); #endif } appendRestore(appState); freep(argv); return ec; } ================================================ FILE: cmd/rmdir.c ================================================ /* $Id$ * RD / RMDIR - makes a call to directory_handler to do its work */ #include "../config.h" #include #include #include #include #include #include #include "suppl.h" #include "dfn.h" #ifdef DBCS # include "mbcs.h" #endif #include "../include/command.h" #include "../include/misc.h" #include "../include/lfnfuncs.h" #include "../err_fcts.h" #include "../strings.h" #ifdef FEATURE_LONG_FILENAMES #define abspath( x, y ) abspath( getshortfilename( x ), y ) #endif /* recursively delete subdirs and files */ #ifdef DBCS int rmdir_withfiles(const char * fullname, char * path, int maxlen) #else int rmdir_withfiles(char * path, int maxlen) #endif { struct dos_ffblk *f; int ret; int len = strlen(path); /* Warning: we assume path is a buffer is large enough for longest file path */ char *p = path+len; /* ensure ends with \ */ #ifdef DBCS if (*fullname && *(CharPrev(fullname, p)) != '\\') #else if (p[-1] != '\\') #endif *p++ = '\\'; *p = '\0'; dprintf(("rmdir(%s)\n", path)); /* cycle through removing directories first */ stpcpy(p, "*.*"); /* allocate our findfirst/next structure on heap to avoid exhausting stack */ f = (struct dos_ffblk *)malloc(sizeof(struct dos_ffblk)); if (f == NULL) { error_out_of_memory(); return E_NoMem; } if (!dos_findfirst(path, f, FA_DIREC)) { ret = 0; do { /* skip . and .. directory entries */ if ((strcmp(f->ff_name, ".")==0) || (strcmp(f->ff_name, "..")==0)) continue; if (f->ff_attrib & FA_DIREC) { dprintf(("name=%s\n", f->ff_name)); /* avoid overflowing our buffer */ if((len + strlen(f->ff_name)) > maxlen) { error_filename_too_long(p); ret = E_Other; continue; } strcpy(p, f->ff_name); /* Make the full path */ /* recursively delete subdirectory */ #ifdef DBCS ret = rmdir_withfiles(fullname, path, maxlen); #else ret = rmdir_withfiles(path, maxlen); #endif } } while (!ret && (dos_findnext(f) == 0)); dos_findclose(f); /* return early on error */ if (ret) { free(f); return ret; } } /* remove any files in current directory */ stpcpy(p, "*.*"); if (!dos_findfirst(path, f, FA_NORMAL)) { ret = 0; do { /* avoid overflowing our buffer */ if((len + strlen(f->ff_name)) > maxlen) { error_filename_too_long(p); ret = E_Other; continue; } strcpy(p, f->ff_name); /* Make the full path */ dprintf(("deleting [%s]\n", path)); /* try to delete the file */ if(unlink(path) != 0) { myperror(path); /* notify the user */ /* could exit here, but we just let rmdir fail */ } } while (!ret && (dos_findnext(f) == 0)); dos_findclose(f); } free(f); /* finally actually remove the directory */ p[-1] = '\0'; return rmdir(path); } int recursive_rmdir(const char * path, int recursiveMode, int quiet) { if (recursiveMode) { struct dos_ffblk f; char *p; static char fullname[MAXPATH + sizeof(f.ff_name) + 2]; int len; /* Get the pattern fully-qualified */ /* Note: An absolute path always contains: A:\\ --> It's always three bytes long at minimum and always contains a backslash */ p = abspath(path, 1); if(!p) return E_Other; assert(strlen(p) >= 3); if((len = strlen(p)) >= MAXPATH) { error_filename_too_long(p); free(p); return E_Other; } strcpy(fullname, p); free(p); p = fullname + len; /* validate path exists and is a directory */ if(!(dfnstat(fullname) & DFN_DIRECTORY)) { /* not a directory */ return E_Other; } /* ensure ends with \ */ #ifdef DBCS if (len > 0 && *(CharPrev(fullname, p)) != '\\') #else if (p[-1] != '\\') #endif *p++ = '\\'; *p = 0; /* prompt user if they are sure, regardless if files or not */ if (!quiet) { int r; r = userprompt(PROMPT_DELETE_ALL, fullname); /* Are you sure? TODO fix me */ if (r != 1) { return E_Other; } } #ifdef DBCS return rmdir_withfiles(fullname, fullname, sizeof(fullname)); #else return rmdir_withfiles(fullname, sizeof(fullname)); #endif } else { return rmdir(path); } } int cmd_rmdir(char *param) { return mk_rd_dir(param, recursive_rmdir, "RMDIR"); } ================================================ FILE: cmd/set.c ================================================ /* $Id$ * Set environment variables * */ #include "../config.h" #include #include #include #include #include #include "environ.h" #include "nls_c.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #define promptBuffer 256 /* optC determines if env variable's name (param) is set using passed in case or uppercased, whereas upCaseValue determines if the value the user passes in (with the /P option) is stored as typed or uppercased. */ static int optC, promptUser, upCaseValue, optExecute; optScanFct(opt_set) { (void)arg; switch(ch) { /* case 'A': return optScanBool(optA); arithmetic expression */ case 'C': return optScanBool(optC); case 'U': return optScanBool(upCaseValue); #if 1 case 'I': /* Display Information about current memory */ printf("Size of environment segment: %u bytes; unused: %u\n" , env_resize(0, 0), env_freeCount(env_glbSeg)); return E_Other; #endif case 'P': return optScanBool(promptUser); case 'E': return optScanBool(optExecute); } optErr(); return E_Useage; } int cmd_set(char *param) { char *value; char *promptBuf = 0, tempcmd[255]; int ret; optC = promptUser = upCaseValue = optExecute = 0; if(leadOptions(¶m, opt_set, 0) != E_None) return 1; switch(breakVarAssign(ctxtEnvironment, param, &value)) { case 1: /* no equal sign */ #ifdef FEATURE_CMD_SET_PRINT if( ( value = getEnv( param ) ) != NULL ) printf( "%s\n", value ); else { error_env_var_not_found( param ); return( 1 ); } free(value); return( 0 ); #else error_syntax(0); return 1; #endif case 0: /* displayed */ return 0; #ifdef DEBUG case 2: break; default: dprintf(("[SET: Invalid response from breakVarAssign()]\n")); return 1; #endif } if(promptUser) { /* -> Display the value, then read and assign */ int len; assert(value); outs(value); promptBuf = malloc(promptBuffer); if(!promptBuf) { error_out_of_memory(); return E_NoMem; } len = dos_read(0, promptBuf, promptBuffer-1); if(cbreak || len < 0) { free(promptBuf); return E_CBreak; } value = &promptBuf[len]; while(--value >= promptBuf && (*value == '\n' || *value == '\r')); value[1] = '\0'; /* strip trailing newlines */ value = promptBuf; } if (optExecute) { char *tempfile = tmpfn(); int fd, len; if (!tempfile) return (1); sprintf (tempcmd, "%s>%s", value, tempfile); parsecommandline (tempcmd, TRUE); fd = dos_open (tempfile, O_RDONLY); if (fd < 0) { unlink (tempfile); free (tempfile); return (1); } len = dos_read(fd, tempcmd, 254); if (len >= 0) { value = memchr(tempcmd, '\n', len); if (value) len = value - tempcmd; if (len > 0 && tempcmd[len-1] == '\r') len--; tempcmd[len] = '\0'; } value = tempcmd; dos_close (fd); unlink (tempfile); free (tempfile); } /* If the value is just blanks, it means to delete the value; but otherwise even leading and trailing spaces must be kept */ if(is_empty(value)) value = 0; if (upCaseValue) StrUpr(value); /* set value as upper case, eg for if testing */ ret = chgEnvCase(optC, param, value); free(promptBuf); return ret; } ================================================ FILE: cmd/shift.c ================================================ /* $Id$ * SHIFT.C - shift command. * * Only valid inside batch files. * * FREEDOS extension : optional parameter DOWN to allow shifting * parameters backwards. * * 16 Jul 1998 (Hans B Pufal) * started. * * 16 Jul 1998 (John P Price) * Seperated commands into individual files. * * 27-Jul-1998 (John P Price ) * - added config.h include * */ #include "../config.h" #include #include #include #include #include "../include/batch.h" #include "../include/command.h" int cmd_shift(char *param) { struct bcontext *b = activeBatchContext(); if(!b) /* not in batch - error */ return 1; assert(param); if(stricmp(param, "down") == 0) { if(b->shiftlevel) b->shiftlevel--; } else /* shift up */ b->shiftlevel++; return 0; } ================================================ FILE: cmd/time.c ================================================ /* $Id$ * TIME.C - time internal command * * Comments: * * 07/08/1998 (John P. Price) * started. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 1999/03/17 ska * bugfix: Detection of invalid time strings * One can specify: * ^\s*\d+.\d+(.(\d+(.\d*)?)?)?\s*([aApP]([mM]|\.[mM]\.)?\s*$ * If one specifies: * 1 number --> error * 2 numbers --> hour:minute, seconds & hundreds default to zero * 3 numbers --> hour:minute:seconds, hundreds defaults to zero * 4 numbers --> hour:minute:seconds.hundreds * The numbers may be delimited by any character from the 7-bit ASCII set, * which is printable, but not alphanumerical. * * 2001/02/08 ska * add: DATE /D and TIME /T */ #include "../config.h" #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../include/nls.h" #include "../strings.h" static int noPrompt = 0; optScanFct(opt_date) { (void)arg; switch(ch) { case 'D': case 'T': return optScanBool(noPrompt); } optErr(); return E_Useage; } static int my_settime(const char *s) { struct dostime_t t; switch(parsetime(s, &t)) { case E_None: /* success -> set the date */ _dos_settime(&t); /* fall through */ case E_Empty: /* empty line */ return 1; /* success */ } return 0; /* failure */ } int cmd_time(char *param) { char s[40]; int ec; noPrompt = 0; if((ec = leadOptions(¶m, opt_date, 0)) != E_None) return ec; if(!*param) { char *time; if((time = curTime()) == 0) return 1; displayString(TEXT_MSG_CURRENT_TIME, time); free(time); param = 0; } while(1) { if(!param) { int len; if(noPrompt) return 0; displayString(TEXT_MSG_ENTER_TIME); len = dos_read(0, s, sizeof(s) - 1); if (cbreak || len < 0) return 1; s[len] = '\0'; param = s; } if(my_settime(param)) break; error_invalid_time(); /* force user interaction the next time around. */ param = 0; } return 0; } ================================================ FILE: cmd/truename.c ================================================ /* $Id$ * TRUENAME.C -- Truename Command (undocumented DOS?) * * 07/14/98 (Rob Lake) * - started and tested fine * - added stand alone debugging * * 27-Jul-1998 (John P Price ) * - added config.h include * * 28-Jul-1998 (John P Price ) * - changed _truename function so it does not return a pointer to a local * variable. * * 09-Aug-1998 (Rob Lake ) * - _truename now sets errno * */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../err_fcts.h" int cmd_truename(char *param) { char *p; if(0 != (p = truepath((param && *param)? param: "."))) { puts(p); free(p); return 1; } return 0; } ================================================ FILE: cmd/type.c ================================================ /* $Id$ * TYPE.C - type internal command * * Comments: * * 07/08/1998 (John P. Price) * started. * * 07/12/98 (Rob Lake) * - Changed error messages * * 27-Jul-1998 (John P Price ) * - added config.h include * * 10-Aug-1998 ska * - added ^Break checking * * 1999/01/24 ska * add: support for CP/M style device names (openf.h) */ #include "../config.h" #include #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/openf.h" #include "../strings.h" int cmd_type(char *param) { char buf[256]; char **argv; int argc, opts, ec = E_None; int fd, len; if((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0) return 1; /* Because no option was passed into scanCmdline() no option can have been processed */ assert(opts == 0); if(!argc) { error_req_param_missing(); ec = E_Useage; goto errRet; } for(argc = 0; argv[argc]; ++argc) { if((fd = devopen(argv[argc], O_RDONLY)) < 0) { error_sfile_not_found(argv[argc]); ec = E_Other; break; } while((len = dos_read(fd, buf, sizeof(buf))) >= 0) { char *bufp, *p; if(cbreak) { dos_close(fd); ec = E_CBreak; goto errRet; } bufp = buf; for(p = buf; p < buf+len; p++) { if(*p == 26) break; /* CTRL-Z */ if(*p == '\r' || *p == '\n') { if(p > bufp) dos_write(1, bufp, p - bufp); if(*p == '\n') dos_write(1, "\r\n", 2); bufp = p + 1; } } dos_write(1, bufp, p - bufp); if (len == 0 || *p == 26) break; } dos_close(fd); if(cbreak) { ec = E_CBreak; break; } } errRet: freep(argv); return ec; } ================================================ FILE: cmd/verify.c ================================================ /* $Id$ * VERIFY.C - verify command. * * Comments: * * 31 Jul 1998 (John P Price) * started. * * */ #include "../config.h" #include #include #include "../err_fcts.h" #include "../include/command.h" #include "../strings.h" #ifdef __WATCOMC__ void setverify(char a); #pragma aux setverify = \ "mov ah,0x2e" \ "mov dl,0" \ "int 0x21" \ __parm [__al] __modify __exact [__ah __dl] char getverify(void); #pragma aux getverify = \ "mov ah,0x54" \ "int 0x21" \ __value [__al] __modify __exact [__ah] #endif #ifdef __GNUC__ static inline void setverify(char a) { asm volatile("int $0x21":: "Rah"((char)0x2e), "Rdl"((char)0), "Ral"(a)); } static inline char getverify(void) { char ret; asm volatile("int $0x21": "=Ral"(ret): "Rah"((char)0x54)); return ret; } #endif int cmd_verify(char *param) { switch(onoffStr(param)) { default: error_on_off(); return 1; case OO_Null: case OO_Empty: displayString(TEXT_MSG_VERIFY_STATE, getverify() ? D_ON : D_OFF); break; case OO_Off: setverify(0); break; case OO_On: setverify(1); break; } return 0; } ================================================ FILE: cmd/which.c ================================================ /* $Id$ * WHERE.C - path functions. * * * * Comments: * * 07/15/95 (Tim Norman) * started. * * 08/08/95 (Matt Rains) * i have cleaned up the source code. changes now bring this source into * guidelines for recommended programming practice. * * 12/12/95 (Steffan Kaiser & Tim Norman) * added some patches to fix some things and make more efficient * * 1/6/96 (Tim Norman) * fixed a stupid pointer mistake... Thanks to everyone who noticed it! * * 8/1/96 (Tim Norman) * fixed a bug when getenv returns NULL * * 8/7/96 (Steffan Kaiser and Tim Norman) * speed improvements and bug fixes * * 8/27/96 (Tim Norman) * changed code to use pointers directly into PATH environment variable * rather than making our own copy. This saves some memory, but requires * we write our own function to copy pathnames out of the variable. * * 12/23/96 (Aaron Kaufman) * Fixed a bug in get_paths() that did not point to the first PATH in the * environment variable. * * 7/12/97 (Tim Norman) * Apparently, Aaron's bugfix got lost, so I fixed it again. * * 16 July 1998 (John P. Price) * Added stand alone code. * * 17 July 1998 (John P. Price) * Rewrote find_which to use searchpath function * * 24-Jul-1998 (John P Price ) * - fixed bug where didn't check all extensions when path was specified * * 27-Jul-1998 (John P Price ) * - added config.h include * * 30-Jul-1998 (John P Price ) * - fixed so that it find_which returns NULL if filename is not executable * (does not have .bat, .com, or .exe extention). Before command would * to execute any file with any extension (opps!) * * 2001/02/16 ska * add: command WHICH */ #include "../config.h" #include #include #include "../include/cmdline.h" #include "../include/command.h" int cmd_which(char *param) { char **arg, *p; int argc, optc, i; if((arg = scanCmdline(param, 0, 0, &argc, &optc)) == 0) return E_Other; for(i = 0; i < argc; ++i) { assert(arg[i]); outs(arg[i]); if((p = find_which(arg[i])) != 0) { outc('\t'); puts(p); } else { outc('\n'); } } freep(arg); return E_None; } ================================================ FILE: command.lsm ================================================ Begin3 Title: FreeCom Version: 0.87 Entered-date: Mon DD 202Y Description: The FreeDOS Command Shell Keywords: freecom freedos command shell Author: freedos-devel@lists.sourceforge.net (developers) Maintained-by: freedos-devel@lists.sourceforge.net (maintainers) Primary-site: https://github.com/FDOS/freecom Alternate-site: http://freedos.sourceforge.net/ Alternate-site: http://www.freedos.org/ Platforms: dos dosemu Copying-policy: GNU General Public License, Version 2 (GPL) Wiki-site: http://wiki.freedos.org/wiki/index.php/Command End ================================================ FILE: config.b ================================================ @echo off :-**************************************************************** :- NOTICE! You can edit but then copy this file to CONFIG.BAT! * :-**************************************************************** :-********************************************************************** :-- define NASM executable :-********************************************************************** set XNASM=nasm :********************************************************************** :- define your COMPILER type here, pick one of them :********************************************************************** :- Open Watcom C :- set COMPILER=WATCOM :- Turbo C 2.01 :- set COMPILER=TC2 :- Turbo C++ 1.01 set COMPILER=TURBOCPP :- Borland C :- set COMPILER=BC5 :-********************************************************************** :-- where is the BASE dir of your compiler(s) ?? :-********************************************************************** :- set TC2_BASE=c:\tc201 set TP1_BASE=c:\tcpp :- set BC5_BASE=c:\bc5 :- if WATCOM maybe you need to set your WATCOM environment variables :- and path :- if not \%WATCOM% == \ goto watcom_defined :- set WATCOM=c:\watcom :- set PATH=%PATH%;%WATCOM%\binw :watcom_defined ================================================ FILE: config.h ================================================ /* * config.h - Used to configure what will be compiled into the shell. * */ /* define DEBUG to add debugging code */ #ifndef DEBUG /* possibly already defined via command line */ /*#define DEBUG*/ #endif /* Define to enable the alias command, and aliases. */ #define FEATURE_ALIASES #define ALIAS_DEFAULT_SIZE 1024 /* Define to disable context error messages that may scare a user */ /* #define NO_CONTEXT_ERROR */ /* Define to enable enhanced input (prerequisite of History and Filename completion */ #define FEATURE_ENHANCED_INPUT /* Define to enable history (aka DOSKEY); requires: Enhanced Input */ #define FEATURE_HISTORY #define HISTORY_DEFAULT_SIZE 256 /* Define to enable filename completion; requires: Enhanced Input */ #define FEATURE_FILENAME_COMPLETION /* Define to enable to load messages into memory */ #define FEATURE_LOAD_MESSAGES /* Define to enable /Z support, display exit code on program exit */ #define DISP_EXITCODE /* Define to enable usage of LFNs */ #define FEATURE_LONG_FILENAMES /* Define to enable usage or the DOS switch character in option processing */ #define FEATURE_SWITCHAR /* Define to enable printing of environment variables for "SET VAR" syntax */ /* (Like Win2k's cmd.exe does) */ #define FEATURE_CMD_SET_PRINT /* Define for limited support of 4DOS DESCRIPT.ION files */ #define FEATURE_DESCRIPT_ION /* Define to enable DOS NLS */ #define FEATURE_NLS /* Define to enable F5/F8 key test on startup if /P is present on command line */ /* #define FEATURE_BOOT_KEYS */ /* Command line logging feature */ /* #define FEATURE_CALL_LOGGING */ /* Preserves last directory (CD, CHDIR, CDD, PUSHD, POPD); "CD -" chdir's there */ #define FEATURE_LAST_DIR /* Enables CDD to a filepath (ignores filename portion) */ #define FEATURE_CDD_FNAME /* Enable to support installable COMMAND extensions (MUX-AE) */ #define FEATURE_INSTALLABLE_COMMANDS /* How often gets the MUX-AE called, when an installable command extension rewrote the command. */ #define MUX_AE_MAX_REPEAT_CALL 32 /* Name of the executable */ #define COM_NAME "COMMAND.COM" /* standard name of AUTOEXEC.BAT */ #define AUTO_EXEC "\\autoexec.bat" /* Logfile for some logging features; MUST be fully-qualified! */ #define LOG_FILE "C:\\FreeCom.log" /* Define to number of loops when to redirect to CON if the shells hangs in the "hangForEver()" loop Undefine to remove this feature */ #define FEATURE_AUTO_REDIRECT_TO_CON 5 /* How many batch files should be nestable minimally */ #define BATCH_NESTLEVEL_MIN 5 /* Define to support kernel-supported swapout of FreeCOM see DOCS\K-SWAP.TXT */ #define FEATURE_KERNEL_SWAP_SHELL /* Define to support XMS-only swap support of FreeCOM This setting is incompatible with the above one! */ /* #define FEATURE_XMS_SWAP */ /* Define the size of the buffer used to store old paths for PUSHD/POPD */ #define DIRSTACK_DEFAULT_SIZE 256 /* Use this errorlevel if an external program was terminated by ^C or ^Break --> DOS error code interrupted system call */ #define CBREAK_ERRORLEVEL 0x5F /* Use these filemode while searching for file completion */ #define FILE_SEARCH_MODE FA_RDONLY | FA_ARCH | FA_DIREC /* If no /E: is specified, always keep this amount of bytes free within the environment */ #define ENVIRONMENT_KEEP_FREE 256 /* Default message settings: PATTERN: how the string is constructed for the ID (with \n) OUTOFMEMORY: string to issue on out-of-memory condition (no \n) ID_: the error ID when no default pattern is to be created, but the out-of-memory string is to be displayed */ #define MSG_DFL_PATTERN "String #%u\n" #define MSG_DFL_OUTOFMEMORY "Out of memory!" #define MSG_ERR_ID_OUTOFMEMORY TEXT_ERROR_OUT_OF_MEMORY /* Default prompt */ #define DEFAULT_PROMPT "$P$G" /* Provides the uppermost size the context may have */ #define CONTEXT_MAX_SIZE (65535U - 12) /* Define this value to select the initialization value of fddebug */ #define FDDEBUG_INIT_VALUE 1 #define INCLUDE_CMD_BEEP #define INCLUDE_CMD_BREAK #define INCLUDE_CMD_CHDIR #define INCLUDE_CMD_CHCP #define INCLUDE_CMD_CDD #define INCLUDE_CMD_CLS #define INCLUDE_CMD_COPY #define INCLUDE_CMD_CTTY #define INCLUDE_CMD_DATE #define INCLUDE_CMD_DEL #define INCLUDE_CMD_DIR #define INCLUDE_CMD_DIRS #ifdef FEATURE_LONG_FILENAMES #define INCLUDE_CMD_LFNFOR #endif #define INCLUDE_CMD_LOADFIX #define INCLUDE_CMD_LOADHIGH /*#define INCLUDE_CMD_FAKELOADHIGH */ /* DO NOT include this and CMD_LOADHIGH nor CMD_LOADFIX */ #define INCLUDE_CMD_MEMORY #define INCLUDE_CMD_MKDIR #define INCLUDE_CMD_PATH #define INCLUDE_CMD_PAUSE #define INCLUDE_CMD_PROMPT #define INCLUDE_CMD_PUSHD #define INCLUDE_CMD_POPD #define INCLUDE_CMD_REM #define INCLUDE_CMD_RENAME #define INCLUDE_CMD_RMDIR #define INCLUDE_CMD_SET #define INCLUDE_CMD_TIME #define INCLUDE_CMD_TRUENAME #define INCLUDE_CMD_TYPE #define INCLUDE_CMD_VER #define INCLUDE_CMD_VERIFY #define INCLUDE_CMD_VOL #define INCLUDE_CMD_QUESTION #define INCLUDE_CMD_WHICH #ifdef DEBUG #define INCLUDE_CMD_FDDEBUG #endif /* command that do not have a define: exit call echo goto for if shift */ /******** ***** Resolve dependencies ***** Don't change without change the appropriate sources! ************/ #if defined(INCLUDE_CMD_PUSHD) || defined(INCLUDE_CMD_POPD) #define INCLUDE_CMD_CDD #endif /* Not available with TURBOC++ 1.0 or earlier: */ #ifdef __TURBOC__ #if __TURBOC__ > 0x297 #define _TC_LATER_ #else #define _TC_EARLY_ #endif #endif /* Define if your compiler does not have 'dosdate_t' or 'dostime_t' */ #if defined(_TC_EARLY_) || defined(__GNUC__) /* TC++1 */ #define _NO__DOS_DATE #define _NO__DOS_TIME #define _NO_FMEMCHR #define _NO_FMEMCMP #endif /* set by MKDIST.BAT */ #ifdef IGNORE_ENHANCED_INPUT #undef FEATURE_ENHANCED_INPUT #endif #ifndef FEATURE_ENHANCED_INPUT #undef FEATURE_HISTORY #undef FEATURE_FILENAME_COMPLETION #endif #ifdef INCLUDE_CMD_PUSHD #define FEATURE_DIRSTACK #endif #if CONTEXT_MAX_SIZE > 65535U - 12 #error "The maximal context size may not exceed 65535 - 12 bytes" #endif #if defined(FEATURE_KERNEL_SWAP_SHELL) && defined(FEATURE_XMS_SWAP) #error "FreeCOM cannot support both Kernel- and XMS-based swapping simultaneously" #endif /* Externally defined to compile with XMS-Swap support */ #if defined(XMS_SWAP) #undef FEATURE_KERNEL_SWAP_SHELL #define FEATURE_XMS_SWAP #endif #ifdef __TURBOC__ #if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) /* Compiling in Large memory model --> turn of Warning: "Conversation may lose significant digits" */ #pragma warn -sig #endif #endif #include "../include/debug.h" ================================================ FILE: config.std ================================================ # defaults for DOS; can be overridden in compiler makefiles DIRSEP = \ #a backslash ECHOTO = echoto ECHOTODEP = echoto.bat LIBLIST = , ECHOLIB = echolib ECHOLIBDEP = echolib.bat CP = copy CLO = SCRIPTS_PATH = ..\scripts !if $(TOP2LVL)0 == 10 SCRIPTS_PATH = ..\..\scripts !endif RMFILES = $(SCRIPTS_PATH)\rmfiles FIXSTRSOPT = --lib ## Where the pre-compiled SUPPL files are located ## See DOCS\SUPPL.TXT for more information about this library SUPPL_INC_PATH = ..$(DIRSEP)suppl SUPPL_LIB_PATH = $(SUPPL_INC_PATH) ## Memory model of FreeCOM !if $(DEBUG)0 == 10 SHELL_MMODEL=m DEBUG=-DDEBUG !else SHELL_MMODEL=s DEBUG=-UDEBUG -DNDEBUG !endif SHELL_MMODEL_COMP=$(SHELL_MMODEL) ## Compact Memory model used if it requires far data pointers, so uses compact memory model by default COMPACT_MMODEL=-mc ## Add -DDEBUG=1 below to enable debug support for assembly files NASMFLAGS = -I$(TOP)/include !include "$(TOP)/mkfiles/$(COMPILER).mak" ## Which programs to use NASM = $(XNASM) ## Add -DDEBUG=1 below to enable FreeCOM-debug support for C files ## Add -DNDEBUG=1 below to disable any debug (even assert) !if $(XMS_SWAP)0 == 10 __XMS_SWAP = -DXMS_SWAP !endif !if $(COMPACT_MODEL)0 == 10 MMODEL = $(COMPACT_MMODEL) !endif # Default configuration # added strings.h here because $(CFG) is included everywhere already ## Add -D_NO__DOS_DATE if your compiler does not have no dosdate_t (*) ## Add -D_NO__DOS_TIME if your compiler does not have no dostime_t (*) ## Add -D_NO_FMEMCHR if your compiler does not have no _fmemchr() (*) ## Add -D_NO_FMEMCMP if your compiler does not have no _fmemcmp() (*) ## ## (*) Note: Should be detected by CONFIG.H automatically for Turbo C ## and Borland C compilers. $(CFG): $(ECHOTODEP) $(CFG_DEPENDENCIES) $(TOP)/config.mak $(RMFILES) $(CFG) $(ECHOTO) $(CFG) $(CFLAGS1) $(ECHOTO) $(CFG) $(CFLAGS2) $(ECHOTO) $(CFG) $(INCLUDEPATH) -I$(SUPPL_INC_PATH) $(ECHOTO) $(CFG) -m$(SHELL_MMODEL_COMP) $(MMODEL) $(ECHOTO) $(CFG) $(DEBUG) $(__XMS_SWAP) echoto.bat: $(SCRIPTS_PATH)\echoto.bat $(CP) $(SCRIPTS_PATH)\echoto.bat . echolib.bat: $(SCRIPTS_PATH)\echolib.bat $(CP) $(SCRIPTS_PATH)\echolib.bat . # *Implicit Rules* .asm.obj: $(NASM) -f obj $(NASMFLAGS) -DMODEL=$(SHELL_MMODEL) -DCOMPILER=$(COMPILER) $(__XMS_SWAP) $< ================================================ FILE: criter/context.x ================================================ # Context description file # # Contains persistent information to be preserved during the # execution of an external program # # separated to allow to use one file for both assembly and C # TOOLS\MKCTXT.EXE creates the following files: # context.h_c: contains the structure in C syntax # context.h_a: contains the definition of the structure in assembly # context.inc: contains the EQUs of the offsets of a value into the structure # two definitions per offset: # - offset from the very beginning of the context # _ - offset of the value relative to the beginning # of the specific package # "typedef" opens a new "typedef struct {". # "package" groups different values together, if the package # is a shared module, too, a pointer to this position is passed # to the module. Within C, they are represented by struct's # "structure" is more or less the same, but it is ensured that all # structures defined for one package are physically located in above the # pointer to the package # An empty line (no comment lines!) end a structure. # Type: # byte - one single byte (unsigned char) # word - two bytes (unsigned short int) # pointer - far pointer (void far*) # constant - #define of _numerical_ constant # reference - label at exactly this position (unsigned char []) typedef kswap_t # Type currently defined word envSegm 0 # segment to be passed forth as environment pointer prg 0 # program to be executed pointer cmdline 0 # command line arguments of program word execErr 0 # exit code of DOS-4B of external program pointer shell 0 # absolute path to shell to be executed word canexit 0 # true unless FreeCOM was invoked with /P word dfltSwap 0 # default value of swapOnExec word debug 0 # Debug status word envSize 0 # size of environment segment word dyn_ctxt 0 # dynamically changed portions of context word ofs_criter _lowlevel_err_handler # offset of criter module within this context reference cbreak_hdlr # start of dummy ^Break handler active if FreeCOM # is NOT running itself ================================================ FILE: criter/criter.asm ================================================ ; $Id$ ; ; Critical Error handler -- module ; ; Three macros to customize the assembler process: ; COMPILE_COM in order to generate a .COM file (Debugging ONLY) ; automatically defines COMPILE_STRINGS ; includes this: write(open("A:\AUX", O_RDWR), 0, 65535) ; it is assumed that A: is empty first, then a floppy is ; inserted and no AUX: device is present ; --> produces 1st a block device Criter, then a char device ; Criter ; COMPILE_STRINGS to include English response strings right into ; this image ; NO_RESOURCE_BLOCK omit resource block at the end of the file ; XMS_SWAP_CRITER disables interfering stuff when assembling for ; XMS Swap variant ; ; Doing a ECHO >A:\FILE results in: ; WinNT 4 DOSbox: ; no floppy in drive --> AX := 0x1800 ; [BP:SI+4] == 0x0000 ; write protected floppy & file already exists ; --> AX := 0x98FF; [attr] == 0x8000 ; write protected floppy, but files does NOT exist ; --> AX := 0x1800; [attr] == 0x0000 ; Win98 plain: ; no floppy in drive --> AX := 0x1A00; [attr] == 0x08C2 ; write protected floppy -> AX := 0x1B00; [attr] == 0x08C2 ; FreeDOS build 2021: ; no floppy in drive --> AX := 0x3800; [attr] == 0x08C2 ; write protected floppy -> same as above ; FreeDOS build 2022: ; no floppy in drive --> AX := 0x3800; [attr] == 0x08C2 ; write protected floppy -> stalled quite some time, but NO CRITER! ; FreeDOS build 2023b [Mar 27 2001 21:51:20]: ; no floppy in drive --> AX := 0x3800; [attr] == 0x08C2 ; write protected floppy -> stalled quite some time, but NO CRITER! ; ; This handler does: ; 0) The current context is passed into this function within ES:BX ; The original ES & BX are restored by CRITER. ; 1) Probe for Autofail <-> return FAIL for all criterrs ; 2) Display error message: ; block devices: ; Error "reading from"|"writing to" drive ?: XXX area: error ; character devices: ; Error "reading from"|"writing to" device XXXXXXX: error ; 3) Display user action possebilities: ; (A)bort (I)gnore (R)etry (F)ail? _ ; 4) Get user input & return to DOS (via IRET) ; ; Fields of context used: ; offset 0, byte (boolean), autofail ; ; == What to do if neither I,R,nor F are allowed?? ; == Simply return?? ; ; Organization of the strings: ; + There may be upto 256 strings, numbered from 0 through N ; + The actual "error strings" must be the last ones and their ; order must be the same as the code in DI ; + All strings are packed together as follows: ; (N+1) words near pointer to character sequence of string #X ; character sequences of strings, no obvious order among them required ; This block is created by an external tool, like the messages for ; FreeCom itself and simply attached to the criterr handler code. ; + Within the code procedure ?oString maps BL -> near pointer (BX) ; and displays the associated character sequence with ?oBuffer ; + Special sequences: ; %% --> a single percent sign ; %# --> where '#' is a decimal digit --> insert string ; with number BYTE [?strarg#] ; %A --> where 'A' is a capital Latin letter --> insert ; the buffer at ?strargA ; ; Possible NLS hazards: ; + drive letter is created via "+ 'A'" ; + for robustness when displaying the driver's name, characters less ; than ' ' are ignored (usually control characters) ; ; $Log$ ; Revision 1.5 2004/09/13 18:59:39 skaus ; add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} ; ; Revision 1.4 2003/10/18 10:55:24 skaus ; bugfix: CRITERR: to use DOS API {Tom Ehlert/Bart Oldeman} ; ; Revision 1.3 2003/08/03 16:00:57 skaus ; bugfix: /F (AutoFail) for the XMS_Swap variant ; ; Revision 1.2 2002/04/02 18:09:31 skaus ; add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) ; ; Revision 1.1 2001/04/23 21:35:41 skaus ; Beta 7 changes (code split) ; ; Revision 1.1.2.3 2001/02/27 18:27:06 skaus ; fix: criter.asm: DEBUG does no longer compile to .COM (for consistency) ; chg: removed all NULLs to prevent NULL problematic, functions must be ; used fully prototyped now ; ; Revision 1.1.2.2 2001/02/18 17:59:36 skaus ; bugfix: KSSF: restore parentPSP on exit ; chg: Using STRINGS resource for all non-interactive messages ; chg: moving all assembly files to NASM ; ; Revision 1.1.2.1 2001/01/28 21:23:55 skaus ; add: Kernel Swap Support ; ; Revision 1.1.2.1.2.1 2000/12/17 21:57:36 skaus ; intermediate update 1 ; ;;; Settings for stand-alone variant %define COMPILE_STRINGS ;; always keep this enabled in this release!! %define INCLUDE_STRINGS ;; use STRINGS.INC instead of hard-coded strings ;; %define AUTO_FAIL ;; make the autofail variant of Criter %define HIDE_CRITER_DRIVES 26 ;; For how many drives hide-multiple is active ;; Version of this module MODULE_VERSION EQU 2 %include "../include/stuff.inc" %ifndef XMS_SWAP_CRITER %include "resource.inc" %endif ???start: %ifdef COMPILE_COM ORG 100h mov ax, cs mov ds, ax mov ax, 2524h mov dx, _lowlevel_err_handler int 21h ;; Trying to open a file on drive A: mov ax, 3d02h mov dx, dummy_file int 21h ;; Trying to copy stuff on PRN: mov bx, ax mov ah, 40h mov cx, 0ffffh mov dx, 0 int 21h mov ax, 4c00h int 21h int 20h dummy_file DB "a:\ux", 0 %ifndef COMPILE_STRINGS %define COMPILE_STRINGS %endif %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Real start ;; Join both modules into the same memory image in order to handle ;; them easier %ifndef XMS_SWAP_CRITER ;; Static context of KSwap support %include "context.def" %include "dmy_cbrk.asm" %endif ;; Low level Critical Error handler ;; Note: Both I/O functions should use the channel to read/write ;; the characters. In this case: the BIOS. ;; Sidenote: RBIL states that some BIOSes destroy the BP register. %macro printALtoConsole 0 call ?oChar %endmacro %macro readALfromConsole 0 mov ax, 0c07h ; clear buffer, read from STDIN one key without echo int 21h %endmacro LOCAL_BELL EQU 7 ;; Return values IGNORE EQU 0 RETRY EQU 1 ABORT EQU 2 FAIL EQU 3 ; bitmask of the "allowed action" flags CodeIgnore EQU 32 CodeRetry EQU 16 CodeFail EQU 8 ;; String numbers -- fixed order section ; 0 -> %1: write to ; 1 -> %1: read from StrBlockDevice EQU 2 StrCharDevice EQU 3 StrArea EQU 4 ; StrArea (area of failure) ; + 0 -> DOS ; + 1 -> FAT ; + 2 -> root ; + 3 -> data ; StrActionStrings 8 ; + 0 -> Ignore ; + 1 -> Retry ; + 2 -> Abort ; + 3 -> Fail StrIgnore EQU 8 StrRetry EQU 9 StrAbort EQU 10 StrFail EQU 11 StrQuestionMark EQU 12 StrDelimiter EQU 13 StrKeys EQU 14 ; enumerated valid input keys ; format: LK..KA..A ; L: BYTE number of K's (== number of A's) ; K: BYTE one keystroke ; A: BYTE one action code 0..3 (IRAF) ; a K's action code is located at the byte pointed to ; by the address of K plus L StrErrCodes EQU 15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; Entry point ; arguments: ; ES:BX == pointer to context, package int24 ; else: as normal INT-24 handler %ifdef XMS_SWAP_CRITER cglobal autofail_err_handler autofail_err_handler: mov al, FAIL iret %endif cglobal lowlevel_err_handler lowlevel_err_handler: %ifdef AUTO_FAIL ;; most simple <-> return AL := 3 mov al, FAIL iret %else push dx pushm es, ds, bp, si, di, cx, bx, ax mov cx, cs mov ds, cx ; DS := local code/data segment %ifdef DEBUG call ??dispAX %endif push ax ; save AH bit 7 and AL for later ;; free AL add al, 'A' ; AL may contain the drive number mov BYTE [??strargA], al ;; will be overwritten, if char device xor al, al mov BYTE [??strargA + 1], al ; end of string mov es, cx ; still shared local code/data segm shr ah, 1 ; Carry := 0-> read; 1->write adc al, al ; AL := 0-> read; 1->write mov BYTE [??strarg1], al mov al, ah and al, 3 ; AL := 0/1/2/3 -> DOS/FAT/root/data area add al, StrArea ; make it a string# mov BYTE [??strarg2], al ;; will be ignored if char device ;; ;; and al, (CodeIgnore or CodeRetry or CodeFail) / 2 ;; jz ONLY_ABORT_ALLOWED_AND_NOW?? ;; mov al, ah and al, CodeFail / 2 mov [??allowFail], al mov al, ah and al, CodeRetry / 2 mov [??allowRetry], al and ah, CodeIgnore / 2 mov [??allowIgnore], ah ;; AX is empty now %ifdef DEBUG push ds mov ax, bp mov ds, bp push si push di push cx mov cx, 8 mov di, ??_c add si, byte 10 ??__e: lodsb cmp al, 32 jnc ??__d mov al, 32 ??__d: stosb loop ??__e pop cx pop di pop si mov ax, [si+4] pop ds call ??dispAX mov bx, ??_d call ?oBuffer %endif %if 0 ;; No need when doing I/O through DOS mov ah, 0fh ; Get current video mode int 10h mov BYTE [??actPage], bh mov BYTE [??actColour], 255 %endif mov ax, di ; AL := lobyte(DI) -> error number add al, StrErrCodes mov BYTE [??strarg3], al mov bl, StrBlockDevice ; by default issue block device error pop ax ; AL := drive letter again shl ah, 1 ; get bit 7 --> carry flag jnc ?noCharDevice mov ds, bp ; is still segment of device driver test BYTE [si+5], 128 ; bit 7 == 1 if block device jz ?noCharDevice ; fetch the name of the character device mov cx, 8 ; max eight characters to display add si, byte 10 ; located at offset 10 mov di, ??strargA mov ah, ' ' cld ?drvNameGetLoop: lodsb cmp al, ah jnc ?charOK mov al, ah ?charOK: stosb loop ?drvNameGetLoop ;; Remove trailing whitespaces mov cx, 8 ; max eight characters to display mov al, ah std dec di ; stosb leaves DI behind the last written byte repe scasb mov BYTE [ES:di+2], ch ; place termination character mov cx, cs mov bl, StrCharDevice ; issue device driver message mov al, 0ffh ; AL := invalidate ?noCharDevice: cld ; forward direction mov ds, cx ; CX is still or again == CS push bx ;; Now many registers are available to use ;; Perform the repeat check; AL == -1 (char device), 0..31 if block mov bx, ?repCheck mov di, dummyByte ; Tha byte at [DI} will be decremented eventually inc WORD [BX] ; check if enabled jz ?noRepCheck ;; paranoid check to avoid memory overflow ;; also skips if char device cmp al, HIDE_CRITER_DRIVES ; 0..26 == A..Z jnc ?noRepCheck cbw ; AH := 0 add al, 2 ; correction as BX is two bytes below add ax, bx ; repCheckByte area mov di, ax inc BYTE [DI] ; will display the 1st and every 256th Criter jnz ?fail ; displayed already --> AutoFail && keep incremented [BX] ; NOTE: There is no output generated til now!! ; The output channels have not been touched ?noRepCheck: dec WORD [BX] ; keep the word at value -1 mov WORD [repCheckDecAddr], di ;; Try to find a suitable I/O channel mov ah, 62h ; Get PSP int 21h mov es, bx ;; mov cx, [ES:32h] ; number of entries in JFT les bx, [ES:34h] ; Pointer to JFT mov al, [es:bx+2] ; stderr ; patch STDIN & STDOUT to point to the found channel mov ah, al xchg WORD [ES:bx], ax mov WORD [?orgIOchannels], ax mov WORD [??repatchAddr], bx mov WORD [??repatchAddr+2], es pop bx mov es, cx ;; reset ES to the shared code/data segement call ?oString ; Display the Critical Error message string call ?newline mov bl, StrAbort call ?oString mov bl, 0 ; try Ignore call ?oAction mov bl, 1 ; try Retry call ?oAction mov bl, 3 ; try Fail call ?oAction mov bl, StrQuestionMark call ?oString jmp short ?inputLoop ?fail: pop bx ; correct the stack from repeat check mov bl, FAIL jmp short ?iret ; actually return ?inputError: mov al, LOCAL_BELL printALtoConsole ?inputLoop: ; Prepare to decode the character mov di, [StrKeys * 2 + 1 + ??strings] ; address of enumerated valid keys xor ax, ax mov al, [di] inc di mov cx, ax ; number of enumerated keys mov bx, ax readALfromConsole ;; special keys (AL == 0) are ignored ;; Decode user input repne scasb jne ?inputError ; key not found mov bl, [bx+di-1] ; action code (DI is one byte too far by SCASB) mov al, [bx+??allow] or al, al jz ?inputError ; not allowed ?errRet: ;; allowed action code in BL call ?newline ;; Restore the JFT les di, [??repatchAddr] mov ax, 1234h ?orgIOchannels EQU $-2 mov WORD [ES:di], ax ?iret: pop ax ; preserve AH mov al, bl ; action code cmp al, ABORT je ?iretNow cmp al, FAIL je ?iretNow ;; AutoFail is activated for ABORT and FAIL only ;; as user selected something else, reset the AutoFail state of the drive dec BYTE [1234h] repCheckDecAddr EQU $-2 ?iretNow: popm es, ds, bp, si, di, cx, bx pop dx iret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;; procedures ;; dump allowed action #AL ?oAction: mov bh, 0 or bh, [bx+??allow] jz ?oRet ; not allowed add bl, '5' ; local strarg code mov BYTE [??input+3], bl ; construct the temp output buffer mov bx, ??input jmp short ?oBuffer ;; dump string #BL onto screen ;; IN: BL = string number ;; OUT: BX destroyed ?oString: ;; make sure BL is within limit mov al, BYTE [??strings] cmp bl, al jc ?oS_idOK mov bl, al ?oS_idOK: mov bh, 0 add bx, bx mov bx, WORD [bx+??strings+1] jmp short ?oBuffer ;; dump character sequence pointed to by BX onto screen ;; IN: BX = address ;; OUT: BX destroyed ?oB_bufA: ;; Dump string argument A push bx mov bx, ??strargA call ?oBuffer jmp short ?oB_1 ?oB_special: inc bx mov al, [bx] or al, al je ?oRet cmp al, 'A' je ?oB_bufA cmp al, '1' jc ?oB_dump cmp al, '9' + 1 jnc ?oB_dump ;; display the numbered argument #AL push bx cbw mov bx, ax mov bl, [bx+??strarg1-'1'] call ?oString ?oB_1: pop bx jmp short ?oB_2 ?oB_loop: cmp al, '%' je ?oB_special ?oB_dump: printALtoConsole ?oB_2: inc bx ?oBuffer: mov al, BYTE [BX] or al, al jnz ?oB_loop ?oRet: ret ?newline: ;; Linefeed mov al, 10 printALtoConsole mov al, 13 ;; printALtoConsole ;; Dump character AL onto screen ;; IN: AL = character ?oChar: %if 0 ;; no need when doing I/O through DOS push bx mov bx, [??0Earg] mov ah, 0eh ; teletype output int 10h pop bx %else mov ah, 2 ; output to STDOUT mov dl, al int 21h %endif ret %ifdef DEBUG ??_a DB "AX == 0x" ??_b DB 1,2,3,4, 13, 10, 0 ??_d DB "Device name: >>" ??_c DB 1,2,3,4,5,6,7,8, '<<', 13, 10, 0 ??dispAX: push bx push ax mov bx, ??_b call ??AXtoBX mov bx, ??_a call ?oBuffer pop ax pop bx ret ??AXtoBX: push ax mov al, ah call ??ALtoBX pop ax ??ALtoBX: push ax shr al, 4 call ??NybbleToBX pop ax ??NybbleToBX: and al, 15 add al, '0' cmp al, '0' + 10 jc ??__c add al, 'A' - '0' - 10 ??__c: mov BYTE [bx], al inc bx ret %endif %if 0 ;; no need for I/O through DOS ??0Earg: ??actColour DB 7 ??actPage DB 0 %endif ??repatchAddr DD 0 ;?orgIOchannels DW 1234h ;; Numerical arguments ??strarg1 DB 0 ;; read/write ??strarg2 DB 0 ;; area failed on ??strarg3 DB 0 ;; error string ??strarg4 DB StrDelimiter ;; delimiter between two action strings ??strarg5 DB StrIgnore ??strarg6 DB StrRetry ??strarg7 DB StrAbort ??strarg8 DB StrFail ;; alphabetical arguments dummyByte: ;; This byte is destroyed, when no repeatCheck AutoFail is ;; active for the drive ??strargA DB '12345678', 0 ;; drive letter or device name string ;; The repeat check is: ;; _+ activated if ?repCheck != -1 ;; + the number of drives available to be checked is determined by ;; counting the number of 0xFF bytes the immediately after the module ;; got loaded into memory %ifdef XMS_SWAP_CRITER cglobal criter_repeat_checkarea criter_repeat_checkarea: %endif ?repCheck DW -1 ;; disabled TIMES HIDE_CRITER_DRIVES DB -1 ;; not displayed already ??allow: ??allowIgnore DB 0 ??allowRetry DB 0 ??allowAbort DB 1 ;; always allowed ??allowFail DB 0 ??input DB '%4%6', 0 ;; temporary storage %ifndef COMPILE_STRINGS ??strings: %else %ifdef INCLUDE_STRINGS %include "../strings/strings.err" %else ??strings DB 36 ;; number of strings ;; Here start all the strings! DW S0 DW S1 DW S2 DW S3 DW S4 DW S5 DW S6 DW S7 DW S8 DW S9 DW S10 DW S11 DW S12 DW S13 DW S14 DW S15 DW S16 DW S17 DW S18 DW S19 DW S20 DW S21 DW S22 DW S23 DW S24 DW S25 DW S26 DW S27 DW S28 DW S29 DW S30 DW S31 DW S32 DW S33 DW S34 DW S35 DW S36 S0 DB 'reading from', 0 S1 DB 'writing to', 0 S2 DB 'Error %1 drive %A: %2 area: %3', 0 S3 DB 'Error %1 device %A: %3', 0 S4 DB 'DOS', 0 S5 DB 'FAT', 0 S6 DB 'root', 0 S7 DB 'data', 0 S8 DB '(I)gnore', 0 S9 DB '(R)etry', 0 S10 DB '(A)bort', 0 S11 DB '(F)ail', 0 S12 DB '? ', 0 S13 DB ', ', 0 S14 DB 8, 'IiRrAaFf', 0, 0, 1, 1, 2, 2, 3, 3 S15 DB 'write-protection violation attempted', 0 S16 DB 'unknown unit for driver', 0 S17 DB 'drive not ready', 0 S18 DB 'unknown command given to driver', 0 S19 DB 'data error (bad CRC)', 0 S20 DB 'bad device driver request structure length', 0 S21 DB 'seek error', 0 S22 DB 'unknown media type', 0 S23 DB 'sector not found', 0 S24 DB 'printer out of paper', 0 S25 DB 'write fault', 0 S26 DB 'read fault', 0 S27 DB 'general failure', 0 S28 DB '(DOS 3.0+) sharing violation', 0 S29 DB '(DOS 3.0+) lock violation', 0 S30 DB 'invalid disk change', 0 S31 DB '(DOS 3.0+) FCB unavailable', 0 S32 DB '(DOS 3.0+) sharing buffer overflow', 0 S33 DB '(DOS 4.0+) code page mismatch', 0 S34 DB '(DOS 4.0+) out of input', 0 S35 DB '(DOS 4.0+) insufficient disk space', 0 S36 DB 'Unknown error code', 0 %endif ; INCLUDE_STRINGS %endif ; COMPILE_STRINGS %endif ; AUTO_FILE %ifndef NO_RESOURCE_BLOCK %ifndef AUTO_FAIL DW ?repCheck %endif %endif ???ende: %ifndef NO_RESOURCE_BLOCK ;; Include resource block %ifdef AUTO_FAIL resIdBlock RES_ID_CRITER, 0 %else %ifndef COMPILE_STRINGS resIdBlock RES_ID_CRITER, 1 %else resIdBlock RES_ID_CRITER, 3 %endif ; COMPILER_STRINGS %endif ; AUTO_FAIL %endif ; NO_RESOURCE_BLOCK ;;END ; Quote from RBIL ;--------D-24--------------------------------- ;INT 24 C - DOS 1+ - CRITICAL ERROR HANDLER ;Notes: invoked when a critical (usually hardware) error is encountered by DOS ; (see #02543); should never be called directly ; when DOS terminates a program, it copies the previous value of the ; INT 24 vector out of the PSP (see #01378) and into the interrupt ; vector table ;SeeAlso: INT 21/AH=95h ; ;(Table 02543) ;Values critical error handler is called with: ; AH = type and processing flags (see #02544) ; AL = drive number if AH bit 7 clear ; BP:SI -> device driver header (see #01646 at INT 21/AH=52h) ; (BP:[SI+4] bit 15 set if character device) ; DI low byte contains error code if AH bit 7 set (see #02545) ; STACK: DWORD return address for INT 24 call ; WORD flags pushed by INT 24 ; WORD original AX on entry to INT 21 ; WORD BX ; WORD CX ; WORD DX ; WORD SI ; WORD DI ; WORD BP ; WORD DS ; WORD ES ; DWORD return address for INT 21 call ; WORD flags pushed by INT 21 ;Return: AL = action code (see #02546) ; SS,SP,DS,ES,BX,CX,DX preserved ;Notes: the only DOS calls the handler may make are INT 21/AH=01h-0Ch,30h,59h ; if the handler returns to the application by popping the stack, DOS ; will be in an unstable state until the first call with AH > 0Ch ; for DOS 3.1+, IGNORE (AL=00h) is turned into FAIL (AL=03h) on network ; critical errors ; if IGNORE specified but not allowed, it is turned into FAIL ; if RETRY specified but not allowed, it is turned into FAIL ; if FAIL specified but not allowed, it is turned into ABORT ; (DOS 3.0+) if a critical error occurs inside the critical error ; handler, the DOS call is automatically failed (AL set to 03h and ; the INT 24 call skipped) ; ;Bitfields for critical error type and processing flags: ;Bit(s) Description (Table 02544) ; 7 clear = disk I/O error ; set = -- if block device, bad FAT image in memory ; -- if char device, error code in DI ; 6 unused ; 5 Ignore allowed (DOS 3.0+) ; 4 Retry allowed (DOS 3.0+) ; 3 Fail allowed (DOS 3.0+) ; 2-1 disk area of error ; 00 = DOS area 01 = FAT ; 10 = root dir 11 = data area ; 0 set if write, clear if read ;SeeAlso: #02545,#02546 ; ;(Table 02545) ;Values for critical error code: ; 00h write-protection violation attempted ; 01h unknown unit for driver ; 02h drive not ready ; 03h unknown command given to driver ; 04h data error (bad CRC) ; 05h bad device driver request structure length ; 06h seek error ; 07h unknown media type ; 08h sector not found ; 09h printer out of paper ; 0Ah write fault ; 0Bh read fault ; 0Ch general failure ; 0Dh (DOS 3.0+) sharing violation ; 0Eh (DOS 3.0+) lock violation ; 0Fh invalid disk change ; 10h (DOS 3.0+) FCB unavailable ; 11h (DOS 3.0+) sharing buffer overflow ; 12h (DOS 4.0+) code page mismatch ; 13h (DOS 4.0+) out of input ; 14h (DOS 4.0+) insufficient disk space ;SeeAlso: #02544,#02546 ; ;(Table 02546) ;Values for critical error handler action code: ; 00h ignore error and continue processing request ; 01h retry operation ; 02h terminate program as though INT 21/AH=4Ch called (INT 20h for DOS 1.x) ; 03h fail system call in progress (DOS 3+) ;SeeAlso: #02544,#02546 ; ;~ ================================================ FILE: criter/criter.txt ================================================ Critical Error & Dummy ^Break handler & Kernel Swap Context Compile: nasm -f bin criter.asm Result is CRITER, the memory image which must be installed permanently into memory. Entry offsets: Performed actions: The Dummy ^Break handler simply returns "Terminate", hence its name. It is assumed that this handler gets activated only, if FreeCOM is NOT active itself -> ergo, FreeCOM must install its own Ctrl-Break handler. The Criter handler displays the known menu Abort/Retry/Ignore/Fail. The handler does NOT pop to the program directly, but returns to the caller, usually the DOS kernel. Useage: 1) allocate a block of memory (--> segm) 2) invalidate owner's ID of segm 3) store the compiled CRITER module into segm 4) interrupt vector 0x24 := MK_FP(segm, *(word far*)MK_FP(segm, 0)) 5) interrupt vector 0x23 := MK_FP(segm, 2) *) Module needs not be patched/updated in any way. It's standalone. Tested: + with MS DOS 6 + compiled: NASM -f bin -o criter.com -DDEBUG=1 criter.asm + ran: .\criter.com --> 1x fault because of non-responding drive A: --> 1x fault because of non-responding character device AUX: (see DEBUG switch within criter.asm) ================================================ FILE: criter/dmy_cbrk.asm ================================================ ; $Id$ ; ; Dummy ^Break signal catcher -- module ; Aborts any program <-> Activated only if FreeCOM is not active ; Full relocable ; ; On return the caller must return to DOS the following way: ; if(Carry) retf <-- Terminate ; if(!Carry) retf 2 <-- Proceed / Ignore ^Break ; ; $Log$ ; Revision 1.2 2002/04/02 18:09:31 skaus ; add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) ; ; Revision 1.1 2001/04/23 21:35:41 skaus ; Beta 7 changes (code split) ; ; Revision 1.1.2.1 2001/01/28 21:23:55 skaus ; add: Kernel Swap Support ; stc ;; tell DOS to terminate the program retf ;; no IRET! ================================================ FILE: criter/files.txt ================================================ Implementation of the Criter, Dummy CBreak and Context module This implementation is a spin-off of two other on-going implementations: + KSS - Kernel Swap Support, which is included in this release,& + modules - which is available on CVS by tag expSpawn. CONTEXT.X Shared context between C and Assembly criter.asm Combined Criter, dummy CBreak and Context modules dmy_cbrk.asm Dummy CBreak hamdler RESOURCE.ID Resource IDs understood by this implementation RESOURCE.INC Resource block understood by this implementation ================================================ FILE: criter/makefile ================================================ # $Id$ # # Makefile for the FreeCOM CRITER module # # $Log$ # Revision 1.2 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.1 2001/04/23 21:35:41 skaus # Beta 7 changes (code split) # # Revision 1.1.2.2 2001/02/27 18:27:06 skaus # fix: criter.asm: DEBUG does no longer compile to .COM (for consistency) # chg: removed all NULLs to prevent NULL problematic, functions must be # used fully prototyped now # # Revision 1.1.2.1 2001/02/18 18:09:55 skaus # intermediate update #3 # .IMPORT : FREEDOS INCDIR +=;$(FREEDOS)\SRC\INCLUDE LIBDIR +=;$(FREEDOS)\SRC\LIB\$(_COMPILER) LDLIBS = suppl_$(_MODEL).lib LDFLAGS += /msl NASM *= c:\TOOL\NASMW.EXE ##LD_TLINK != D:\BC5\BIN\TLINK.EXE # Project specific C compiler flags MYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1) MYCFLAGS_NDBG = MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG)) # Project specific NASM compiler flags NASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s NASMFLAGS_NDBG = -s NASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG)) # Sources of this make target SRC = # Default target all: criter criter1 context.def dist : ; .INIT .PHONY .SEQUENTIAL : $(CFG) __errl __errl: @+-if exist errlist del errlist >nul # -ctags *.c criter.asm : context.def dmy_cbrk.asm ../include/stuff.inc resource.inc ../strings/strings.err criter : criter.asm $(NASM) $(NASMFLAGS) -f bin -o $@ $< >>errlist criter1 : criter.asm $(NASM) $(NASMFLAGS) -DAUTO_FAIL -f bin -o $@ $< >>errlist context.def context.h_c .UPDATEALL : context.x ..\utils\mkctxt.exe $< +copy context.h_c .. +copy context.inc .. #MAKEDEP START #MAKEDEP STOP clobber : clean $(RM) $(RMFLAGS) *.com *.cln criter criter1 *.cfg clean : $(RM) $(RMFLAGS) *.obj *.bak context.h_c context.def context.inc ..\context.h_c ..\context.inc tags errlist strings.inc ================================================ FILE: criter/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak TOP = .. !include "$(TOP)/config.mak" all: context.def criter criter1 context.def : context.x ..$(DIRSEP)utils$(DIRSEP)mkctxt.exe context $(CP) context.h_c .. $(CP) context.inc .. criter : criter.asm dmy_cbrk.asm ../include/stuff.inc context.def $(NASM) $(NASMFLAGS) -f bin -o criter criter.asm criter1 : criter.asm dmy_cbrk.asm ../include/stuff.inc context.def $(NASM) $(NASMFLAGS) -DAUTO_FAIL -f bin -o criter1 criter.asm ================================================ FILE: criter/resource.id ================================================ RES_ID_NONE EQU -32766 RES_ID_ANY EQU -32767 RES_ID_STRINGS EQU 0 RES_ID_CRITER EQU 1 RES_ID_CBREAK EQU 2 RES_ID_RESPAWNER EQU 3 ================================================ FILE: criter/resource.inc ================================================ %include "resource.id" %macro resIdBlock 1-2 -1 dd ???ende - ???start ;; Length of this resource dw %1 ;; major resource ID dw %2 ;; minor resource ID db 'FREECOM ' ;; cookie %endmacro ================================================ FILE: docs/HELP.EN ================================================ FreeCom 0.85 (Note: some features and commands are optional) List of commands and features of FreeCOM: * ALIAS - Display or change an alias <#alias> * BEEP - Issue a Beep <#beep> * BREAK - Display or Set Extended Break Checking <#break> * CALL - Call a Nested Batchfile or Program <#call> * CANCEL - Terminate all scripts <#cancel> * CD - Change current directory of a drive <#cd> * CDD - Changes the current working directory <#cdd> * CHDIR - Change current directory of a drive <#chdir> * CLS - Clear screen <#cls> * COPY - Copy one or more files to another location <#copy> * CTTY - Change TTY (console) <#ctty> * DATE - Display or set current date <#date> * DEL - Delete files <#del> * DIR - Displays the contents of the directory <#dir> * DIRS - Display the directory stack <#dirs> * ECHO - Displays a string onto screen <#echo> * ENVIRONMENT_KEEP_FREE - keep free space in environment segment <#environment_keep_free> * ERASE - Delete files <#erase> * EXIT - Terminate shell <#exit> * FEATURE_ALIASES - Command aliases <#feature_aliases> * FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor <#feature_auto_redirect_to_con> * FEATURE_BATCH - Batch script processing <#feature_batch> * FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present <#feature_boot_keys> * FEATURE_CALL_LOGGING - Startup logging <#feature_call_logging> * FEATURE_DIRSTACK - Directory stack <#feature_dirstack> * FEATURE_ENHANCED_INPUT - Enhanced command line editing <#feature_enhanced_input> * FEATURE_FILENAME_COMPLETION - Filename completion <#feature_filename_completion> * FEATURE_HISTORY - Command line history <#feature_history> * FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE) <#feature_installable_commands> * FEATURE_LAST_DIR - Change back to last directory <#feature_last_dir> * FEATURE_LOAD_MESSAGES - Load messages permanently <#feature_load_messages> * FEATURE_NLS - use DOS NLS <#feature_nls> * FOR - Repeat a command <#for> * GOTO - Goto label <#goto> * HISTORY - Display command line history <#history> * IF - Conditional execution of a command <#if> * LOADFIX - Load an external program above the first 64KB memory <#loadfix> * LOADHIGH - Load an external program into high memory <#loadhigh> * MD - make directory <#md> * MEMORY - Display the internally used memory <#memory> * MKDIR - Make directory <#mkdir> * PATH - Display or set the search path <#path> * PAUSE - Pauses batch file execution <#pause> * POPD - Change back to the last pushed directory <#popd> * PROMPT - Display or set the shell prompt <#prompt> * PUSHD - Push the current working directory onto the directory stack <#pushd> * QUIT - Terminate the current script <#quit> * RD - Remove directory <#rd> * REM - Marks comments or remarks in batchfiles <#rem> * REN - Rename files <#ren> * RENAME - Rename files <#rename> * RMDIR - Remove directory <#rmdir> * SET - Display or set environment variables <#set> * SHIFT - Shift the arguments of a batch script <#shift> * TIME - Display or set current time <#time> * TRUENAME - Display the true name of a file <#truename> * TYPE - Display the contents of files <#type> * VER - Display the version information about FreeCOM and DOS <#ver> * VERIFY - Display or set verify level <#verify> * VOL - Display the volume label of a drive <#vol> * WHICH - Search and display the executable file of specified commands <#which> ------------------------------------------------------------------------ ALIAS - Display or change an alias Requirements: FEATURE_ALIASES <#feature_aliases> Synopsis 1. ALIAS 2. ALIAS /name/ '=' *[* string *]* The first format without any argument displays all defined aliases. The second format assigns the specified /string/ to the alias with the specified /name/. If the /string/ is empty, the named alias is removed. Once an aliase is defined, a command line of the form: name { argument } is replaced by: <> { argument } This mechanism is called /alias expansion/, because the alias /name/ expands to the specified string. To prevent alias expansion the command must be prefixed by one asterisk, e.g.: *name arguments Examples Example: 1 ALIAS <#alias> dir=dir /w dir displays short directory listing from now on. Example: 2 ALIAS <#alias> displays all currently defined aliases, e.g.: DIR <#dir>=dir /w in this case. Example: 3 ALIAS <#alias> dir= removes the previously defined alias dir, thus, DIR <#dir> displays the long output as by default again. ------------------------------------------------------------------------ FEATURE_ALIASES - Command aliases See also: ALIAS <#alias> If defined on compilation of FreeCOM, command aliases are supported. New aliases are _defined_ using the command: ALIAS /name/ '=' string Aliases are _removed_ using the command: ALIAS /name/ '=' When FreeCOM is interpreting a command line, the command -- the very first word -- is matched against all defined aliases. This word is separated from its arguments by whitespaces and cannot contain any path delimiters, such as backslashes or colons. If the command matches an alias, the name is _substituted_ by the stringassociated to the aliases, e.g. by defining the alias ls by: ALIAS <#alias> ls=dir /w/o let FreeCOM interprete the command line: C> ls /a exactly as if one had typed in: C> dir /w/o /a To _prevent_ the alias expansion an asterisk is prefixed before the command, e.g.: C> *ls /a really tries to execute the command: ls /a which usually is an external command. Aliases may be used to _hide or re-place internal commands_, e.g.: ALIAS <#alias> dir=xdir effectively hides the internal command DIR <#dir> and will always execute the -- usually -- external command XDIR. Aliases _may be nested_, so if both alias definitions mentioned above are in place, the command: C> ls /a is really executed as: xdir /w/o /a where the ls command is substituted by the command dir /w/o, then dir is detected as alias, too, and hence replaced by xdir. The same alias is _never substituted twice_, neither directly nor transitively, so: ALIAS <#alias> dir=dir /w is allowed as well as: ALIAS <#alias> ls=dir /w/o ALIAS <#alias> dir=ls -l command results in ls ls -l /w/o dir dir /w/o -l As implied above, aliases are expanded when needed and /not/ when they are defined. Aliases are storred _for each instance of FreeCOM individually_ and are inherited by secondary instances from the parent. Options Compile-time options: * ALIAS_DEFAULT_SIZE: The size reserved for all aliases per FreeCOM instance. Default: 1024 ------------------------------------------------------------------------ BEEP - Issue a Beep Requirements: CMD_BEEP Synopsis BEEP Issues a beep. At this time FreeCOM supports audible beeps only. ------------------------------------------------------------------------ BREAK - Display or Set Extended Break Checking Requirements: CMD_BREAK Synopsis BREAK *[* ON | OFF *]* Displays or sets the Extended Break status. By pressing ^Break or ^C (Control-Break or Control-C) an user may signal the currently running program to halt. Most programs will abort to the prompt, but some may decide to just cancel the current action, but remain active. DOS checks for ^Break/^C (Control-Break or Crontrol-C) each time a program issues a console input/output request. When Extended Break checking is enabled (/ON/), DOS checks for ^Break each time a program issues a request. ------------------------------------------------------------------------ CALL - Call a Nested Batchfile or Program See also: LOADFIX <#loadfix>, LOADHIGH <#loadhigh> Optional requirements: FEATURE_KERNEL_SWAP_SHELL Synopsis 1. CALL *[/Y]* /program/ *[* arguments *]* 2. CALL *[/Y]* *[* */S* | */N* *]* /program/ *[* arguments *]* Calls a program or batch script. If the /program/ is a batch script <#_appendix_batch>, that means it has the extension .BAT, CALL <#call> nests the batch script within the already running one. Without CALL <#call> the invoked batch script would terminate all already running batch scripts. If present, the arguments are passed unchanged to the invoked program. Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. * */S*: If /program/ is not a batch script, the external program is executed by swapping FreeCOM out of memory. This process will require more time, especially if FreeCOM is to be reloaded from a floppy, some internal settings are lost, e.g. command line history, but it will free as much memory as possible for the external program. This option and, thereby, this function is available only, if FreeCOM had been compiled with some support for swapping. * */N*: If /program/ is not a batch script, the external program is executed directly, with swapping disabled. */N* superceeds */S*. * */Y*: Enables tracemode during execution of the command. Note: In the future to swap FreeCOM out of memory during the execution of an external program will be the default behaviour. ------------------------------------------------------------------------ CANCEL - Terminate all scripts Synopsis CANCEL *[* /n/ *]* Terminates all currently active batch scripts and, if present, assigns the specified number /n/ to the errorlevel. /Note/: This command is a hidden internal command <#_appendix_hicmd>. ------------------------------------------------------------------------ CD - Change current directory of a drive See also: CDD <#cdd>, CHDIR <#chdir>, DIR <#dir>, DIRS <#dirs>, MD <#md>, PUSHD <#pushd>, RD <#rd> Requirements: CMD_CHDIR Optional requirements: FEATURE_LAST_DIR <#feature_last_dir> Synopsis 1. CD 2. CD *[* /drive/ ':' *]* /path/ 3. CD '-' CD <#cd> is 100% compatible with the CHDIR <#chdir> command; there is no difference -- beside the spelling -- between them. The first variant shows the current working directory <#_appendix_cwd> as absolute path. The second variant changes the current directory <#_appendix_currdir> of the given drive. If no drive is specified on command line, the current directory of the currently selected drive (disk) <#chgdrive> is changed. This command does *not* change the currently selected drive in opposite to CDD <#cdd>! The third variant changes back into the last visited directory *and* drive. The commands CD <#cd>, CHDIR <#chdir>, CDD <#cdd>, and PUSHD <#pushd> save the current working directory before performing the specified directory change; the command CD <#cd> '-' restores this saved directory. This command is available only, if the feature LAST_DIR has been enabled during the compilation of FreeCOM. Options There are no options for this command. Examples Example: 1 CD <#cd> \freedos\help Changes the current working directory of the currently selected drive to the path \FREEDOS\HELP. Example: 2 CD <#cd> c:\freedos\help Changes the current directory of drive C:. Example: 3 Assuming the current working directory is \FREEDOS\HELP and the currently selected drive is C:. CD <#cd> Displays C:\FREEDOS\HELP Example: 3 The command sequence, provided the first two worked successfully: CD <#cd> \FREEDOS\HELP CD <#cd> .. CD <#cd> - changes first into the directory \FREEDOS\HELP, then into its parent directory, which is \FREECOM. And finally CD <#cd> - changes back to \FREEDOS\HELP, because this was the previous directory before previous CD <#cd>-like command. Because CD <#cd> - saves the previous directory, too, any subsequent: CD <#cd> - will switch between these two directories; until another directory is changed to. ------------------------------------------------------------------------ CDD - Changes the current working directory See also: CD <#cd>, DIR <#dir>, MD <#md>, PUSHD <#pushd>, RD <#rd> Requirements: CMD_CDD Synopsis 1. CDD 2. CDD *[* /drive/ ':' *]* /path/ 3. CDD '-' The behaviour of CDD <#cdd> is similiar to the CD <#cd> command, but it always changes both the currently selected drive and the current directory, thus, it changes the current working directory. For further details please see the CD <#cd> command. ------------------------------------------------------------------------ CHDIR - Change current directory of a drive This command is 100% compatible to CD <#cd>, please see there ------------------------------------------------------------------------ CLS - Clear screen See also: ECHO <#echo>, TYPE <#type> Requirements: CMD_CLS Synopsis CLS Clears the screen and resets the character colours to white on black. ------------------------------------------------------------------------ COPY - Copy one or more files to another location See also: DEL <#del>, REN <#ren> Requirements: CMD_COPY Synopsis 1. COPY *[{* /option/ *}]* /source/ *[{* /option/ *}]* /target/ *[{* /option/ *}]* Copies the source file into the target file. See also: \REF{wildcards} Before parsing its command line COPY <#copy> parses any /option/ specified by the environment variable *COPYCMD*. Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. * */A* see below * */B*: Specifies the mode, in which the file is copied, */A* forces ASCII and */B* forces binary mode. These options do alter the mode of the file immediately preceeding them and all following ones, until changed again. In binary mode the file is copied and nothing is changed at all. In ASCII mode COPY <#copy> takes special care about linefeeds / newline characters and the end-of-line character. o On read, the newline characters, which are a sequence of two different bytes in DOS, are transformed into a single character, as known from Unix-style systems. On write, this single character is transformed into the two-byte sequence. So, if both files are copied with different modes, newline characters are transformed into either way. o If the end-of-file character is found on read, the remaining contents of the file is ignored. On write, such character is appended after the last character has been written. By default, files are copied in binary mode, whereas devices, e.g. CON:, are copied in ASCII mode, but no end-of-file is appended. Arguments * /source/: The source file. If more than one source file is specified, the target must be a directory. * /target/: The target of the COPY <#copy> process. If target is a directory, the destination file is placed into this directory, but with the same filename as the source file. If exactly one source is specified, but no target, target defaults to just ., which represant the current directory. ------------------------------------------------------------------------ CTTY - Change TTY (console) Requirements: CMD_CTTY Synopsis CTTY /device/ With this command the console device can be changed. A console device performs all basic input and output operations. This change is more complete than IO-redirections <#_appendix_redirection>, because latter one might not catch all output, for instance the error messages. See example 3 below. Because the console is a bidirectional virtual device, meaning it is to perform input *and* output, the specified /device/ must not a unidirectional device, such as PRN. To specify a second argument on the command line of FreeCOM has the same effect. *Attention*: This command is to effect the whole system, not only FreeCOM itself; so the effect of CTTY <#ctty> does not only depend on the implementation status of FreeCOM, but on the DOS kernel, too. Also, some programs access the screen or keyboard directly, rather than using the DOS functions; these programs are *not* effected by CTTY <#ctty>. Examples Example: 1 CTTY <#ctty> aux Changes the console to the /AUX:/ device, which is usually the first serial communication port COM1:. If this line is connected to a terminal or a terminal emulator, the system can be controlled from the terminal by now. Example: 2 CTTY <#ctty> nul any command sequence CTTY <#ctty> con The first command discards any output. If a program attempts any input operation, it gets none. Some programs may not handle such situation correctly. So, any output, even error messages, are discarded during the command sequence. The second command changes the console back to the screen/keyboard pair. To display a string onto screen or read from keybord the usual I/O-redirections <#_appendix_redirection> may be used, for instance: * ECHO <#echo> This line appears on the screen >CON * PAUSE <#pause> command will get its input even within the "CTTY <#ctty> nul" environment. ------------------------------------------------------------------------ DATE - Display or set current date See also: TIME <#time> Requirements: CMD_DATE Synopsis 1. DATE *[* */D* *]* 2. DATE *[* */D* *]* /date/ The first variant displays the current system date, then enters a loop prompting the user for a new date. The loop terminates, if the user entered a valid new date or just pressed the ENTER key. The second variant does not display the current date and tries to change the date to the specified /date/. On success the command terminates, otherwise enters the loop explained above. The individual portions of a date may be separated by at least: dots ., forward slashes / or dashes -. Other nationally used characters may be supported, too. DATE <#date> will support partial formats: * A /single numnber/: specifies the day only. * /Two numbers/: specifies the day and the month in the order used by the national date format, which is MM/DD for American and Japanese and DD/MM for European format. * /Three numbers/: specifies a full date including day, month and year in the order suitable for the national date format, which is: o MM/DD/[CC]YY: for American, o DD/MM/[CC]YY: for European and o [CC]YY/MM/DD: for Japanese format. If the year portion is less than 100, the century is assumed to be 1900, if it is greater or equal than 80; otherwise the century is 2000. /Note/: Some European countries introduced the so-called business date in 1996 or so, which is the same as the Japanese format; it makes sorting of literal dates a lot easier. If FreeCOM will or will not support it, will depend on the NLS used by DOS. Symbolical names of monthes are not support (yet). Options All options must precced any argument. */D* prevents from prompting the user. 1. In variant 1, the date is displayed only. 2. In variant 2, the date is tried to be changed, but the loop is not entered on failure. Examples Example: 1 DATE <#date> /D Just display the current system date. Example: 3 DATE <#date> 2/1/00 Sets the current date to 1st February of 2000. ------------------------------------------------------------------------ DEL - Delete files See also: DIR <#dir> Requirements: CMD_DELETE Synopsis DEL *[{* /options/ | /pattern/ *}]* Deletes files, if /pattern/ matches a directory, all files within this directory are deleted. When all files are to be deleted, a warning prompt is issued. Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. * */P*: Prompts the user before delete a file. * */V*: Displays, which files are deleted. Examples Example: 1 DEL <#del> FILE1.EXT FILE2.EXT Deletes the files FILE1.EXT and FILE2.EXT. Example: 2 DEL <#del> /P *.bak Deletes all files with extension BAK, but prompts the user for each single file before deleting it. Example: 3 DEL <#del>. Deletes all files within the current directory. ------------------------------------------------------------------------ DIR - Displays the contents of the directory See also: CHDIR <#chdir>, MKDIR <#mkdir>, RMDIR <#rmdir> Requirements: CMD_DIR Synopsis DIR *[{* /options/ | /pattern/ *}]* DIR <#dir> displays the contents of direcories and/or the attributes of files, whatever the /pattern/ specifies. If no /pattern/ is specified on command line, the current working directory is displayed. The actual information displayed depends on the specified options and is explained below. A /pattern/ may contain wildcards <#_appendix_wildcards>, which are expanded against both files and directories. To specify a directory is essentially equal to write: directory\*.*. Unlike options patterns are performed in sequence, that means that if two patterns are specified, first all entries matching the first one, then all entries matching the second one are displayed; instead of to display the matching entries intermixed. Before parsing its command line DIR <#dir> parses any /option/ specified by the environment variable *DIRCMD*. Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. * */A*: (All) Wildcards are matched against System and Hidden files, too. * */A***: (Attribute) Wildcards are matched against files with selected attributes set or clear. The argument of the */A* option is a sequence of: o *?* meaning: attribute *?* must be set, or o *-?* meaning: attribute *?* must not be set. The following attributes, the *?* above, are supported: o *R* for: read-only, o *H* for: hidden, o *S* for: system, o *D* for: directory, and o *A* for: archive. If the same attribute is specified twice within the same */A* option, the last one superceeds previous ones; if more than one */A* option is specified, the last one superceeds all previous ones. * */B*: (Bare) Displays the lines with the information of files and directories only. The ones displaying the volume label, the serial number, totals etc. are suppressed. In combination with */S* the absolute path of the files is displayed. * */L*: (Lower-case) Filenames are displayed in lower-case letters rather than capitol ones. * */O*: (Order default) is a synonym of */ONG*. * */O***: (Order) Sort the entries displayed in a specific order. The following sort orders are supported: o *D* sort by last modification *d*ate (earliest first) o *E* sort by file *e*xtension o *G* *g*roup directories first o *N* sort by file *n*ame o *S* sort by size (smallest first) o *U* do not sort (*u*nsorted) Each sort order, except *U*, may be prefixed by a hyphen to reverse the sort order. *U* effectively cancels any previous setting or specified sort order, e.g. to override an */O* option from the *DIRCMD* environment variable. If the same sort order is specified twice within the same */O* option, the last one superceeds previous ones; if more than one */O* option is specified, the last one superceeds all previous ones. *Warning*: The entries are cached within memory before displaying them; if FreeCOM runs short on memory, to sort is disabled completely or the entries are sorted in chunks only. * */P*: (Page) Page the output -- pause the display after issuing one screen-full. * */S*: (Subdirectories) Recursively display directories. * */W*: (Wide) Displays five filenames per line and suppress the information about the file size, date etc. * */Y*: (Year) Displays a 4-digit year, rather than just two digits. * */4*: (4digit Year) is a synonym of */Y*. Examples Example: 1 DIR <#dir> Displays the contents of the current directory, but ignore System and Hidden files. The output may look like this: !!todo!! Example: 2 DIR <#dir> a* bb* *.txt First displays all files, that begin with the letter A; then all files, that begin with two letters B, are displayed and at last all files with the extension TXT. Example: 3 DIR <#dir> /w a* b* DIR <#dir> a* /w b* DIR <#dir> a* b* /w Because the position of options is not significant, all these examples behave the same way and display the matching files in /wide/ or also called /short/ form, which may look like this: !!todo!! ------------------------------------------------------------------------ DIRS - Display the directory stack See also: CD <#cd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd> Requirements: CMD_DIRS Synopsis DIRS Displays all directories stacked with the PUSHD <#pushd> command. ------------------------------------------------------------------------ ECHO - Displays a string onto screen See also: TYPE <#type> Requirements: CMD_ECHO Synopsis 1. ECHO *[* ON | OFF *]* 2. ECHO string 3. ECHO. When executing a batch script each line is displayed to the console before executing it by default. The first variant of ECHO <#echo> enables or disables this behaviour. To disable echoing the commands is equal to prefix each line of a batch script with the Ad-symbol @. If ECHO <#echo> is invoked with no argument at all, the current echo status is displayed. When entered on an interactive command line the echo status controls whether or not the PROMPT <#prompt> string is displayed. The second variant displays the specified string. Note: Because of variant 1 string may not expand to the single words ON or OFF without another character. The third variant displays an empty line. No space must be placed between the dot and ECHO <#echo>. Examples Example: 1 ECHO <#echo> Displays the current echo status, e.g. responding: ECHO <#echo> is on Example: 2 @ECHO <#echo> OFF Disables the echo status. Because the Ad-sign @ disables the echo status right for this line, this command disable echoing all the next lines of a batch script and is not echoed to the console itself. It is, therefore, best placed in the first line of a batch script. Example: 3 ECHO <#echo> Just a text Displays Just a text ------------------------------------------------------------------------ FEATURE_ENHANCED_INPUT - Enhanced command line editing See also: FEATURE_FILENAME_COMPLETION <#feature_filename_completion>, FEATURE_HISTORY <#feature_history> If enabled on compilation of FreeCOM, enhanced command line editing features are activated. Otherwise, FreeCOM uses the default buffered input DOS API function #0A. If this feature is disabled, neither command line history nor filename completion is available. Besides the other features various key bindings recognized, which are listed in the general FreeCOM documentation. ------------------------------------------------------------------------ ERASE - Delete files This command is 100% compatible to DEL <#del>, please see there ------------------------------------------------------------------------ EXIT - Terminate shell Synopsis EXIT Terminates the currently running shell, unless FreeCOM had been started with the */P* option. In this case, EXIT <#exit> works like CANCEL <#cancel>. ------------------------------------------------------------------------ FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor If defined on compilation of FreeCOM and if FreeCOM is to terminate although it is forbidden -- e.g. by passing the */P* option when executing FreeCOM --, the console is changed to the keyboard/monitor pair automatically after some insuccessful prompts to reboot the system. Options Compile-time options: * FEATURE_AUTO_REDIRECT_TO_CON <#feature_auto_redirect_to_con>: How many loops may pass before switching the console CON: to the monitor. Default: 5. ------------------------------------------------------------------------ FEATURE_BATCH - Batch script processing Requirements: IMPLICIT The batch script processing is always enabled. Options Compile-time options: * BATCH_NESTLEVEL_MIN: Minimal supported batch nesting level. Default: 5 ------------------------------------------------------------------------ ENVIRONMENT_KEEP_FREE - keep free space in environment segment If defined on compilation of FreeCOM, FreeCOM tries to keep the unused space in the environment segment equal to or greater than ENVIRONMENT_KEEP_FREE <#environment_keep_free>. The default value is 256. ------------------------------------------------------------------------ FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present If defined on compilation of FreeCOM, FreeCOM waits three seconds on startup, if the */P* switch is present. If during this time a key has been pressed, |F5| will bypass AUTOEXEC.BAT execution and |F8| will enable trace mode. |F5| is equal to to pass the */D* switch to FreeCOM. |F8| is equal to to pass the */Y* switch to FreeCOM. ------------------------------------------------------------------------ FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE) If defined on compilation of FreeCOM, calls to the Installable Commands API are made before executing any command. The API is situated at MUX-AE, the Multiplexer interrupt 0x2F function 0xAE. The interface is documented elsewhere, for instance RBIL (Ralph Brown's interrupt list). ------------------------------------------------------------------------ FEATURE_NLS - use DOS NLS If defined on compilation of FreeCOM, FreeCOM uses the information retrievable by the currently active DOS NLS using the API functions #65. These information influence: * the format displaying time and date information, * the characters to delimit items in lists, * the currency string and display format, * how to up- (and supported by some NLS only) to lower-case characters, * how to sort characters. ------------------------------------------------------------------------ FEATURE_CALL_LOGGING - Startup logging If defined on compilation of FreeCOM, all startups of a FreeCOM instance is logged into a file. The drive the logfile is created on can be changed at run-time with the external tool PTCHLDRV. Options Compile-time options: * LOG_FILE: The name of the logfile. Default: C:\FreeCom.log ------------------------------------------------------------------------ FEATURE_FILENAME_COMPLETION - Filename completion Requirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input> If defined on compilation of FreeCOM and if the enhanced command line editing is activated as well, the tabulatur key binding becomes available. When the tabulator key is pressed, the word the cursor is located on actually or is immediately preceeding is separated and tried to match against files, like a DIR <#dir> command would do, e.g. when hitting tab at the command line: bar\f_ some arguments -- where the underscore _ is to mark the location of the cursor and is /no/ actual character -- causes FreeCOM to try to locate any files or directories matching the filename pattern bar\f*.*. If none is found, a beep is issued to indicate that error and the command line remains unchanged. Otherwise as many characters are appended to the filename as are the same for all found matches, e.g.: 1. if exactly one match was found, its name is appened. 2. if, for example, the files or directories: FOO, FUU.TXT or FUU are present in the directory BAR, no character is appened, because there are no equal characters following the already present f character. 3. if, for example, the files or directories: FOO, FOO.TXT or FOO1.TXT are present in the directory BAR, the two characters OO are appened, because all found matches share these two characters immediately following the already present characers. Hence, the command line is expanded to: bar\FOO_ some arguments Please note that the case of all characters will match the case of the retrieved filenames. In addition, because in the cases 2 and 3 the file completion was not complete because more than one match was found, a beep is issued. In this situation to hit the tabulator key a second time, without an intervueing other key press, causes to display all available matches, but keeps the command line unchanged otherwise. If exactly one filename match was found, hence the file completion was complete, and if the found match is a directory, a backslash is appended to. This allows to walk into deep levels of directories speededly. If the cursor had been placed, for instance, under the backslash in above mentioned command line, the full string bar\f had been tried to be completed as well. This behaviour differs from other implementations. Options Compile-time options: * FILE_SEARCH_MODE: Filemode passed to the DOS API to aquire matching directory entries. Default: Read-Only, Archive, Directory ------------------------------------------------------------------------ FEATURE_DIRSTACK - Directory stack See also: DIRS <#dirs>, POPD <#popd>, PUSHD <#pushd> This feature is automatically enabled, if PUSHD <#pushd> is enabled. The directory stack pushes and pops directories on demand via the commands PUSHD <#pushd> and POPD <#popd>. DIRS <#dirs> displays all pushed directories. Please see the documentation of the mentioned commands. Options Compile-time options: * DIRSTACK_DEFAULT_SIZE: The amount of bytes reserved to store items of the directory stack. Default: 256 ------------------------------------------------------------------------ FEATURE_HISTORY - Command line history See also: HISTORY <#history> Requirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input> If enabled on compilation of FreeCOM and the enhanced command line editing is acivated as well, the command line history becomes available. When commands are enterred manually on the command line prompt of FreeCOM, old command lines are storred in the history and can be retrieved later using the key bindings of F3, F1 and the cursor Up and Down keys. Without the command line history at most one line is cached. The command: HISTORY <#history> displays all cached command lines. The command: HISTORY /number/ resizes the amount of bytes reserved to cache command lines to /number/ bytes. Doing so all cached command lines are deleted. Each instance of FreeCOM maintains its own command line history, which is initially inherited from the particular parent instance, if any. Options Compile-time options: * HISTORY_DEFAULT_SIZE: The amount of bytes reserved initially. Default: 256 ------------------------------------------------------------------------ FEATURE_LAST_DIR - Change back to last directory See also: CD <#cd>, CDD <#cdd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd> If defined on compilation of FreeCOM, every change of the current directory using an internal command records the previous directory and enables the /-/ shortcut for CD <#cd>, CDD <#cdd> and CHDIR <#chdir>. Example: C> CD <#cd> \ C> CD <#cd> freedos\bin C> CD <#cd> - C> CD <#cd> - The first CD <#cd> command changes into the root direcotry, the second into the directory \FREEDOS\BIN, any subsequent CD <#cd> - commands will change between the root directory and \FREEDOS\BIN. ------------------------------------------------------------------------ FOR - Repeat a command Requirements: CMD_FOR Synopsis FOR '%' /letter/ IN '(' *{* /word/ | /pattern/ *}* ')' DO any command Executes any command for several values assigned to the variable /letter/. The values are read strictly left to right from the /word/s and /pattern/s enclosed in parenthises; where /pattern/s are words containing wildcards and are replaced by all matching filenames. Any occurence of a percent sign % and the specified letter is replaced by the current value of the FOR <#for> loop. /Note:/ The letter is case-sensitively matched! *Warning #1*: Unlike most commands I/O-redirections <#_appendix_redirection> are passed forth to the command instead of to apply them to FOR <#for> itself, e.g.: FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >q repeatedly executes the ECHO <#echo> command with the redirection >q, hence, effectively overwriting the file each time. *Warning #2*: Due the syntactical problem that the FOR <#for> variable is specified as '%' /letter/, which is also a legal start of an environment variable, the following kludge had been included to support FOR <#for> and its special variables: * You can use as many percent character as you wish as long as you use exactly the same number for a particular FOR <#for> variable. * Before any environment variables are expanded, the command line is checked for the skeleton specified within the synopsis (there must not be specified no redirection between the FOR <#for> and DO keywords), if it is found, the FOR <#for> command is executed /without/ expanding any environment variables -- they get expanded each time the command is invoked. * *Known Bug*: Otherwise any environment variables are expanded and, if it happens that a valid FOR <#for> command is found now, the environment variables within the command are expanded a second time. In this case the I/O redirections are applied to FOR <#for>, too, instead of passing them forth to the command. * FOR <#for> commands as part of the command of CALL <#call>, IF <#if>, and FOR <#for> itself are never found before expanding the environment variables. *Warning #3*: Due a bug in MS COMMAND (BugID #1050) the right parenthesis *must* be followed by at least one whitespace, this allows the "/feature/" to embed such characters within the words and patterns, e.g.: FOR <#for> %a in (a()a b()b) DO command executes the command two times, first replacing %a by a()a, second by b()b. Examples Example: 1 FOR <#for> %z IN (*.*) DO copy %a a: Performs a COPY <#copy> xyz A: command for each file in the current directory. Its behaviour is equal to COPY <#copy> *.* A: Example: 2 FOR <#for> %z IN (a?b*.TXT) DO CALL <#call> batch arg %z Executes the batch script batch.bat for each file matching the pattern A?B*.TXT located in the current directory. Within the script, the automatic variable /%1/ always expands to the constant argument /arg/, whereas /%2/ expands to the filename of the current loop. Example: 3 FOR <#for> %a IN (1 2 3 4 5) DO ECHO <#echo> %a Is equal to the command sequence: ECHO <#echo> 1 ECHO <#echo> 2 ECHO <#echo> 3 ECHO <#echo> 4 ECHO <#echo> 5 Because these words do /not/ contain no wildcards, they are /not/ matched as filenames. Example: 4 FOR <#for> %g IN (1 2 3*) DO ECHO <#echo> %g Performs the commands: ECHO <#echo> 1 ECHO <#echo> 2 and the ECHO <#echo> command for each file in the current directory, that has no extension and which name starts with the digit three. ------------------------------------------------------------------------ GOTO - Goto label Requirements: CMD_GOTO Synopsis GOTO *[* ':' *]* /label/ Normally all commands of a batch script are executed in the sequence in which they are appear with the script. GOTO <#goto> controls the command flow by unconditionally jumping to the specified /label/; the commands following that label will be executed then. A label is written as a colon in the first column of a line and the name of the label immediately behind. If FreeCOM hits a label in the normal flow, it is ignored completely, even any redirection characters are ignored. The /label/ must be located in the same script file as the GOTO <#goto> itself, if it appears more than once, the first occurance takes precedence. Conditional jumps can be contructed with help of the IF <#if> command, see example 2. Examples Example: 1 GOTO <#goto> ende Jumps the to label :ende Example: 2 IF <#if> "%1"=="" GOTO <#goto> emptyCommandLine Jumps to label :emptyCommandLine, if no argument had been passed to the batch script. For instance: @ECHO <#echo> OFF IF <#if> "%1"=="" GOTO <#goto> error REM <#rem> do something sane here GOTO <#goto> ende :error ECHO <#echo> You must pass an argument to me! :ende ------------------------------------------------------------------------ HISTORY - Display command line history Requirements: FEATURE_HISTORY <#feature_history> Synopsis 1. HISTORY 2. HISTORY /number/ The first format without any argument displays all cached command lines. The second format resizes the memory pre-allocated for the command line history cache to /number/ bytes. ------------------------------------------------------------------------ IF - Conditional execution of a command Synopsis 1. IF *[* NOT *]* EXIST /file/ command 2. IF *[* NOT *]* ERRORLEVEL /number/ command 3. IF *[* NOT *]* /string/ '==' /word/ command 4. IF *[* NOT *]* /quoted-string/ '==' /quoted-string/ command Conditionally executes the specified command. If the keyword NOT is specified, the condition is negated, meaning, the command is executed, if the condition evaluates to false. The first condition evaluates to true, if the specified /file/ exists. Wildcards are supported. On local file systems one can test for character devices, too. The second variant evaluates to true, if the errorlevel is currently assigned to a number greater or equal than the specified /number/. Errorlevels are assigned when external commands terminates or via CANCEL <#cancel> or QUIT <#quit>. The third and four ones are true, when the left string is case-sensitively equal to the string on the right side of the double equal sign. Either side may be quoted by double quotes, though, if the right side is /not/ quoted, the first word is tested only. Examples Example: 1 IF <#if> NOT EXIST c:\command.com ECHO <#echo> There is no COMMAND.COM in C:\ Executes the ECHO <#echo> command, if a file C:\COMMAND.COM does /not/ exist. Example: 2 IF <#if> EXIST c:\fdos\nul GOTO <#goto> have_fdos_directory Branch the interpretation of the batch script to the label, if the file C:\FDOS\NUL exists. Because the filename NUL corresponds to the character device NUL:, which always exists, this test may be used to probe for the existance of the path C:\FDOS, because all character devices are virtually present in every directory of local filesystems. Example: 3 IF <#if> %1==name ECHO <#echo> First argument is "name" ECHO <#echo> is executed, if the first argument of the current batch script is /"name"/ (without the quotes). %1 may expand to any string, even with embedded whitespaces, but without an embedded double equal sign. Also, metacharacters included within the argument are evaluated. Example: 4 IF <#if> "%1"=="first name" ECHO <#echo> First argument is "first name" ECHO <#echo> is executed, if the first argument of the current batch script is /"first name"/ (without the quotes). %1 may expand to any string, even with embedded whitespaces or an embedded double equal sign or metacharacters. ------------------------------------------------------------------------ FEATURE_LOAD_MESSAGES - Load messages permanently If enabled on compilation of FreeCOM, the */MSG* becomes available. If this option is present, when an instance of FreeCOM is created, the FreeCOM messages are loaded into memory permanently. Otherwise, the messages are loaded on demand and are removed from memory when an external command is executed, in order to conserve memory. This feature may help to run FreeCOM on disk- and floppyless boxes. ------------------------------------------------------------------------ LOADFIX - Load an external program above the first 64KB memory See also: CALL <#call>, LOADHIGH <#loadhigh> Synopsis LOADFIX /program/ *[{* /argument/ *}]* Loads and executes an exepacked program, that would abort execution with the error message "Packed file corrupt" otherwise. /Attention:/ This command is not available in the XMS-only variant of FreeCOM! Example: LOADFIX <#loadfix> program.exe ------------------------------------------------------------------------ LOADHIGH - Load an external program into high memory See also: CALL <#call>, LOADFIX <#loadfix> Synopsis LOADHIGH *[{* /option/ *}]* /program/ *[{* /argument/ *}]* Loads and executes an external program in high memory, also called UMB. This command is used to load TSRs, such mouse drivers, into the upper memory to conserve the conventional memory for programs. Example: LOADHIGH <#loadhigh> lmouse.com ------------------------------------------------------------------------ MD - make directory See also: CD <#cd>, MKDIR <#mkdir>, RD <#rd> Requirements: CMD_MKDIR Synopsis MD /path/ Creates a directory of the specified name /path/. Any parent directories must already exist. Examples Example: 1 MD <#md> C:\1 Creates the directory 1 in the root directory of drive C:. Example: 2 MKDIR <#mkdir> C:\1\2\3 Creates the directory 3 in the directory \1\2 of drive C:. If the directory C:\1\2 does not exist, yet, the command fails. ------------------------------------------------------------------------ MEMORY - Display the internally used memory Requirements: CMD_MEMORY Synopsis MEMORY Displays the useage of internal memory of FreeCOM. Note: The internals of FreeCOM are currently under heavy construction, the actual output might vary heavily from this example. Examples MEMORY <#memory> may display this: Environment segment : max 1200 bytes; free 8 bytes Context segment : max 2304 bytes; free 2252 bytes Aliases : limit 1024 bytes, current 5 bytes, 0 items History : limit 256 bytes, current 34 bytes, 2 items Directory stack: limit 256 bytes, current 5 bytes, 0 items Last dir cache : used 0 bytes, 0 items Swapinfo : used 0 bytes, 0 items Heap : free 482080 bytes * The Environment segment is the storage area, the environment variables are storred in. It may be changed passing the */E* option to FreeCOM. * FreeCOM stores several internal information into the Context segment; the aliases - modified by the ALIAS <#alias> command -, the history - displayed using the HISTORY <#history> command, accessed by pressing the cursor Up/Down keys on command line -, the directory stack - displayed with the DIRS <#dirs> command and accessed using the PUSHD <#pushd> and POPD <#popd> commands -, the last directory - accessed with the CD <#cd> - command -, and, finally, some internal command used by the low-level swap interface of FreeCOM. * The heap is the storage area FreeCOM can allocated memory from itself. This value is useful for FreeCOM developers mostly. * max specifies the maximum amount of bytes allocatable within this storage area. * free specifies the unused bytes within this storage area. * limit specifies the maximum amount of bytes allocatable for the particular information within the area. * current specifies the amount of bytes currently allocated for the particular information. * items specifies the number of items storred for the particular information, e.g. how many directories have been pushed onto the stack using PUSHD <#pushd>. ------------------------------------------------------------------------ MKDIR - Make directory This command is 100% compatible to MD <#md>, please see there ------------------------------------------------------------------------ PATH - Display or set the search path Requirements: CMD_PATH Synopsis 1. PATH 2. PATH *[* '=' *]* *{* /path/ *:* ';' *}* 3. PATH; Displays or assigns a new search path. The first variant displays the currently active search path. The second one assigns the specified paths to the search path. The leading equal sign, if present, is ignored. The third variant empties the search path. When FreeCOM searches for an external command or a batch script, which has no path specified, it is search for in all the directories specified in the search path. If the current directory . is not mentioned in the search path, it is searched through first. Examples Example: 1 PATH <#path> c:\fdos\bin;c:\tools;d:\others\bin;bin If FreeCOM is to execute an external program, e.g. XCOPY, FreeCOM will search for the program in the following directories in the specified order, the first program file found is executed: 1. the current directory 2. C:\FDOS\BIN 3. C:\TOOLS 4. D:\OTHERS\BIN 5. BIN Note: Because the last directory specification is a relative one, rather than an absolute one, the program is searched for in the sub-directory BIN of the current directory. ------------------------------------------------------------------------ PAUSE - Pauses batch file execution Requirements: CMD_PAUSE Synopsis 1. PAUSE 2. PAUSE string Pauses the batch file execution until a key is pressed. PAUSE <#pause> prompts the user with the specified string or, if none is specifed, "Press any key to proceed" Examples Example: 1 PAUSE <#pause> Just pauses the execution. Example: 2 PAUSE <#pause> Execution paused, press any key to proceed ... Pauses execution displaying this string. Example: 3 PAUSE <#pause> >nul Pauses execution, but does not display any prompt. ------------------------------------------------------------------------ POPD - Change back to the last pushed directory See also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd> Requirements: CMD_CDD, CMD_POPD Synopsis 1. POPD 2. POPD '*' The first variant changes the current directory back to the one, in which the last PUSHD <#pushd> command was executed. The second one clears all entries of the directory stack, but does not change the current directory. ------------------------------------------------------------------------ PROMPT - Display or set the shell prompt Requirements: CMD_PROMPT Synopsis PROMPT PROMPT *[* '=' *]* /prompt/ Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ PUSHD - Push the current working directory onto the directory stack See also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd> Requirements: CMD_CDD, CMD_PUSHD Synopsis PUSHD /directory/ Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ QUIT - Terminate the current script Synopsis QUIT *[* /n/ *]* Terminates the current active batch script and, if present, assigns the specified number /n/ to the errorlevel. /Note/: This command is a hidden internal command <#_appendix_hicmd>. ------------------------------------------------------------------------ RD - Remove directory See also: CD <#cd>, MD <#md>, RMDIR <#rmdir> Requirements: CMD_RMDIR Synopsis RD /path/ Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ REM - Marks comments or remarks in batchfiles Requirements: CMD_REM Synopsis REM string Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ REN - Rename files See also: RENAME <#rename> Requirements: CMD_RENAME Synopsis REN /source/ /destination/ Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ RENAME - Rename files This command is 100% compatible to REN <#ren>, please see there ------------------------------------------------------------------------ RMDIR - Remove directory This command is 100% compatible to RD <#rd>, please see there ------------------------------------------------------------------------ SET - Display or set environment variables Requirements: CMD_SET Synopsis 1. SET *[{* /option/ *}]* 2. SET *[{* /option/ *}]* /variable/ '=' string The first variant (without any argument) displays all the currently defined environment variables in the format (without any whitespaces before or after the equal sign): /name/ '=' value The second variant assigns a new value string to the specified /variable/. If the /variable/ already exists, the old value is overwritten without notice; otherwise it is newly created. Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. All options must preceed the assigment, if present. * */C*: forces to keep the exact case of the letters of the variable name; by default all letters are uppercased to keep compatibly. * */I*: has been temporarily included to the SET <#set> command to allow an easy way to display the current size of the environment segment, because it is one of the most frequently reported, but not reproduceable bug report. Once this option has been encountered, all the remaining command line is ignored. * */P*: Prompts the user with the specified string and assigns the user's input to the /variable/. If no input is made, hence, one taps just ENTER, an empty value is assigned to the /variable/, which is then removed from the environment. ------------------------------------------------------------------------ SHIFT - Shift the arguments of a batch script Requirements: CMD_SHIFT Synopsis 1. SHIFT 2. SHIFT DOWN Shifts the arguments of a batch script one position up (first variant) or down (second variant). Within a batch script the automatic variables %0 through %9 are replaced by the script name and the first nine arguments. This can be imagined as a window to ten arguments of the script. SHIFT <#shift> will allow to move this window of ten arguments towards its end (up) or its start (down). After SHIFT <#shift> has been executed, the former %0 is hidden and inaccessable, %1 became %0, %2 became %1 a.s.o, %9 became %8 and the formerly hidden tenth argument became %9. SHIFT <#shift> DOWN reverses one SHIFT <#shift> command. SHIFT <#shift> can be called as many times as wanted, SHIFT <#shift> DOWN won't allow to underflow the very first argument. Examples Example: 1 If the batch script B.BAT: @ECHO <#echo> OFF ECHO <#echo> 0: %0 ECHO <#echo> 1: %1 ECHO <#echo> 2: %2 had been executed using: B.BAT 1 2 3 4 it displays: B.BAT 1 2 If a SHIFT <#shift> command had been inserted as second line, the same call displays: 1 2 3 ------------------------------------------------------------------------ TIME - Display or set current time See also: DATE <#date> Requirements: CMD_TIME Synopsis 1. TIME *[* */T* *]* 2. TIME *[* */T* *]* /time/ Variant 1 displays the current time, then enters a loop prompting the user to enter a new time. The loops terminates when a valid time had entered or the user just pressed the ENTER key. Variant 2 does not display the current time, but tries to change the current time to the specified /time/, on failure the loop as explained above is entered. The individual portions of a time may be sperated by at least: dots ., colons : and forward slashes /. Other nationally used characters may be supported, too. If a certain number of portions are specified: 1. error, 2. hour:minute; seconds and hundreds default to zero, 3. hour:minute:seconds; hundreds defaults to zero, 4. hour:minute:seconds.hundreds; 5. more than 4 portions result in an error. Separated by no, one or more whitespaces the am/pm modifiers may follow optionally. If present they alter the given time as follows: * AM: if hour is equal to 12, it becomes 0 (midnight). * PM: f hour is greater than 12, it is incremented by 12. Options All options must preceed any arguments. */T*: prevents from prompting the user. 1. In variant 1, the time is displayed only. 2. In variant 2, the time is tried to be changed, but the loop is not entered on failure. Examples Example: 1 TIME <#time> /T Just displays the current time. Example: 2 TIME <#time> 18:2 Sets the current system time to 6:02 PM. ------------------------------------------------------------------------ TRUENAME - Display the true name of a file Requirements: CMD_TRUENAME Synopsis TRUENAME /path/ Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ TYPE - Display the contents of files See also: DIR <#dir>, ECHO <#echo> Requirements: CMD_TYPE Synopsis TYPE *{* /pattern/ *}* Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ VER - Display the version information about FreeCOM and DOS Requirements: CMD_VER Synopsis VER *[{* /option/ *}]* Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ VERIFY - Display or set verify level Requirements: CMD_VERIFY Synopsis VERIFY *[* ON | OFF *]* Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ VOL - Display the volume label of a drive See also: DIR <#dir> Synopsis VOL *[* /drive/ *]* Options Unless stated otherwise all options of this command do follow the standard rules for options <#_appendix_options>. Examples Example: 1 ------------------------------------------------------------------------ WHICH - Search and display the executable file of specified commands Requirements: CMD_WHICH Synopsis WHICH *[{* /command/ *}]* Searches for the specified command(s) the same way as if it would be specified on command line as command itself. If an executable file is found, its path is displayed in this format: /command/ tab /path/ The tab stands for the tabulator character (ASCII 9). If the command is not found only the /command/ part, but neither a /path/ nor the tab is displayed. Internal commands, installable commands and aliases are not found. Examples Example: 1 WHICH <#which> which Returns a file or nothing, because WHICH <#which> is an internal command. Example: 2 WHICH <#which> command Could display for instance: command C:\COMMAND.COM Please note that command is the string "command" and no placeholder. ------------------------------------------------------------------------ Appendix Current Directory The current directory is the default directory of a drive. DOS stores a default directory for each drive. When a path is specified with a drive specification only, such as D:, it is completed with this default directory of that drive to construct the absolute path <#_appendix_abspath> to be used. Current Working Direcory In opposite to the current directory the current /working/ directory is the absolute path <#_appendix_abspath> constructed out of the currently selected drive <#chgdrive> and current directory of that drive. Path Specification In DOS an absolute path is constructed out of several components: 1. drive, 2. directory, 3. filename, and 4. file extension. like this: D:\DIR1\DIR2\FILENAME.EXT. The drive is a single letter from A through Z followed by a colon :. The remaining part of a path consists of similiar components delimited by a single backslash \. The last component is also called filename. Each of these components may be formed of a name, up to eight characters long, and an extension, up to three characters long. Both parts are delimited by a single dot .. Although the extension may be absent, the filename must have at least one character. Note: The term /filename/ is not limited to /files/ in the usual sense, but may apply to any name visible in a directory, such as subdirectories and volume labels, as well. To ease the way to enter a path the user may specify a relative path, rather than an absolute one. In such path one or more components may be missing: * If no drive is specified, what means that no colon is specified, the path is prefixed by the currently selected drive <#chgdrive>. * If the directory is not prefixed by the backslash or no directory is specified at all, the current directory <#_appendix_currdir> of the drive is inserted right behind the colon. * Some programs may append an absent extension to the very last filename component. Examples, assume the current directories of *Drive* *Current Directory* C: \FREEDOS\HELP D: \TEMP\TEXT The currently selected drive is C:. 1. C:\ The root directory of drive C:. 2. . The current working directory, ergo: C:\FREEDOS\HELP. 3. .. The parent directory, ergo: C:\FREEDOS. 4. D: The current directory of drive D:, ergo: D:\TEMP. 5. D:. The current directory of drive D:, ergo: D:\TEMP. 6. D:.. The parent directory of drive D:, ergo: D:\. 7. ..\BIN Because there is neither a drive nor a leading backslash, both the currently selected drive and the current directory of that drive is inserted before the given path, ergo: C:\FREEDOS\HELP\..\BIN. The embedded component .. has the same meaning as when specified alone: /parent directory/, though, here in the context of the directory C:\FREEDOS\HELP\. That means that the final absolute path is: C:\FREEDOS\BIN. Path specifications that do not conform to above mentioned format lead to various different behaviour of the various programs, because there is no standard to scan, parse and interprete such patterns. Problems include: * multiple backslashes, * multiple dots, * multiple colons, or a colon at a position unequal to two, * The current directory . or parent directory .. special directories in the context of a root directory, such as C:\., C:\.., or C:\TEMP\..\... Note: The special directories . and .. are no phantom directories or virtual entries, but standard entries of every directory except the root directories. These entries help crash recovery tools, such as CHKDSK or SCANDISK, to find errors within the directory structure and restore it to a valid file tree. Therefore a common assumption that a tripple dot ... directory means /parent-of-parent/ is incorrect, though, might be supported by certain programs. Standard Rules for Options Options are prefixed by one forward slash "/", the following character identifies the option and is called option character, for instance: */A* Some commands do accept long option names, where a complete word identifies the option rather than a single character, e.g. */MSG*. Some option may be used in conjunction with an argument. The argument is appended to the option with one colon ":" or one equal sign "=", for instance: */A:hr* or */P=fdexec.bat*. Multiple options /without/ argument maybe merged together as a single option with or without embedded slashes, e.g. */WS* or */W/S*, instead of */W /S*. However, because some commands do accept long option names, the way with embedded slashes is more secure and is recommended therefore. An option with argument may be the last one of such merged options. Options without arguments enable or disable certain features. Therefore, those options are sometimes called /boolean/ options or flags. Boolean options may be optionally prefixed by a plus "+" or minus "-" sign. So, the boolean option *O* can be written in three ways: 1. */+O*: The option is enabled. 2. */-O*: The option is disabled. 3. */O*: (neither plus nor minus sign) The option is toggled or flipped; this means if the option is enabled currently, it is disabled; but if it is disabled currently, it is enabled. Without user invention a boolean option is disabled by default, so both */+O* and */O* behave the same most of the time. However, some commands allow the user to change the default settings of certain options, e.g. COPY <#copy> and DIR <#dir>. I/O Redirection In DOS the standard input and output can be redirected to a file or another device; however, although it is common to use these I/O streams today, some programmers cowardly ignore them for reasons of speed or program size. If the *input* stream is redirected to a file or device, instead of polling the keyboard and request the user to interactively enter characters via the keyboard, those characters are read from the file or device. Usually these programs terminate when the file has been read wholely. If the *output* stream is redirected to a file or device, instead of issuing the information onto screen, it is dumped into the file or device. Per convention each program has two output streams: one (called standard output) to issue normal information and one (called standard error output) for error messages the user should not miss. Redirections are specified on command line and effect exactly that command invoked herein, regardless if the command is an external or internal one, an alias or batch script. The utter exception is the FOR <#for> command, which requires that the redirection is to apply to the command specified behind the DO keyword rather than FOR <#for> itself. If more than one redirection is specified on the command line and they effect the same stream (input, output, or error), the rightmost one superceed any previous one. Redirections are syntactically specified like this: /operator/ /target/ /operator/ *::=* '<' | '>' *[* '>' *]* *[* '&' *[* '>' *]* *]* /target/ *::=* /file/ | /device/ Although it is not relevant where the redirections are placed on the command line, it is common praxis to place them at the end of it. The /operators/ have the following meaning: Operator Redirection < Input stream > Output stream; target file is overwritten >> Output stream; output is appended to target, if it already exists >& Output and error stream; target file is overwritten >>& Output and error stream; output is appended to target, if it already exists >&> Error stream; target file is overwritten >>&> Error stream; output is appended to target, if it already exists Examples Example: 1 cmd &out Input stream is redirected to file IN, output and error streams are joined together and redireced into file OUT. If the file OUT already exists, the old contents is discarded and replaced by the new one; otherwise, the OUT is created anew. Example: 3 cmd >&out As example 2, but instead of replacing the contents of OUT, if the file already exists, the new information is appended to the end of the file. Example: 4 FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >out As mentioned earlier, FOR <#for> is an exception and passes forth the redirections to each invocation of the command specified right of the DO keyword. So this examples overwrites the output file each time the ECHO <#echo> command is performed, thus, instead of creating a file list, only the last found file is recorded into OUT. Example: 5 IF <#if> EXIST out DEL <#del> out FOR <#for> %a IN (*.*) DO ECHO <#echo> %a >>out This sequence eliminate the problem, the IF <#if> command is required to actually replace the file rather than appending the file list to the probably existent file. Pipes Another form of redirection is *piping*. Hereby, the output stream of one command is connected to the input stream of another command. Pipes can combine any number of commands this way. Because DOS is no multitasking system, pipes are simulated by spawning the first command with an output redirection capturing the issued information into a temporary file and then the second command with an input redirection from that very same temporary file, on completation of the second command the temporary file is deleted. Examples Example: 1 cmd1 | cmd2 | cmd3 Which is similiar to this sequence: cmd1 >%TEMP%\t1 cmd2 <%TEMP%\t1 >%TEMP%\t2 DEL <#del> %TEMP%\t1 cmd3 <%TEMP%\t2 DEL <#del> %TEMP%\t2 Example: 2 The first and last command can have an input or output redirection respectively, like so: cmd1 | cmd2 | cmd3 out Which is similiar to this sequence: cmd1 >%TEMP%\t1 %TEMP%\t2 DEL <#del> %TEMP%\t1 cmd3 <%TEMP%\t2 >out DEL <#del> %TEMP%\t2 Example: 3 The error stream can be piped as well: cmd1 |& cmd2 | cmd3 Which is similiar to this sequence: cmd1 >&%TEMP%\t1 cmd2 <%TEMP%\t1 >%TEMP%\t2 DEL <#del> %TEMP%\t1 cmd3 <%TEMP%\t2 DEL <#del> %TEMP%\t2 Here only the error messages of cmd1 are passed into cmd2; the error messages of both cmd2 and cmd3 are issued to the screen. Nested redirections Batch scripts or when external programs invoke other programs or another shell, redirections may be nested, e.g.: Consider the batch file BATCH.BAT: @ECHO <#echo> OFF ECHO <#echo> 1 ECHO <#echo> 2 >out_2 ECHO <#echo> 3 which is invoked via: BATCH >out_1 When the script BATCH gets executed, the actual output stream is redirected to the file OUT_1. Therefore the output of the first ECHO <#echo> command is redirected into this file. Because the second ECHO <#echo> command has its own output redirection, its output is redirected into the file OUT_2. On completion of ECHO <#echo> the redirection is closed and the former one is restored. What causes that the output of the third ECHO <#echo> command is redirected into OUT_1 again. Hidden Internal Commands There are some special internal commands, that are not directly visible nor accessable. They are hidden because of two main purposes: 1. Many of them are of internal nature and should not used by the user. 2. They are extensions to the normal batch language and may, therefore, clash with a particular installation. To prevent this clash those commands are hidden by default and can be made directly accessable via the ICMD command. Hidden internal commands can be access by prefixing the command with ::=. This token usually specifies a label within the batch language, given the nature of the labels, they may be comments as well. Due to the latter variant, most non-FreeCOM shells won't see the ::=, hence, ignore those commands. For example: C> ::=CANCEL <#cancel> 30 cancels (terminates) all currently active batch files and assigns /30/ to the current errorlevel. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ 1. Introduction <#-intro> 2. FreeCOM Command Line Syntax - Useage, Switches and Options <#-cmdline> 3. Environment Variables <#-envvars> 4. Internal Commands <#-icmds> 5. User Prompt <#-userprompt> 1. Command Line Syntax <#-cmdline-syntax> 2. Command Line Editing <#-cmdline-editing> 6. Features of FreeCOM <#-features> 7. Status of FreeCOM / To-do List <#-status> 8. Appendix <#-appendix> 1. Compile FreeCOM - sample <#-compile> 2. Download <#-download> 3. CVS Resources <#-cvs-tags> 4. EBNF <#-ebnf> ------------------------------------------------------------------------ Introduction FreeCOM is a: * *C*ommand *L*ine *I*nterface, * (user) shell and/or * COMMAND.COM replacement for DOS. It has been spawned as part of FreeDOS , a project that aims to implement a GNU GPL'ed DOS. The main duty of FreeCOM is to prompt the user to enter commands <#-userprompt>, which are interpreted, processed directly by FreeCOM or executed as executable files. Those commands processed by FreeCOM directly are called /Internal Commands/ <#-icmds>. Non-internal commands, which cannot be processed by FreeCOM directly, are called /External Commands/, because FreeCOM will search for files equally named as typed-in. Besides to implement certain commands FreeCOM offers some features <#-features>. ------------------------------------------------------------------------ Command Line Syntax, Useage, Switches and Options COMMAND.COM *[* /path/ *[* /console/ *]* *]* *[{* /option/ *}]* *[* '/' *(* K | C *)* commandline *]* If present, the first non-option argument specifies the location in which FreeCOM resides. This location is later stored in the environment variable COMSPEC. Since DOS3+ this option is no longer necessary to find the shell invoked during the boot process, but it may be used to let the system boot a primary shell from one location, but use a shell of the same version from a different location later on. One shallt not point to a RAMdisk at this time, because FreeCOM needs to reload certain information relatively early during execution, before AUTOEXEC.BAT had been executed, in which, normally, FreeCOM is copied into the RAMdisk. For convinience FreeCOM checks, if at the given location a FreeCOM exists *and* is accessable, if not, the given location is ignored. Also, the standard requires to specify a path only, but FreeCOM accepts an absolute filename, so accepting that FreeCOM is not necessarily named COMMAND.COM. The second non-option argument, if present, specifies the console FreeCOM shall enable. This setting is system-wide and is not limited to FreeCOM or just this particular process tree. In its result, this argument is identical to the CTTY command. FreeCOM knows the following options: * */?*: Issues a help screen, then exists. * */!*: Enable/disable debugging support, if compiled to FreeCOM. * */Y*: Enables trace/single step mode. This mode is deaktivated when the user prompt has been reached. * */D*: Disables to parse AUTOEXEC.BAT, even if the */P* option is present. This switch is usually set by the kernel, when F5 had been pressed during bootup. * */F*: Enables autofail of Critical Errors; then instead of displaying the Abort/Retry/Ignore/Fail dialog, Critical Errors are automatically answered with Fail. * */P*: Installs a primary copy of FreeCOM. Such instance: 1. cannot be terminated with the EXIT command. 2. executes the AUTOEXEC.BAT script before any other command. The */P* option may have an argument to specify an alternate name for the AUTOEXEC script, e.g.: */P:FDAUTO.BAT*. * */E*: Sets another size of the environment segment, in which all the environment variables are stored, e.g.: */E:1024*. * */L*: Sets the size of the internal command buffer. /Note/: This option is ignored currently, the internal buffer always defaults to 512 bytes. * */U* Sets the size of the internal user input buffer. /Note/: This option is ignored currently. The input buffer always defaults to 255 bytes, which is the maximum. * */LOW*: Forces to load FreeCOM low. /Note/: Currently this option has no effect, because no part of FreeCOM is loaded high. * */MSG*: Installs the message server. /Note/: Because the message server is not used nowadays, this option forces to permanently load FreeCOM's messages into memory. * */SWAP*: Toggles, if to default to swapping or not; due to different default values of this /internal/ flag, it is recommended to always prefix the option with '|+|' to enable or '|-|' to disable swapping. The options */K* and */C* are special cases and do not behave as normal options does. They are exclusive and all characters at the right side of such option (except an optional argument sign) specify a command to execute, e.g.: /C DIR /s, /C=DIR /s, and /CDIR /s do behave exactly the same and execuate the command DIR /s. If these options are used in conjunction with the */P* option, the AUTOEXEC.BAT script is executed prior executing the specified command. In opposite to */K* the */C* option does not enter the interactive shell prompt after executing the specified command unless the */P* options is present, too. Boolean options, which can only be /enabled/ or /disabled/, may be prefixed by '|+|' to enable or '|-|' to disable it. ------------------------------------------------------------------------ Environment Variables Environment variables can be freely assigned using the SET command, e.g. executing: SET var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas assigns this nonsense to the variable var1. Later on, the value of the variable can be used by writing: %var1%, thus, writing the name of the variable enclosed without whitespace by two percent signs. *Warning*: Environment variables are expanded fully into plain text before the command line is furtherly parsed. If a variable contains an odd number of quotes, the remaining command line must contain the closing quote in order to operate properly. Also see this: SET var=text del IF text==%var% GOTO label The second line looks uninteresting, but once the environment variable has been expanded the line has morphed into: IF text==text del GOTO label not that funny anymore, because the IF command interpretes only the string text==text as condition, but del GOTO label is executed as command. FreeCOM uses a number of environment variables for its own purpose. * *COMSPEC*: FreeCOM loads some information on demand, these data are stored in the FreeCOM executable. The value of this environment variable contains the filename FreeCOM shall use. The contents can be changed with the SET command. * *DIRCMD*: The user may define default values for the DIR command. Any options specified within DIRCMD are prefixing any entered ones, so to say FreeCOM behaves as if the user always types: DIR %DIRCMD% other arguments This variable must be changed using the SET command. * *COPYCMD*: This variable contains default options for the COPY command. * *PROMPT *: FreeCOM prompts the user to enter commands to run, the prompt can be customized by changing the contents of this variable. This variable can be changed using the SET or the PROMPT commands. Latter one includes a detailed description of the format of the prompt string. * *PATH *: When FreeCOM is to execute an external command and this one does not contain no path, FreeCOM searched for the command in a number of paths. These ones are enumerated by the PATH environment variable. This variable can be changed using the SET or the PATH commands. Latter one includes a detailed description of the format of the search path. There are a number of automatic variables that do not follow the above mentioned syntax and which contents is automatically generated. Unlike the normal variables these automatic variables are constructed of exactly two characters, the first one is a single percent sign and the second one the variable identifier: * *%?*: expands to the current errorlevel, which is the exit code of the previously executed external command. * *%0*: in batch scripts only: is the name of the script currently executed. * *%1* through *%9*: in batch scripts only: are the first through nineth argument passed to the currently executed batch script. If less than nine arguments had been passed to the script, they return an empty string. To access the tenth argument please refer to the SHIFT command. * FOR *%v* IN (...) DO any command: *%v* may use any letter, the FOR command creates a new variable, which is valid in the any command following the DO keyword. * *%%*: Is no real variable, but expands to a single percent sign. Because automatic variables have one percent sign only, it sometimes lead to confusion within the FOR command, e.g. in: SET adam=eva FOR %a in (*.*) DO echo %adam% %a %adam is interpreted as [%a]dam. ------------------------------------------------------------------------ Internal Commands Internal commands will be processed by FreeCOM directly, they are available to the user without presence of any external files, in fact they hide External Commands named equally. The synopsises of the internal commands are described in a style derived from EBNF <#-ebnf>. ------------------------------------------------------------------------ User Prompt FreeCOM knows two modes: 1. Interactive, and 2. batch processing. The second one performs batch scripts, which are more or less a sequence of commands written to a file. Such files may contain any external commands, internal commands and calls to other batch files as well. In interactive mode FreeCOM prompts the user to enter a command, the line is interpreted, parsed and, finally, either rejected because of an error or executed. Command Line Syntax FreeCOM accepts the following command line: *[* ':' *]* *[* '?' *]* *[* '@' *]* *[* '*' *]* *{* /command/ *[{* /argument/ | /redirection/ *}]* *:* '|' *}* /redirection/ *::=* *(* '<' | '>' | '>>' *)* /filename/ The first optional ? must not be mixed up with the command ?! Description: The colon marks the line as label, which causes to let FreeCOM ignore the line completely as no interpretation is tried on this line, neiter are any redirections created. The ? forces FreeCOM to enable the trace mode for this line. In trace mode FreeCOM prompts the user wether to execute the resulting command. The optional @ disables the echo status for this line. If the echo status is enabled, the line is displayed right before it is executed; see ECHO for more details. The asterisk * is available only, if aliases are compiled into FreeCOM; if present, the alias expansion <#-features> is skipped. If commands are chained with the | symbols, those commands are to be executed as a /pipe/. For instance the command line: cmd1 | cmd2 | cmd3 forms a pipe consisting of the three individual commands cmd1, cmd2, and cmd3, where the standard output stream of cmd1 is connected to the standard input stream of cmd2 and the output of cmd2 to the input of cmd3. /Note:/ Because DOS is no multitasking environment, pipes are simulated with file and the three-command pipe will look like this: cmd1 >%TEMP%\cmd###1.tmp cmd2 <%TEMP%\cmd###1.tmp >%TEMP%\cmd###2.tmp cmd3 <%TEMP%\cmd###2.tmp The files are temporary ones and will be removed as soon as they are no longer required, meaning the tempfile #1 is removed after cmd2 terminates and tempfile #2 upon termination of cmd3. Redirections tie the standard input or output stream to a file or device, for instance: cmd arg >outfile redirects the standard input stream of cmd to the file infile and the standard output stream to outfile. The double output redirection specifies to append to an existing file rather than overwriting it. Command Line Editing FreeCOM offers two methods to interactively enter command lines: 1. standard input, and 2. enhanced input. The first one just calls a DOS function, whereas the second one processes each key for its own. Which method FreeCOM uses is defined at compile time. If the echo state is enabled, the user is /prompted/ with the PROMPT string; otherwise no visible or audible prompt is issued to indicate an user activity request. In either mode the ENTER key terminates the editing and lets FreeCOM start to interprete the entered line. The *standard input* mode does neither support command line history, except the last command line in some circumstances, nor file completion. The following keys have a special meaning: Key Meaning F1 Get next character from last line, if available F3 Get last line, if available F5 Place current line in last-line buffer and restart editing on a blank line F6 Insert the pseudo-character /End-of-file/ backspace delete character to the left cursor left delete character to the left cursor right Get next character from last line, if available The *enhanced input* mode does support command line history and file completion. The following keys have a special meaning: Key Meaning F1 Get next character from last line, if available F3 Get last line, if available F5 Place current line in last-line buffer and restart editing on a blank line backspace delete character to the left cursor down Replace the current input line with the previous line from the history cursor left move cursor one character one position to the left cursor right Move cursor one position to the right; at the end of the line get next character from last line, if available cursor up Replace the current input line with the next line from the history delete Deletes the character on the cursor end Moves the cursor to the end of the line ESC Clear current line home moves the cursor to the beginning of the line insert Switch between insert and overwrite mode TAB Take the current word for a file and try to complete it ^C Clear current line and enable echo state. The echo state is enabled to ensure the user gets to know he is on the command line of FreeCOM rather than stuck in a non-interruptable program. ------------------------------------------------------------------------ ------------------------------------------------------------------------ Features of FreeCOM FreeCOM implements the following features: * FEATURE_ALIASES - Command aliases * FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor * FEATURE_BATCH - Batch script processing * FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present * FEATURE_CALL_LOGGING - Startup logging * FEATURE_DIRSTACK - Directory stack * FEATURE_ENHANCED_INPUT - Enhanced command line editing * FEATURE_FILENAME_COMPLETION - Filename completion * FEATURE_HISTORY - Command line history * FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE) * FEATURE_LAST_DIR - Change back to last directory * FEATURE_LOAD_MESSAGES - Load messages permanently * FEATURE_NLS - use DOS NLS ------------------------------------------------------------------------ Status of FreeCOM FreeCOM's development currently targets the v1.0 version, which is to provide all functionality (features) of commonly known COMMAND.COMs at minimum, but probably at the cost of optimization and performance. The To-Do list: Feature Target Swapping without any supporting secondary programs (KSSF.COM and VSPAWN.COM) v0.90 INT-2E backdoor v0.90 Wildcards for REN , same filename pattern matching code for REN , COPY and DIR v0.93 DIR /O and DIR /A v0.93 IF /I v0.85 Input/output functions to replace by (aka replace FILE*-based I/O by handle-based one) v0.95 <#-todo1> Strict error recognition, probably _doserrno based v0.97 <#-todo1> Support for DOS=HIGH v0.90 Code sharing of modules v0.91 Full support for DOS NLS pre v0.95 Redirection in conjunction with Swapping v0.90 Optimize FreeCOM for size >= v1.0 Other swap storage areas, e.g. XMS and EMS post v1.0 <#-todo2> Long filenames post v1.0 internal commands <#-icmds> mostly done <#-icmds> Aliases: ALIAS done Command line history: HISTORY done Directory stack: DIRS , PUSHD , and POPD done MUX-AE interface done Enhanced command line editing, file completion <#-cmdline-editing> done Last directory recognition: CD , CDD , PUSHD done Control Break handler done Critical Error handler done IF ERRORLEVEL H// done (v0.83?48) Footnotes: * I/O replacement shallt preceed error reporting correction as some failures are impossible to detect without work-arounds with the functions. * If I get contributions after v0.90, those portion may be added earlier. ------------------------------------------------------------------------ Appendix Compile FreeCOM - sample Due to heavy request, there is a sample description how to compile FreeCOM in ten steps . Download FreeCOM can be downloaded from SourceForge in several ways and packages: 1. source code files from the CVS repository <#-cvs-tags> 2. tarball and pre-compiled packages from anonymous FTP <#-download-ftp> 3. tarball and pre-compiled packages via HTTP <#-download-http> 4. tarball and one pre-compiled package as file release <#-download-filerelease> Resources accessable via anonymous FTP SourceForge closed the FTP - Services, therefore an alternate location had been created at: ftp://ftp-fd.inf.fh-rhein-sieg.de/pub/freedos/local/FreeCOM. It contains the very same packages available at the HTTP location below. Resources accessable via HTTP http://freedos.sourceforge.net/freecom/packages/ contains several variants of tarballs and pre-compiled packages of FreeCOM. The files immediately located in the directory contain the most current major release of FreeCOM, whereas the subdirectories include Beta releases of the upcoming release. The packages themselves include: file name contents COM###.ZIP or Com###Beta##.ZIP tarball (the source code tree without CVS information) BINARY.ZIP the most commonly used pre-compiled FreeCOM with almost any feature, but debugging enabled. This release uses standard swapping mechanisms! XMSSWAP.ZIP the most commonly used pre-compiled FreeCOM with almost any feature, but debugging enabled. This release uses XMS-Only swapping mechanism! PLAINEDT.ZIP As BINARY.ZIP but using the plain command line editor of the kernel instead of the enhanced one DEBUG.ZIP As BINARY.ZIP with debugging support enabled. This variant is a lot larger than the standard release and can generate lots of output. LOCALIZE.ZIP As BINARY.ZIP but targetted at maintainers of a language description file (*.LNG). SUPPL.ZIP the SUPPL library required for linking FreeCOM precompiled for use with Turbo C++ v1.01 DOCS.ZIP a package with these HTML documents File Releases on SourceForge On SourceForge so-called /File Releases/ can be created. The file release section of the FreeCOM module contains a source ZIP and a binary ZIP file, they are equal to the tarball and the BINARY.ZIP on the anon FTP space respectively. Unlike the FTP space, old versions are kept, but no Beta versions or side branches. CVS Resources On SourceForge a short description of how to access the CVS repository is located. Following those instructions will download the main trunk of the specified module of the repository, e.g.: cvs -z6 co freecom downloads the MAIN trunk, also called HEAD, of FreeCOM. Alternatively the WebCVS -- follow the Browse CVS link there -- might be helpful in order to download a handful of files. However, CVS allows to branch the development of a module at some point from the main trunk into side trees. On these branches the module can be developed further, new features can be added etc., without disturbing the main trunk (and therefore the primary release) of the module. When the side development proved its worthiness, the changes are merged into the main trunk and, hence, becomes part of the primary release. Branches are marked by tags, though, unlike normal tags branch tags automatically evolve with the file, what means that when a file from a specific branch is updated, the branch tag automatically move from the current version of the file to the new one. To check out a branch, create a new directory, change within it and execute: cvs -z6 co -r tag freecom , where tag is the name of the branch you want to download. /Note/: It is not advisable to use the same directory to manage files for two different branches. The FreeCOM module has the following /active/ branches: Tag Meaning expExec Stack-based execution context implementation expSpawn Module based FreeCOM, bases on expRes branch The FreeCOM module has the following /obsoleted/ branches: Tag Meaning expRes Resource management implementation. Finally merged into trunk as of 2001/03/10 ------------------------------------------------------------------------ EBNF Documents encode the synopsis of the commands with operators derived from EBNF (*E*xtended *B*ackus-*N*aur *F*ormula). Type setting Depending on different meanings characters are set into various shapes: Name Meaning Example terminal characters to be enterred on command line or displayed by the computer;EBNF: "terminal symbols" ECHO 'string' The quotes remove the metafunction of the enclosed characters in order to specify EBNF operators as terminal symbols. EBNF: "terminal symbols" '|' *bold* operators that constructs portions together; EBNF: "operators" *|* /italic/ placeholders for arguments, which are explained in the description; EBNF: "non-terminal symbols" /varname/ Operators The EBNF uses the following operators: Symbol Meaning *|* alternative; use either left or right token *()* parenthizes enclose tokens limiting the range of *|* *[]* brackets enclose optional tokens, thus, they may appear zero or one time; they also limit the range of *|* *{}* curly brackets enclose repitive tokens, which may appear one or more times; they also limit the range of *|* *{ : }* as the normal curly brackets, but any repitive tokens are delimited by the token(s) right of the colon; for instance: *{* /file/ *:* '+' *}* is the same as: /file/ *[{* '+' /file/ *}]* and applies to: * /file/ * /file/ + /file/ * /file/ + /file/ + /file/ * /file/ + /file/ + /file/ + /file/ * ... * * is a placeholder for an arbitary string of terminal symbols, which further syntax is described by the enclosed text in English natural language. *::=* assigns a meaning (right side) to a non-terminal symbol (left side); for instance DIR *[ {* /option/ *|* /filespec/ *} ]* /option/ *::=* / *(* A *|* B *|* C *)* Any occurance -- only one here -- of /option/ on the right side of an *::=* or where no *::=* is present at all is to be replaced by the right side of /option/*::=*. Unless modified by above mentioned operators a sequence of tokens specifies that each token must be present exactly one time in exactly that order. Note: For the sake of clearness, spaces are inserted between tokens. These spaces do *not* mean that a space is allowed at this place! Also, the fact that no *_* is present does *not* mean that at this place is none allowed. It is assumed that the reader will find the places where optional spaces are valid either by "doing" or by reading the examples. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ Copyright 2000-2001 Steffen Kaiser - current maintainer of FreeCOM Elvis - The VI clone ================================================ FILE: docs/_config.yml ================================================ theme: jekyll-theme-architect title: "FreeCom : FreeDOS command.com" description: "FreeCom is an implementation of the command line interpreter for FreeDOS, command.com" show_downloads: "true" ================================================ FILE: docs/c0.txt ================================================ 1999/06/17 - exclusion of argc/argv and C-style environment NOTE: Currently no changes have been made to the C0 code itself, it adjusted itself to most of the changes quite well enough. To save more memory and prevent possible inconsitencies when FreeCom starts up as the primary shell, when the environment has not been setup correctly, the processing of the command line and the handling of the environment is implemented manually. argc/argv are replaced by the scanCmdLine() function. The environment is replaced by the env*() functions of the SUPPL library, already wrapped into getEnv*() and putEnv*(). Implementation problems with Borland C/C++ v5.0: + The Borland startup code processes a bunch of INITDATA entries that can be set via the #pragma startup directive. They are included, if and only if the module they are defined in is referenced by the source code or the parts of the C standard library directly or indirectly referenced by the sources. + The command line handler is included, unless the notation "main(void)" is used to define main(). + The environment handler consists of two parts: #1: Many stuff within the C startup code (C0.ASM) that identifies and calculates the dimension of the current environment, e.g. how many variables are stored there and how large the environment is. #2: An #pargma startup function that sets up the C-style environment handling functions, namely, in near data pointer memory models the full environment is copied into the address space of the program and the global symbol char *_environ[] constructed to hold an array of pointers to each individual variable. The code within C0.ASM can be disabled. But to remove the other code, every reference to a C library function that uses the environment must be redesigned. ================================================ FILE: docs/cmt1.txt ================================================ 1999/04/27 ska - Redesign of command line parser for internal commands Every internal command parses the command line individually bestowing individual rules what is detected and what is supported. This not only results into an inuniform behaviour, it also results into multiple code and different maintainance options. The redesign of the command line parsers shall honor all internal commands that behave like external ones (e.g. TYPE, DIR, but not FOR and IF). A list follows now that describes the way, how the command line is scanned by the internal commands: "no arg" == checks for no argument "any string" == takes a string, not broken into individual arguments "ign" == command line ignored totally "!# arg" == checks for exactly # argument(s) "glob opt" == global option neither mind if it preceeds or follows argument "seq" == sequence (of) "specific" == checks for specific words, e.g. ON or OFF "|" == choices to interprete the command line "and" == must all appear within the same choice alias: no arg | any string beep: ign break: no arg | specific word call: passed back to parsecommandline() chdir: no arg | !1 arg cls: ign copy: split() heavy detection of options and mbedded '+' and local opt ctty: ign date: no arg | interactive loop del: glob opt and !1 arg dir: glob opt and !1 arg doskey: ign echo: no arg | specific word | anything else for: specific seq of words and trail passed back to parsecommandline() goto: first word history: no arg | any arg read as number if: specific seq of words loadfix: any string preceeded by switches loadhigh: any string preceeded by switches mkdir: !1 arg path: any string, optional /^=\s*/ removed pause: no arg | any string prompt: any string, optional /^=\s*/ removed rem: ign ren: !2 arg rmdir: !1 arg set: no arg | any string shift: no arg | specific word time: no arg | interactive loop truename: no arg | any string type: !1 arg ver: glob opt verify: no arg | specific seq of words vol: no arg | !1 arg and glob opt I put them into class: Class 1 - no command line beep, cls, rem, doskey, ctty Class 2 - simple command line call, break, alias, if, for, goto, truename, date, time, shift, prompt, pause, path, history, echo, verify Class 3 - broken command line chdir, copy, del, dir, mkdir, ren, rmdir, type, ver, vol Class 4 - individual command line loadhigh, loadfix, set Class 1 is simple to implement: One need not do nothing at all. Class 2 is mostly simple as well, they only: + test if there is an argument at all, + take the complete command line as it is, + test if the command line is a sequence of tokens, or + a combination of them. These functions can be effeciently achieved by normal string oriented functions already available in C or with ltrim() and matchtok(). Class 3 becomes a little more problematic, because they: + require to get arguments in sequence as placed on command line, but also randomly (e.g. COPY uses the last argument first). + scan the complete command line for options before the arguments are processed. + break the command line in individual notions (see COPY). From my point of view these three points can be effeciently implemented by splitting the complete command line into an argv[] array, then process the embedded options, then pre-process the array in an individual manner, and finally read the arguments as necessary. The basic part would be the split() function, however, I'd also prefer a shared function to scan the options. By doing so one could simple imagine to extend, say, TYPE for use with more arguments than one or use options as well, e.g. /B for binary output. Class 4 is quite tricky. This is because LOADHIGH should not break the complete command line, because this could modify the command to be invoked by LH in an inproper manner. Therefore it is to design a set of tools to effectively scan the command line that are compatible (aka shared) by Class 3 implementation. As these commands have in common to read options preceeding the unstructured string, this would be a function to test for an option and return its value and argument, if so. === All internal command will now share the same algorithms to interprete the command, well more or less. The currently implemented rules: + Quotes are paired "", '' and ``. However, they currently do not serve any particular function other than to quote (rip of any metafunction) of enclosed characters. + Missing right quotes are silently assumed, but not added. Meaning: There is no "Missing quote" error. + Quotes can appear within words, but retain their metafunction. + A slash within quotes is never interpreted as option. + A slash outside quotes is always interpreted as option. + Quotes are removed. + Any non-empty and non-quoted sequence of whitespaces, commas and semicolons delimit two arguments. It is removed. ================================================ FILE: docs/cmt10.txt ================================================ $Id$ Critical Error Handler Repeat Check Autofailer -- 2004-09-13 ska Due to some heavy and annoying invocations of the Critical Error handler by some operations the standard Critical Error handler has been extended by a feature to automatically switch into autofail mode, in which all requests are automatically returned by FAIL without displaying the Critical Error user dialogue. Currently this feature must be activated by FreeCOM before and deactivated after the operation. Current effected operations are: + the whole DIR command, and + the search for external commands through %PATH%. The algorithm is as followed: 1. FreeCOM turns the CRITER repeat check ON. 2. The operation is performed. 3. FreeCOM turns the CRITER repeat check OFF and, if any, displays how many Critical Error requests had been hidden. The repeat check works like so: + If a Critical Error occurs, the handler checks, if the repeat check is active; if not, the standard CRITER dialogue is displayed, nothing special is happening. + If the repeat check is active, the handler verifies, if the current request is originated by a block device, that had been FAILed or ABORTed by the user earlier; if so and there occured less than 256 CRITERs til then, the request is silently FAILed, no dialogue is displayed. + In all other cases, the standard dialogue is displayed and the user is prompted for an action; if the action is either FAIL or ABORT, this particular block device will autofail the next 255 requests. ======================= There had been another suggestion by Eric Auer to autofail requests, if they come in a short time. In my opinion this idea is nice, if one can decide: + if the request is almost similiar as the last request, e.g. it would not make sense to autofail a request from a character device or another block device, when block device A: failed last time, + what when the reasons of the failings differ heavily, + how long is short. The currently implemented solution will help at very context specific operations, where it is less likely that many different CRITERs occure; e.g. searching through %PATH% may result in problems accessing block drives, is it really of any interest whether the find API call failed because of trouble in FAT or data portion? However, it would be useful to know, whether drives A: and C: fail, would it not? "DIR a:*.* >prn" may fail very often, because of out-of-paper conditions, therefore it does not seem helpful to autofail requests for character devices. Also, there is currently no operation that seems to be heavily effected by ignoreable CRITERs for character devices. ================================================ FILE: docs/cmt2.txt ================================================ $Id$ Batch file processing This document discusses the features and functionality of the batch file processing. It does not include help or explanation for the batch language itself. In the following "batch" files and the like are called "scripts" or "shell scripts" most of the time; the author assumes that most people running DOS/FreeCOM will associate the COMMAND batch language with this term. C> is an icon of the command line prompt an user is to enter commands at. It shall only visualize the interactive prompt and _not_ the particular drive C:. A '===' at the first column represents a section header. A '==' sourrounds file listings and, sometime, output of programs. === Invoking Shell Scripts Variant 1: Shell scripts are invoked like any command: SCRIPT arg1 arg2 arg3 arg4 ... argN out-file The arguments and the I/O redirection directives are optional, of course. Batch scripts are identified by the extension .BAT, it is currently not possible to execute a batch script without this file extension. This variant, however, empties the execution context, what means that any formerly nested script are "forgotten". In addition, FOR loops are destroyed, too. Variant 2: In order to nest script they must be invoked via the CALL command: CALL SCRIPT arg1 arg2 arg3 arg4 ... argN out-file The arguments and the I/O redirection directives are optional, again. Also, the scripts must have the file extension .BAT. Unlike to invoke scripts without CALL, the current position within the current script is preserved and the execution returns to the next command following the CALL command when the CALL'ed script finishes. FOR loops are destroyed nonetheless. EXAMPLE: == BATCH1.BAT echo In Batch1 - arg1 = %1 == BATCH2.BAT @echo off call batch1 first echo second call batch1 third == Invoking script BATCH2 from command line: C> batch2 would output: == In Batch1 - arg1 = first second In Batch1 - arg1 = third == Because there is no old execution context on command line, the user may invoke script BATCH2 with or without CALL; but if BATCH2.BAT would read: == BATCH2a.BAT @echo off batch1 first echo second batch1 third == Invoking the modified script BATCH2 from command line: C> batch2a would output: == In Batch1 - arg1 = first == Because to invoke a batch script without CALL destroys any former execution context, hence, the shell simply forgot where to return to when BATCH1.BAT ends. === Accessing Arguments The argument passed to a script are accessable through the automatic variables: %1, %2 through %9 (there is no trailing second percent sign). Variable %0 returns the name of script in the same way it has been written on invokation, e.g.: == BATCH.BAT echo %0 == C> batch batch C> BATCH BATCH C> batch.bat batch.bat C> .\batch.BAT .\batch.BAT Arguments may be separated on command line with: whitespaces, commas, semicolons ';' and equal signs '='. There is no known quotation mechanism. E.g.: == BATCH.BAT @echo :%1: :%2: :%3: :%4: :%5: :%6: :%7: :%8: :%9: == C> batch 1 2,3;4=5 6+7 :1: :2: :3: :4: :5: :6+7: :: :: :: The tenth and later arguments are not accessable directly; to fetch them the command SHIFT must be used. Each SHIFT increments a "shift level" by one and when using "%n", it is replaced by the "n + shift_level"'th argument, e.g.: == BATCH.BAT echo %0 SHIFT echo %0 SHIFT echo %0 == C> batch 1 2 3 batch 1 2 Please note that %0 is effected by SHIFT, too. There is no upper limit for SHIFT. If "n + shift_level" references to a non-existant argument, it is replaced by an empty string, aka by nothing. === Noisiness / Echo State ================================================ FILE: docs/cmt3.txt ================================================ $Id$ Command line parser Changes: single quotes and backticks are valid filename characters, their meta function as quotes is dropped therefore -- 2003-03-11 ska Unless stated otherwise, double quotes shall mark the beginning and the end of strings in the following examples. If the quotes shall serve a special function, strings are enclosed in [..]. + options are separated from arguments and other options, e.g.: "arg1/opt1/opt2" --> %1 == "arg1" %2 == "/opt1" %3 == "/opt2" + multiple option characters are preserved, e.g.: "///opt1//opt2" --> %1 == "///opt1" %2 == "//op2" + arguments and options have different delimiters, at the time: arguments: (isspace(ch) || iscntrl(ch) || strchr(",;", ch)) options: (isspace(ch) || iscntrl(ch)) This also results in different handling of the additional delimiters command and semicolon, e.g.: "1,2,3,/4,/5,/6 7;8;/9;10" --> %1 == "1" %2 == "2" %3 == "3" %4 == "/4," %5 == "/5," %6 == "/6" %7 == "7" %8 == "8" %9 == "/9;10" This is necessary, because options can use comma and semicolon on their own, e.g. LH's /L switch. Also note: This rule effects _internal_ commands and batch files only. + Any number of valid delimiters are interpreted as a single one. + Quotes are removed from the arguments, but hide any metafunction of enclosed characters. The current implemention knows only paired double quotes. Quotes can appear within words. In the following example any quotes are quotes written on command line: "1 2'3" "4 "567 "89/10" --> %1 == [1 2'3] %2 == [4 567] %3 == [89/10] Note: The 3rd argument contains the "/10", because the quotes remove the special meaning of '/'. BUT: If the very first character is a slash, the command line parser will still identify the argument as option, e.g.: "/123" /"456" --> %1 == [/123] %2 == [/456] COMMAND.COM of MS DOS 6 makes heavy useage of the three characters: comma ',', semicolon ';' and equal sign '='. Sometimes, but not always all of those three characters are ignored to extract tokens, sometimes any number, sometimes only a single character. FreeCOM now uses scheme described below when to ignore what character. Whitespaces, commas, semicolons and equal signs are ignored in any number when extracting tokens that are a) fixed words, b) filenames or c) options. The individual internal commands do treat those characters specially, but at places where one whitespace is allowed, there are allowed more than one always. Fixed words are the names of the internal commands, "IN", "DO", "EXIST", "ERRORLEVEL", but %v (in FOR), too. Filenames are the arguments of DEL, TYPE, FOR ()'s etc. For instance: C> ==FOR,%A,IN,(*.c,*.h),DO,ECHO %a is all correct. C> ECHO,,a will display ",a" ignoring the very first ',' only. C> IF,,a;;;==a====echo OK is all correct and will display "OK" ================================================ FILE: docs/cmt4.txt ================================================ How the COPY command works -- 1999/05/10 ska There are several curiosities about the COPY command: === Example: COPY a? + b? c? Files in current directory: a1, a2, a3, ba, bb, bc MS COMMAND: + Matches all files according the first parameter (a?). + The other parameters (b? and c?) are matched against the found entry, meaning any wildcard is expanded with the text of the first paramter. E.g. Three files are copied: COPY a1 + b1 c1 COPY a2 + b2 c2 COPY a3 + b3 c3 Regardless if the other parameters would match other or more files, e.g. because b1 does not exist, an error occures. 4dos: + Matches all pattern against the file system strictly from left to the right and concats them. The destination is matched against the first parameter. E.g. One file is copied: COPY a1 + a2 + a3 + ba + bb + bc c1 However, the order is unspecified, because DOS does not literally sort the entries as Unix does. (Maybe 4dos does, but I don't know.) === Example: COPY a? + b? cc? Files in current directory: a1, a2, a3, ba, bb, bc 4dos: + As above, but the files 'cc' is created. MS COMMAND: + Matches as above, but: COPY a1 + b1 cc COPY a2 + b2 cc COPY a3 + b3 cc That means if b[1-3] would exist, COPY would overwrite CC each time. === Example: COPY /a a + /b b /a c d /b MS COMMAND and 4dos: + The first '/a' and the last '/b' are ignored. + The switches are valid for all destination file specs right of the option and one spec left of it. + The option right of the destination spec is scanned before all other options are scanned. === + COPY will detect if it is copying a file to itself, even recursively, e.g.: COPY *.c + *.1 *.1 However, COPY uses the TRUENAME DOS API function, which can fail. + COPY mimicks the MS COMMAND behaviour to expand wildcards. + COPY checks before overwriting the output file, if it already exists with a read-only open call. + COPY opens devices (source files only) as ASCII by default, if no switch was specified. Otherwise files are opened in BINARY mode. An ^Z is appended only, if the /A switch was specified. + /-A is not the same as /B, but /A disables /B (and visa verce) + "COPY a+b a" is the same as: "COPY a+b ." and "COPY a+b", the latter one is a short form of "COPY a+b ." ================================================ FILE: docs/cmt5.txt ================================================ option parser -- 1999/07/09 ska All internal commands and the arguments of COMMAND.COM itself are scanned and parsed by the same set of functions. This shall serve as a way that everything within FreeCom behaves the same, the user need not use a different syntax for different _internal_ commands. This document describes how the parser works and which functions are available. === How a command line is interpreted (parsed) Most options are parsed as so-called global options. That means that it is not significat at which place of the command line they appear, e.g.: "DIR /w *.c *.txt" is equal to: "DIR *.c /w *.txt" and "DIR *.c *.txt /w". Options, that do not follow this rule, are specially remarked in the description of the particular internal command. Two well-know exception shall be included here: i) /A and /B of the COPY command are local options, e.g.: COPY file1/a + file2 + file3/b fileOUT file1 and file2 are effected by the /A option, whereas file3 and fileOUT are effected by /B ii) the /C option of FreeCom itself don't follow any common rule for option, because anything right of it (except one optional argument sign) is interpreted as an argument for this option. Note: CALL command is similar, except it supports several optional arguments then batch filename followed by its arguments === How an option is parsed The way how a command line is broken into individual components is already described in file CMT3.TXT. There the way is described how options are separated from themselves and arguments. This section describes how each individual option is parsed. The syntax of an option looks like this: option ::= '/' boolean_sign option_name boolean_sign argument . boolean_sign ::= | '+' | '-' . option_name ::= single_character_option | longname_option . argument ::= | argument_sign string . argument_sign ::= ':' | '=' . single_character_option ::= character . longname_option ::= character character | character longname_option . character ::= <> . string ::= <> . Please note that: + empty options are ignored. + both argument and boolean sign are optional, the option itself is not. + the option name itself must not contain the special characters used to identify boolean signs or the argument sign. + if the option name has a length of more than 1 character, it is considered to be a longname option, otherwise it is a single character option. + single character options cannot be combined as in the Unix-style. + arguments must be separated from the option name by an argument sign. + the boolean sign may lead or trail the option name. + syntactically both boolean sign(s) and an argument are accepted. + anything right of the argument sign is not interpreted by the option parser at all. After the syntactical check of the option a semantical check is performed. Unlike the syntactical one the semantical check is initiated by the command the options are scanned for. Currently, there are three semantical contexts an option can be interepreted as: 1) string, 2) integer, and 3) boolean. Type 1: string, data type: (char *) - The option requires that an argument is present. - The argument may be empty, which is represented by char[] = { '\0' } rather than a NULL pointer. This can be used to detect if the option was specified at all. - If the option is specified more than once, the rightmost argument superceeds all previous ones. - The argument string is not changed in any way, except the quotes are already removed by the command line scanner, which is executed _before_ the option parser. Type 2: integer, data type: (int) - The option requires that an argument is present. - The argument must not be empty. - The argument must be an unsigned 16-bit value. (no overflow test) - The rightmost argument superceeds any previous value. Type 3: boolean, data type: (int) - The option must not be used with an argument. - If both a leading and a trailing boolean sign are given, the trailing one superceeds the leading one. - If the '+' (plus) sign is specified, the option value is set to "1" (one). - If the '-' (minus) sign is specified, the option value is set to "0" (zero). - If no boolean sign is specified, the option value is toggled between "1" (one) and "0" (zero). That means "1" is transformed into "0" and "0" into "1". Examples: <> /+l-=47 If scanned as string --> "47" If scanned as integer --> 47 If scanned as boolean --> error, because argument is present /+l-= If scanned as string --> "" If scanned as integer --> error, because empty argument is present If scanned as boolean --> error, because argument is present /+l- If scanned as string --> error, because no argument is present If scanned as integer --> error, because no argument is present If scanned as boolean --> 0, trailing '-' superceeds leading '+' /l If scanned as boolean --> !original_value_of_option_L /l/l If scanned as boolean --> !!original_value_of_option_L <-> usually no change at all, if it was "0" or "1" before. /l/+l If scanned as boolean --> "1", because /+l assigns regardless of the previous value /msg longname option "msg"; toggles if scanned as boolean /msg- longname option "msg"; zeros if scanned as boolean == The interface to the implemented functions The option parser is implemented as a callback service: The user (in this case the function that shall perform the internal commands) invoke one of the parser functions (see below) and pass along a function (which is called back from the invoked ones) that assigns a semantic to each individual option already passed the syntactical check. The interface of the set of functions is separated into the files CMDLINE.C and CMDLINE.H, it mainly consists of functions to invoke the option parser and functions invoked by the callback function to actually parse the option under a specific semtantic. a) Callback functions MUST be defined using the macto optScanFct(), e.g.: optScanFct(opt_copy) { /* ... */ } Defines a callback function with the name "opt_copy". Note that these functions are static. Within the body of a callback function two variables are officially available: - "ch" is the name of the single character option; if the current option is a longname option, ch is 0 (zero). - "arg" is a (void*) pointer passed along with the callback function to one of the parser functions. Three other variables are passed, though, it is possible that they change in the future: - "optstr" is the longname option. It is also valid for single character options. - "strarg" is a pointer to the associated argument, or NULL if none is present. The argument is no longer available, once the callback function returns. - "bool" is the active boolean sign: -1 <-> '-', +1 <-> '+', 0 <-> none Callback functions return a value identifying the failure of the semantic check: E_None specifies success, everything else some sort of failure. See below for a detailed description. If possible, use the following semantic functions to make use of this information. These function must not be used outside of a callback function! b1) void optErr(void ) prints "Invalid option - %s" b2) int optLong(char *optname) checks if the current option is a longname option of the given name. 'optname' must be uppercased. b3) int optScanString(char *lvalue) int optScanInteger(int lvalue) int optScanBool(int lvalue) Checks and interpreters (on success) the current option into the given variable. Note: Actually these functions are macros that take an address of the passed values, so they must be valid l-values! This three functions parses the option as described above and issue an error message on failure. c) The callback function itself is called by one of these parsers: c1) int leadOptions(char **line, optScanner fct, void * const arg); Scan and parse all options at the beginning of the line "*line", but do not skip any argument. 'line' is a pointer to the (char*) object with the beginning of the line to be scanned and parsed. On exit, this value is updated with the first position that could not be parsed as an option. 'fct' is the pointer to the callback function. If NULL, any option generates an error. 'arg' is passed unchanged to the callback function. The function returns the return value of the last call to the callback function. This functions exits if the callback function returns with an exit code different of E_None or E_Ignore. c2) char **scanCmdline(char *line, optScanner fct, void * const arg, int *argc, int *opts); Scan and parse a complete line into an array. 'line' is a pointer to the line to be broken into individual arguments or parsed as options. 'fct' is the pointer to the callback function. If NULL, any option generates an error. 'arg' is passed unchanged to the callback function. 'argc' is a pointer to an (int) object, which is updated with the number of arguments (non-option arguments) into which the line has been broken. 'opts' is a pointer to an (int) object, which is updated with the number of successfully parsed options. This function returns: NULL: on failure (the error message has been issued already) else: a pointer to a dynamically allocated array of pointers to also dyncamically allocated strings representing the individual arguments. This array has (*argc + 1) elements, the last one, (*argc) itself, is NULL. This functions fails if the callback function returns with an exit code different of E_None or E_Ignore. == Error codes E_None = 0, No error, is always 0 (zero) E_Useage = 1, useage error E_Other = 2, unspecified error E_CBreak = 3, ^Break pressed E_NoMem, out of memory condition E_NoOption, parsed option is no "real" option E_Exit, exit program as soon as possible E_Ignore ignore this option == Implementation example #include "cmdline.h" int optP, optC; char *optMSG = NULL; optScanFct(opt_xmpl) { switch(ch) { /* parse single character options */ case 'P': return optScanBool(optP); case 'C': return optScanBool(optC); /* parse longname options */ case 0: if(optLong("MSG")) return optScanString(optMSG); } optErr(); return E_Useage; } xmpl(char *line) { char **argv; int argc, opts; /* Initialize the default settings of the options */ optP = 1; optC = 0; /* Kill the left-over of the previous call to xmpl() */ free(optMSG); optMSG = NULL; argv = scanCmdLine(line /* line to scan & parse */ , opt_xmpl /* callback function */ , NULL /* no local 'arg' */ , &argc, &opts); /* pointers to the counters */ if(!argv) /* Failed */ return EXIT_FAILURE; printf("The line had %u options.\n", opts); printf("The current state of the /P option is: %s\n", optP? "on": "off"); printf("The current state of the /C option is: %s\n", optC? "on": "off"); printf("The current valus of the /MSG option is: %s\n" , optMSG? optMSG: "<>"); if(argc) { int i; puts("The arguments of the line are:"); for(i = 0; i < argc; ++i) printf("arg[%u] == \"%s\"\n", i + 1, argv[i]); } else { puts("No non-option argument found."); } freep(argv); /* free the argument array, NOTE THE 'p' */ return EXIT_SUCCESS; } == General reflections 1) The callback mechanism allows a very flexible association between a syntactical correct option to a semantic. However, if other semantics are needed, the optScan***() function set should be improved rather than locally implemented into the callback function. 2) If the switch() statement in the callbacl functions are kept as showed (meaning: "return optScanBool(var);") for all the entries, Borland C's code optimizer generates something like this: is_L: mov ax, OFFSET optL jmp short ?1 is_P: mov ax, OFFSET optP jmp short ?1 is_C: mov ax, OFFSET optA jmp short ?1 is_X: mov ax, OFFSET optX ?1: push ax ... call _optScanBool ... ret Good enough?! 3) The mechanism allows two non-standard things currently: 3a) to leave options within the argument array, as used within COPY to tread /A and /B as local options, thus, bypass them in the first run to catch all the global options. See COPY.C for implementation details. 3b) to use options for something totally different, as used for the /C option of FreeCom itself. See INIT.C for implementation details. ================================================ FILE: docs/cmt6.txt ================================================ MUX-AE handler -- 2000/12/10 ska I. Overview The MUX-AE handler allows TSRs and alike programs to install extensions to COMMAND, hence this function is called "Installable Commands". Note: The innerworking of the MUX-AE interface has been revised heavily by Eduardo Casino, mail appended. There are two subfunctions (quote from RBIL): --------l-2FAE00----------------------------- INT 2F U - DOS 3.3+ internal - INSTALLABLE COMMAND - INSTALLATION CHECK AX = AE00h DX = magic value FFFFh CH = FFh CL = length of command line tail (4DOS v4.0) DS:BX -> command line buffer (see #02977) DS:SI -> command name buffer (see #02978) DI = 0000h (4DOS v4.0) Return: AL = FFh if this command is a TSR extension to COMMAND.COM AL = 00h if the command should be executed as usual Notes: This call provides a mechanism for TSRs to install permanent extensions to the command repertoire of COMMAND.COM. It appears that COMMAND.COM makes this call before executing the current command line, and does not execute it itself if the return is FFh. APPEND hooks this call, to allow subsequent APPEND commands to execute without re-running APPEND SeeAlso: AX=AE01h Format of COMMAND.COM command line buffer: Offset Size Description (Table 02977) 00h BYTE max length of command line, as in INT 21/AH=0Ah 01h BYTE count of bytes to follow, excluding terminating 0Dh N BYTEs command line text, terminated by 0Dh Format of command name buffer: Offset Size Description (Table 02978) 00h BYTE length of command name 01h N BYTEs uppercased command name (blank-padded to 11 chars by 4DOS v4) --------l-2FAE01----------------------------- INT 2F U - DOS 3.3+ internal - INSTALLABLE COMMAND - EXECUTE AX = AE01h DX = magic value FFFFh CH = 00h CL = length of command name (4DOS v4.0) DS:BX -> command line buffer (see #02977) DS:SI -> command name buffer (see #02978) Return: DS:SI buffer updated if length byte is nonzero, the following bytes contain the uppercase internal command to execute and the command line buffer contains the command's parameters (the first DS:[SI] bytes are ignored) Notes: this call requests execution of the command which a previous call to AX=AE00h indicated was resident APPEND hooks this call === FreeCOM implements the functionality as FEATURE_INSTALLABLE_COMMANDS and performs the actions as described as follows. II. Order of Execution This pseudocode of how FreeCOM interpretes a parsed command line shall demonstrate the internals and differences from other implementations. 1. Expand environment variables 2. Extract any redirections and decompose pipes in result the command line buffer DS:BX does not contain any ">", "<" or ">>" metacommands nor does a pipe appears in the buffer -- this may be a violation of compatibly as the example in Undocumented DOS by Schulmann contains code handle redirections, thus, it opens the possibility that an Installed Command would be allowed to kill pending commands of a pipe. 3. Extract the first command name (first non-blank word fully constructed out of characters permisable in filenames, but excluding colon, dot, and backslash). 4. If found a word, pass it through MUX-AE-00, on success MUX-AE-01 is called. If now BYTE DS:[SI] == 0, the interpretation of the command stops. 5. Search the internal commands list for the word left in STRING DS:[SI+1]. If found, it is executed with the command line arguments starting at STRING DS:[BX+2+(DS:[SI])]. Note: DS:[SI] is the length of the command on return of MUX-AE-01. Then the interpretation of commands stops. -> RBIL does not mention any minimum length requirements for the STRING DS:[SI] buffer. FreeCOM passes a full BUFFER_SIZE_MUX_AE (currently 255 bytes) buffer to MUX-AE. 6. Steps 4 and 5 are repeated until MUX-AE-00 returns false. 7. The original command line is tried as either drive change ("?:" syntax) or external command. Note: Any change of both the command name buffer (DS:[SI]) and command name buffer (DS:[BX}) are ignored. III. Incompatiblies - In earlier versions FreeCOM used the command line buffer (DS:[BX]) to execute an external command, if applicable; thusm allowing an extension to re-write the command line. This is NO LONGER so, for compatibly with MS COMMAND. - FreeCOM always uses BYTE DS:[BX+1] to determine the length of STRING DS:[BX+2]. If an Installed Command wants to change the arguments, this byte must be updated. - FreeCOM supports the 4dos v4 extensions mentioned by RBIL. - As FreeCOM has no meaning of "transient" portion, the segment registers simply point to the strings. DS == ES always. This may vary in future! - If an extension rewrites the command, FreeCOM is to call MUX-AE again. This might lead to an infinite loop. In order to prevent such situation, FreeCOM calls the MUX-AE chain only a limited number of times, which can be customized through the MUX_AE_MAX_REPEAT_CALL setting of CONFIG.H. IV. Side definitions - The buffer DS:BX will always be larger than 12 bytes: 11 bytes (as 4dos v4 blank padded) + 1 byte (length byte) + 1 byte ('\0' byte at 13th position) - The string at DS:[BX+2] is terminated by '\xd' and '\0' on entry to MUX-AE-00. There will always be a '\0' character at DS:[BX+2+[DS:BX]], thus the byte following the last byte, which is part of the string. - If at any time BYTE DS:[BX+1] becomes greater than or equal to BYTE DS:[BX], FreeCOM aborts due to possible memory hazard. V. Installable Command samples The TOOLS subdirectory contains several samples of Installable Commands. They shall verify a working MUX-AE interface and are not meant as something useful, hence, they are simple and display a lot of debugging information. LOAD_ICD.C implements the loader. ICMD_*.NAS implement various samples. They are NASM sources and must be compiled using this command: C> NASM -f bin ICMD_#.NAS In result a ICMD_#.ICD is created. The format of such sample is: 1. The MUX-entry point is the very first byte of the file. 2. A validation area is located at the end of the file: begin of file --> entry point code BYTE Pascal string of the name of Installable Command WORD offset within file to DWORD of where to write the original value of INT-2F to in order to be able to chain the interrupt WORD offset within file to write the name to (see above) BYTE value 0 (zero) .... comment <> .... Installable Command Image ID (see LOAD_ICD.C) During the load and installation of the Installable Command by LOAD_ICD the filename without path nor extension is placed as Pascal string at the position mentioned within the validation record. The last byte of the name is the last byte of the residently installed image of the Installed Command, too. The name is displayed within debug messages and is the name of the newly installed internal command. Because LOAD_ICD updates the name during the load of the Installable Command, the same Installable Command can be installed with different names by copying the file to a different file. VI. Examples NOTE: This section is out-dated! 1) The simplest form is an Installable Command that performs any action itself. -> MUX-AE-00 returns AL == 0xFF -> MUX-AE-01 performs the action and returns DS:[SI] == 0 2) Map an Installable Command into another internal command. -> MUX-AE-00 returns AL == 0xFF -> MUX-AE-01 modifies Pascal string of command name at DS:[SI] 3) Map an Installable Command into an external command -> MUX-AE-00 returns AL == 0xFF -> MUX-AE-01 modifies Pascal string of command name at DS:[SI] Note: DS:[BX+2] must be checked that it contains no path delimiter character, that are colon ':', backslash '\\', nor dot '.'. Otherwise the remaining command line tail will be appended to the command name and will complete the name passed back within DS:[SI]. Internal as well as Installable Commands are separated by such characters! E.g.: Installable Command "GO" and maps to "WALK" C> GO\THERE --> GO rewrites the command "GO" into "WALK" and then appends the remaining command line tail and, in result, performs: C> WALK\THERE To overcome this problem GO must rewrite the command line tail, too, by inserting a blank at position DS:[BX+DS:[SI]]. (DS:[SI] is the length of the original command name, 2 in this example.) --> C> WALK \THERE 4) Disable an internal command. -> MUX-AE-00 returns AL == 0xFF -> MUX-AE-01 returns DS:[SI] == 0 The Installable Command must be named equal to the internal command, e.g.: Installable Command "DEL" will disable the internal command DEL and any external one, too. VI. Clarifying mail by Eduardo Casino Hello, El jue, 10-06-2004 a las 15:25, FreeCOM escribi: >> there is another testing release of FreeCOM that should fix the MUX-AE >> issue. Would you please test it? >> http://freedos.sourceforge.net/freecom/packages/TESTING/ It works perfectly with FD APPEND, but... >> It has, however, one known incompatibly with MS DOS: >> >> It occurs to me that MUX-AE is called recursively (or repeatedly) when >> MUX-AE-00 returns 0xFF (true), but MUX-AE-01 returns with DS:[SI] != 0 >> (aka TSR re-wrote the command, but did not executed it itself). >> FreeCOM does not do this, but calls the MUX-AE pair only one time. Do >> you know something more about this? I've written a group of silly test programs to check this and the conclusions are: When returning from MUX-AE-01 and DS:[SI] != 0, MS COMMAND.COM, again, checks DS:[SI+1] and: * If it is an internal command, executes the internal command without calling again MUX-AE. * If it is not an internal command, calls MUX-AE-00 to check if it is an extension. In this case, executes the extension using MUX-AE-01. * If it is not an extension, no matter what the content of DS:[SI+1] is, tries to load and execute the _typed_ command from disk and with its _original_ arguments, no matter if the extension has modified the command line buffer. Example 1: Extension to DIR Imagine that this extension just prints "I'm DIR!" and then: Case a) DS:[SI] unmodified. The internal DIR command is executed (you get the directory listing.) This is just the same as the next case. Case b) DS:[SI] contains 4, "ECHO" (or any other internal command). As this is an internal command, it is executed. Case c) DS:[SI] contains 3, "BAR" (or anything that it is not an internal command). MUX-AE-00 is called and, if the "BAR" extension exists, it is executed with MUX-AE-01. If it doesn't, the shell tries to execute DIR from disk (DIR.BAT, DIR.COM or DIR.EXE) Example 2: New extension "FOO" In this case, it prints "I'm FOO!" and then: Case a) DS:[SI] unmodified. The shell looks for the internal command "FOO". As it does not exist, calls MUX-AE-00 and finds that it is an extension, so it executes it using MUX-AE-01 and enters an endless loop. This is, in fact, the same as case c. Case b) The same as for example 1. Case c) The same as for example 1, but now it tries to execute "FOO" (FOO.BAT, FOO.COM or FOO.EXE) For all cases in both examples, the shell uses the arguments in the command line buffer (ignoring the first _updated_ DS:[SI] bytes), except if command is not an extension in case c. With FreeCOM 0.82pl3q two incompatibilities (or differences in implementation ;-)) remain: The first one is what you comment about FreeCOM calling the MUX-AE pair only once. This prevents the looping problem, that's true, but extensions should not allow this to happen. And if an extension tries to execute another extension on exit, it won't work with FreeCOM, because it won't call the MUX-AE functions again. The second difference is that FreeCOM, at exit of the MUX-AE-01, uses the arguments in the _updated_ command line buffer when it executes the typed command from disk (when the command name buffer contains something that it is not an internal command nor an extension) instead of the _original_ command line, like MS-DOS does. These two programs show the incompatibilities: http <> perso.wanadoo.es/samelborp/test1.asm http <<>norobot> perso.wanadoo.es/samelborp/test2.asm test1.asm - Installs two extensions: FOO and BAR. FOO prints "Hello, I am FOO!" and, on exit, calls BAR. BAR prints "Hello, I am BAR!" and terminates". With MS-DOS, if you type "FOO" you see this: C:\> FOO Hello, I am FOO! Hello, I am BAR! With FreeCOM, you get: C:\> FOO Hello, I'm FOO! Bad command or filename - "FOO". test2.asm - Installs the extension "MORE". It prints "Hello, I am MORE!" and, on exit, modifies the command name buffer with 8, "XXXXXXXX" and the command line buffer with 11, "MORE XX.TXT", 13 . If you have a TEST.TXT file with the line "This is a test.", in MS-DOS you get: C:\> MORE TEST.TXT Hello, I am MORE! This is a test. (MORE is executed with the original arguments) With FreeCOM you get: C:\> MORE TEST.TXT Hello, I am MORE! MORE: XX.TXT: No such file (MORE is executed with the modified arguments) WARNING: The programs are horrible, quick and dirty hacks with the only purpose of showing the incompatibilities. Please, do not use them against me ;-) Regards, Eduardo. ================================================ FILE: docs/cmt7.txt ================================================ Permanent data storage within external memory block -- 20001/03/30 ska FreeCOM utilizes several information that need to keep the same when it gets reloaded. The current implementation, esp. ALIAS, command line history, directory stack and batch nesting level, maintain their own data within a module-local (aka static) data structure that is usually dynamically extended into the heap. ALIAS and batch processing use single linked lists, history and dirstack use a single memory block. During a swap of FreeCOM this information must be restored to its values, though, it need not be replicated exactly the same. For instance, if the "last command line" returns the same line, it is uninteresting where this information comes from. When this information is stored external to FreeCOM right away, there is no need to take special care about when FreeCOM swap, but it will require more time as "external" usually means that these locations cannot be addressed with near addresses, which are the default and fastest ones. There is already one data that is maintained external to FreeCOM, the block of environment variables. This block must be present in its format and syntax, because 3rd party tools are silently allowed to modify its contents. An environment segment is a simple structure, though, mainly implemented to store character strings within it: =\0 =\0 ... =\0 \0 Per convention ""s are printable characters except the equal sign itself. ALIASes are by nature already expressed in this syntax. Entries of the command line history and the directory stack can also be expressed as such strings easily. Even the batch nesting can be easily written as a string. However, there must be a way to distinguish all different kinds of information stored within such pseudo-environment. Under the prerequisite that almost all 3rd party tools honor the convention that names are constructed out of printable characters, non-printable characters look fine; the low-level functions already implemented and used by FreeCOM to access an environment segment don't care at all about the name of the variable as long as it does not contain no equal sign or NUL character. Some information, for instance how many entries the history or the directory stack contains, could be located in this block as well, though it is not really required, because FreeCOM already utilizes a so-called "static" context, which primarily serves as interface between the higher and lower portions of the swapping process, but had been designed to include other data as well since its beginning. The main reason to split permanent information across two structures, the so-called static and dynamic contexts, arise from the fact that the amount of and even the maximal user-specified size of such information changes heavily at runtime. To have the static context firmly rooted in the memory of the systems allows to place vital functions within there, e.g. the Critical Error handler, without to worry about what happen if to resize the context fails. The static context will reference to the associated dynamic context, which, if lost, is rebuilt by FreeCOM easily, though, with 100% loss of all information stored within there. The slightly modified format of the dynamic context looks like this: =\0 ... \0 is a single character that specifies the kind of information stored in this line. has been choosen like this: \2 -> entries of the command line history (A) \3 -> entries of the directory stack (A) \4 -> last directory (B) \5 -> batch nesting level (A) \6 -> swapinfo \7 .. ' ' -> reserved for future use '!' .. -> alias To let the aliases allocate all the remaining tags has the slight side effect that the syntax of aliases is the same one as of environment variables; and because the syntax of the commands SET and ALIAS is nearly the same one as well, both commands can share a lot of code. Here, SET is to ignore all entries with a non-printable first character. === Theoretical notes: + The lowlevel functions to maintain an environment segment are known, so it is possible to rely on this or that implementation, e.g. new entries are always appended to the end of the environment and existing entries are changed in place. That means if a variable, e.g. with an empty name or unknown tag is create at the very beginning of the environment, FreeCOM can rely on that the value of the variable is located at easily calculatable addresses. Though, the value must not contain no NUL characters. + The memory block must be located in its own DOS memory block, because the lowlevel functions rely on information located in the MCB preceeding the environment segment -- esp. to aquire the length of the segment from. === At this time not every instance of FreeCOM maintains a static context, hence, there is no dynamic context by default. So for this time, the values that should normally go into the static context are implemented as global variables and are saved/restored into the static context on swap. ================================================ FILE: docs/cmt8.txt ================================================ $Id$ Batch file processing -- 2001/04/26 ska This document discusses the features and functionality of the batch file processing. It does not include help or explanation for the batch language itself. In the following "batch" files and the like are called "scripts" or "shell scripts" most of the time; the author assumes that most people running DOS/FreeCOM will associate the COMMAND batch language with this term. C> is an icon of the command line prompt an user is to enter commands at. It shall only visualize the interactive prompt and _not_ the particular drive C:. A '===' at the first column represents a section header. A '==' sourrounds file listings and, sometime, output of programs. === Invoking Shell Scripts Variant 1: Shell scripts are invoked like any command: SCRIPT arg1 arg2 arg3 arg4 ... argN out-file The arguments and the I/O redirection directives are optional, of course. Batch scripts are identified by the extension .BAT, it is currently not possible to execute a batch script without this file extension. In this variant, however, empties the execution context, what means that any formerly nested script are "forgotten". In addition, FOR loops are destroyed, too. Variant 2: In order to nest script they must be invoked via the CALL command: CALL SCRIPT arg1 arg2 arg3 arg4 ... argN out-file The arguments and the I/O redirection directives are optional, again. Also, the scripts must have the file extension .BAT. Unlike to invoke scripts without CALL, the current position within the current script is preserved and the execution returns to the next command following the CALL command when the CALL'ed script finishes. FOR loops are destroyed nonetheless. EXAMPLE: == BATCH1.BAT echo In Batch1 - arg1 = %1 == BATCH2.BAT @echo off call batch1 first echo second call batch1 third == Invoking script BATCH2 from command line: C> batch2 would output: == In Batch1 - arg1 = first second In Batch1 - arg1 = third == Because there is no old execution context on command line, the user may invoke script BATCH2 with or without CALL; but if BATCH2.BAT would read: == BATCH2a.BAT @echo off batch1 first echo second batch1 third == Invoking the modified script BATCH2 from command line: C> batch2a would output: == In Batch1 - arg1 = first == Because to invoke a batch script without CALL destroys any former execution context, hence, the shell simply forgot where to return to when BATCH1.BAT ends. === Accessing Arguments The argument passed to a script are accessable through the automatic variables: %1, %2 through %9 (there is no trailing second percent sign). Variable %0 returns the name of script in the same way it has been written on invokation, e.g.: == BATCH.BAT echo %0 == C> batch batch C> BATCH BATCH C> batch.bat batch.bat C> .\batch.BAT .\batch.BAT Arguments may be separated on command line with: whitespaces, commas, semicolons ';' and equal signs '='. There is no known quotation mechanism. E.g.: == BATCH.BAT @echo :%1: :%2: :%3: :%4: :%5: :%6: :%7: :%8: :%9: == C> batch 1 2,3;4=5 6+7 :1: :2: :3: :4: :5: :6+7: :: :: :: The tenth and later arguments are not accessable directly; to fetch them the command SHIFT must be used. Each SHIFT increments a "shift level" by one and when using "%n", it is replaced by the "n + shift_level"'th argument, e.g.: == BATCH.BAT echo %0 SHIFT echo %0 SHIFT echo %0 == C> batch 1 2 3 batch 1 2 Please note that %0 is effected by SHIFT, too. There is no upper limit for SHIFT. If "n + shift_level" references to a non-existant argument, it is replaced by an empty string, aka by nothing. === Noisiness / Echo State ================================================ FILE: docs/comments.txt ================================================ cmt1.txt - Redesign of command line parser for internal commands cmt2.txt - Batchfile processing cmt3.txt - Command line parser cmt4.txt - How the COPY command works cmt5.txt - option parser cmt6.txt - MUX-AE handler cmt7.txt - Permanent data storage within external memory block cmt8.txt - Batch file processing cmt9.txt - Context - Description of Interface, Structure and Useage cmt10.txt - Critical Error Handler Repeat Check Autofailer ================================================ FILE: docs/compile.txt ================================================ Compile notes: NOTE: Use NASM version 0.98.35 or later! When building on Windows a native (win32 or win64) version is recommended. There is a more detailed description located here: http://freedos.sourceforge.net/freecom/build48.html 1) Setup a compiler: TC++ v1.01 (see www.freedos.org, Links page for a reference to Borland's museum site), TC 2.01, Borland C++, Open Watcom (www.openwatcom.org), or ia16-elf-gcc (github.com/tkchia/gcc-ia16). 2) Configure CONFIG.MAK (see below) 3) Configure CONFIG.H (see there) 4) Run BUILD.BAT** or build.sh (cross compilation from Linux or MinGW/MSYS) (Some newer MAKE variants may require a space between the -f option and the makefile name. On trouble try to fix BUILD.BAT.) ** BUILD.BAT and build.sh accept to following options: C> BUILD.BAT [-r] [clean] [no-xms-swap] [debug] [compiler] [language] -r Rebuilt (clean previous files before proceed) clean remove *.COM, *.OBJ, *.LIB etc. files, then exit no-xms-swap create FreeCOM without XMS-Only Swap support debug enable debug code in FreeCOM compiler one of wc, tc, tcpp, bc (build.sh: wc or gcc only) language sets the specified language as the default build language You will find two executables in the FreeCOM directory: SHELL\COMMAND.EXE and COMMAND.COM. The .COM file is the stand-alone application, which includes the strings etc, whereas COMMAND.EXE is the pure executable without the strings table for instance. NOTE: A message like "Fatal: command line too long" was always caused during my tests by an invalid settings in CONFIG.MAK, esp. CC_BASE_PATH and NASM! CONFIG.BAT (copied from CONFIG.B) This is the central file to tweak options and environment settings regarding your compiler. COMPILER default compiler to use, if none of tc, tcpp, bc, or wc is given. TC2_BASE TP1_BASE BC5_BASE WATCOM base paths (aka "root") for Turbo C 2.01, Turbo C++ v1.01, or Borland C++; usually it is sufficient to modify this macro and all files (headers and libraries) and programs (C compiler and linker) will be found. If not, check the macros at the end of the file and/or the usage of $(LIBPATH) within COMMAND.MAK or STRINGS.MAK respectively. For Open Watcom, the WATCOM environment variable can be adjusted, if it is not already set. Update XNASM as needed, if "nasm" is not in your PATH. CONFIG.MAK (copied from CONFIG.STD) This is the central file to tweak other options and environment settings. SUPPL_INC_PATH / SUPPL_LIB_PATH To compile this version of command.com, you have to add the SUPPL library. SUPPL_INC_PATH points to the directory with all the header files, whereas SUPPL_LIB_PATH contains the pre-compiled library (SUPPL_S.LIB). Due to popular demand, a variant of SUPPL is integrated into the FreeCOM release and both settings are pre-configured so that the BUILD.BAT script will pick up the library automatically. Note: See the SUPPL\README.TXT file, if you wish to NOT use the integrated SUPPL variant. Update NASMFLAGS as needed. SHELL_MMODEL is the memory model used to compile the shell. It should be Small (s), unless you want to include debugging support; use Large (l) in such case. $(CFG): $(CFG_DEPENDENCIES) ../config.mak This rule is used to create the default option file for the compiler. It should set the header and library search paths and the memory model, disable floating point arithmetics (as it is not used by FreeCOM). The default char type should be unsigned. There are no known specific alignment or optimization settings, configure as you wish. === [this step is optional, recommended to just use included mini SUPPL library] To compile the SUPPL library as well do this: + download the source code from where SUPPL\README.TXT points to + use one of the COMPILER\* preparations -or- : DEL cfg*.* : DEL STRBOOL*.* : DEL t.c : CALL MKDYNSRC.BAT : compile all remaining *.c files : check if it is necessary to meddle with any of the assembly files and compile them if needed : archive all created object files -- usually named .OBJ or .O -- into a library named SUPPL_#, where # is S for Small memory model or L for Large. + copy all the INCLUDE\*.H files and the library from the SUPPL release into FREECOM\SUPPL -or- update CONFIG.MAK to let SUPPL_???_PATH point to the SUPPL directory ================================================ FILE: docs/contrib.txt ================================================ Contributions are welcome! Currently the best way to submit a patch is via a pull request (PR) on GitHub - see https://github.com/FDOS/freecom Discussion and patches may also be done via the FreeDOS developer mailing list or by attaching a patch to an issue on GitHub. Most wanted changes are: - translations, fixing any that may need updating or adding new languages - bug fixes, see Issues on GitHub site and bugs on Sourceforge https://sourceforge.net/p/freedos/bugs/ - improvements or compability fixes, i.e. new or update existing commands to better match MS COMMAND.COM or 4DOS Thank you. ================================================ FILE: docs/download.txt ================================================ You can download pre-compiled variants of FreeCOM from: https://github.com/FDOS/freecom For each language supported, a zip archive is provided with the following versions: xmsswap: the latest FreeCOM with XMS-Only swap support kswap: the latest FreeCOM with kswap support plainedt: the latest FreeCOM without the command line editing enhancements (history, file complation) debug: the latest FreeCOM with debug information enabled And a developer package for localizer (to create new or maintaining existing *.LNG files), which includes latest FreeCOM (xmsswap with enhancements) and precompiled strings (*.dat) for each language along with the source (*.lng) language files and fixstrings.exe used to generate new strings.dat file. See included documentation for further details. ================================================ FILE: docs/faq.txt ================================================ $Id$ Frequently Asked Questions about FreeCOM Copyright (C) 2000 Steffen Kaiser current version v0.79b -------------------- Glossar FreeCOM: COMMAND.COM clone -------------------- Q: There is an error message like "Cannot open STRINGS.DAT"? There is no text for error messages. A: The actual string (or text) of messages has been outsourced from the program image to: a) save space and b) better support various languages. The strings are appended to the FreeCOM executable and are read from there each time a message is to be displayed. When you load FreeCOM from floppy, remove the floppy and an error occurs, FreeCOM tries to reload the messages from the FreeCOM executable, but because it is no longer there, the actual text cannot be loaded. If you invoke FreeCOM with the /MSG switch, the messages are permanently loaded into memory, in order to skip to reload them. Note: The messages are loaded on demand and are purged from memory when an external program is called, therefore problems show up at an unregular base. To visualize how loading and purging of messages work, compile FreeCOM with debug option enabled or grab the precompiled COM_DBG.COM, then run: Example 1 Step #1) COM_DBG.COM /k FDDEBUG ON [The "FDDEBUG ON" enables the debug output.] Step #2) Now try to invoke a _non_existing_ command. Among others you should see "[Messages successfully loaded to segment 0xeb7a]" (the actual segment will vary) and below the error message that had been loaded: "Bad command or filename.". Step #3) Now run an _external_ command, which produces as less output as possible (one line is best). You should see information "[Message segment deallocated.]" immediately preceeding the line, the program had produced. Step 4) Now try to invoke the _non_existing_ command again, the messages are reloaded. Step 5) Immediately try to invoke the _non_existing_ one again, the messages are _NOT_ loaded. This is as long you do not terminate the FreeCOM instance nor call an external command, the message remain in memory. Step 6) Exit the current copy of FreeCOM, the "deallocated" info will appear. ==== Example 2 Step #1) COM_DBG.COM /MSG /k FDDEBUG ON Now re-run Steps 2 through 6. You will see that the message stay in memory, except in step 6. ================================================ FILE: docs/files.txt ================================================ Archive Contents ~~~~~~~~~~~~~~~~ bugs.txt Bug List files.txt This file list history.txt History of the shell development license GNU license - applies to all files named here readme.md General shell info command.mak Borland C make file config.mak Makefile configuration model.def Model definition for make file alias.c Alias code alias.h Alias header file batch.c Batch file interpreter beep.c Implements beep command call.c Implements call command cls.c Implements cls command cmdinput.c Command-line input functions cmdtable.c Table of available internal commands command.c Main code for command-line interpreter command.h Command header file copy.c Copy command copy.h Header file for copy command date.c Date command code datefunc.c Get and set date functions for Pacific C compatibility del.c Implements del command dir.c Directory listing code dstack.c Directory stack commands (DIRS/PUSHD/POPD) echo.c Implements echo command environ.c Environment handling err_hand.c Critical Error Handling code err_hand.h Critical Error Handling header error.c Error Message Routines exec.c Exec C interface code filecomp.c Filename completion functions for.c Implements for command goto.c Implements goto command history.c Command-line history handling if.c Implements if command init.c Functions used in initializing command.com internal.c Internal commands (DIR, RD, etc) lh.asm Loadhigh assembler functions loadhigh.c Loadhigh C source loadhigh.h Loadhigh header file lowexec.asm Low-level exec functions model.def memory model for exec stuff misc.c Misc. Functions openf.c Handle CP/M style devices (i.e. CON:, LPT1:, etc.) openf.h path.c Implements path command pause.c Implements pause command prompt.c Prompt handling functions redir.c Redirection and piping parsing functions ren.c Implements rename command set.c Implements set command shift.c Implements shift command tempfile.c Re-implementation of tmpfile library function tempfile.h tempfile.c header file testenv.c Code to test environment passing time.c Time command code timefunc.c Get and set time functions for Pacific C compatibility truename.c Implements truename command type.c Type command code ver.c Implements VER command vol.c Implements VOL command where.c Code to search path for executables verify.c Implements verify command 28.com program to switch to 28-line mode 50.com program to switch to 43/50-line mode command.com COMMAND.COM executable TESTS/ Test files and documents STRINGS/ Strings file and program(s) to deal with them TOOLS/ various tools, see TOOLS/FILES.TXT ================================================ FILE: docs/history.txt ================================================ FreeDOS Command Line Interface Development History ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v0.86 ~~~~~ improved build support (fixes, improved makefiles, add TC support to CI) add quotes to command line ENV VAR if has space to better handle LFN commands fix IF "==" incompatibilities (version increment to avoid confusion with any prerelease builds) v0.85b ~~~~~ fix screen corruption that occurs when performing an editing command that clears the command line and the cursor is not at EOL fix an error that may overwrite 0x100 of a program when writing command line into PSP COPY: allow lowercase drive letter for destination COPY: Check that target drive exists and if not return the proper error code COPY: We shouldn't error if the target argument is a bare drive fix sort order when sorting by date AND time AND results compare identical, return sort by filename fix CTTY suitable for serial terminal via AUX (COMn) various NLS updates v0.85a ~~~~~ regression fix: ensure not setting errorlevel for all internal commands, exclude commands such IF FOR etc documentation update - merge/remove duplicate files, add history, general updates (links, email, etc) correct help for 'for' command, add %% escaping to printf so for command shows %a ... do ... %a instead of ?a ... do ... ?a use program exit code as errorlevel when using loadfix or loadhigh (unless error invoking program) compatibility improvement, don't print % when missing paired % on command lines (show 'somevar' not '%somevar') if COMSPEC isn't set, strdup an empty "" string instead of potential NULL pointer dereference add beginning of more comprehensive test batch file prevent debug builds crashing on startup, intr and lowexec needs to retf not retn for medium memory model builds (e.g.debug build) fix xms-swap debug build when returning from exec'd programs, fixup return segment and do a far return from xmsexec call v0.85 ~~~~~ From Kenneth J Davis support CMDLINE for command lines > 126 characters when invoking COMMAND.COM 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 misc batch file updates to aid in building multiple versions (languages/xmswap or not/compiler) 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 git should ignore generated files add files to GitHub so http://www.fdos.org/freecom/ directs to GitHub hosted content From Andrew Bird fix build due to language keyword in strings file got renamed improve fixstrs compatibility with gcc-ia16 multiple build fixes for Linux due to case sensitive filenames muttiple fixes to avoid git encoding issues for translations slightly improved French translations from @cardpuncher fix so fixstrs does not segfault on incorrect input add the remaining translations to the CI build setup CI build on GitHub using GCC-ia16 and Open Watcom, multiple improvements to CI build remove duplicate translation the translation 'yu852' is identical to 'serbian' so remove it Update README - convert to Markdown, add build status badge, add links for Changes and Compile text documents 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. fixstrs: fix invalid escape chars fixstrs: initialise version number, strupr should return the pointer passed in - fixes gcc warnings fixstrs: rename log variable - fix declaration mismatch build: Copy default file if config missing From lpproj dbcs fork add nls fallback, fix for running on DOS kernels that lack the nls API used Add build option `upx' to build a compressed execuable alias watcom=wc in build script Fix chcp report wrong codepage on old DOS before v3.30 (and v3.30 for NEC PC-9800 series) From p-durlej fork CLS: Use appropriate attribute values for common display modes. DIR: Fix DIR /O /W not putting newline before the summary. TYPE: Fix file open error handling TYPE: Fix partial read handling displayPrompt: prevent $P from being intermixed with INT 24H and phantom drive messages DEL: Fix printing the directory path when deleting all files From Jason Pittman Fix for multi-line commands in history, properly wrap and clear lines From Bart Oldeman Update French translation (corrected some grammatical errors) Add some more GCC options to reduce the size of command.com. Add comment about MinGW. From Sampo Hippelinen better GOTO help translation improve/add Finnish translation From Emir Sari Fix typo Improve Turkish translations - fixes ambiguities and overall improves current translations From Francesco Sacco allow internal commands set the ERRORLEVEL Minor fixes for pt-br. From ghderty Translations: Update russian translation From Darrin M. Gorski Allow non-permanent instances to exit with the last errorlevel instead of zero. v0.84pre7 ~~~~~~~~~ fix: Check for Win64 in Watcom makefile via %ProgramFiles(x86) (Bart) chg: Build xms-swap by default (Bart) fix: Use -fno-builtin for GCC to use libc/overridden functions everywhere (Bart) chg: Use -mregparmcall for GCC. Needs adjustment of intr() prototype (still stdcall) (Bart) chg: Add linker script command.ld so relocations can be used in NASM code for GCC via _TEXTSEG. (Bart) fix: Force 8086-asm; use direct call far real_XMSexec instead of push/push/retf. Fixes #15 (Bart) fix: Move termination hook into seperate file and always use independent of XMS. Closes #16 (Bart) fix: Fix loadhigh failure when zero-byte free memory block is exist (Sava, lpproj) fix: Allow escape of > < | via ^> ^< and ^|. Fixes #12. (Bart) fix: Fix build break on msys2 (with *-mingw32-gcc and ia16-elf-gcc) (Sava,lpproj) fix: LH/LOADFIX call execute instead of exec and skip bat files. Fixes #8. (Bart) fix: LOADFIX: stop manipulating UMB link, use first fit>0x10000. Fixes #10. (Bart) fix: dosGetUMBLinkState needs to return state in _AL, not _AX (see #10) (Bart) fix: Avoid possible NULL dereference in dprintf. Fixes #9 (Bart) fix: XMScopy needs to be declared noinline for GCC to work correctly. (Bart) fix: Fix "copy con file" where file already exists. (Bart) We need to use devopen instead of dfnstat to check for src existence. fix: Create and use sfn_creat() for dos_creatnew() redone. Also rename dos_creatnew() to sfn_creatnew(). Using creat instead of creatnew for file creation avoids the need for truncation using write(), and the handle can be directly used without needing to reopen the file. However, differently from the previous try, LFNs are still reopened for compatibility with Windows 2000/XP. (Bart) fix: dos_read and dos_write now call farread/write for all compilers. This is more consistent and fixes truncating writes for GCC. (Bart) fix: Fix lfnmkdir to really create LFNs; easiest to separate out. (Bart) fix: Don't use expensive open/close to check for SFN. Instead use the boolean, then put in extra check to see if int21/ax=7160 works. (Bart) fix: Add stack checking, adapted from Tom Ehlert (Bart) fix: Save another 520 bytes of stack by reusing buffers where safe. (Bart) fix: myfnsplit(): use common buffer to store dir/name/ext to save stack space. This saves ~1250 bytes of stack and eliminates stack overflows in the ke2041 test in metados. (Bart) chg: Generate 28.com and 50.com from assembly language. (Bart) v0.84pre6 ~~~~~~~~~ fix: Revert to first-fit dosalloc for copy&dir buffers for non-large model (Bart) fix: Enable reporting of directory sizes up to 2TB (with Tom Ehlert) fix: dosalloc: apply carry to flag image for intr(), not directly via stc The carry flag was not preserved before. (Bart) fix: Use intr.asm with OW too, to be able to use SZAPC flags on input. (Bart) chg: Enable cross-compilation from 64-bit Windows using Open Watcom (Bart) fix: ia16-elf-gcc: intr( ) now loads flags before invoking interrupt (TK Chia) fix: compilation errors when LFN is disabled. Fixes #5. (Bart) fix: Allocate a large enough buffer for the rest of the command line. We need to use a full buffer for the rest to allow for alias expansion. Fixes #6. (Bart) fix: GCC: make sure that XMS calls get ds:si, otherwise ds can be wrong. (Bart) fix: OW: Use xmsfunc typedef and apply #pragma aux to that. This way XMScopy actually works, and passes the structure in si, so messages are copied correctly. Fixes issues with metados. (Bart) fix: keep asm inputs & clobbers separate in gcc port of dup2 (TK Chia) fix: ia16-elf-gcc code wrongly assumed XMS driver preserves %bx (TK Chia) fix: tell OW that bx/cx can be modified, similar to ia16-elf-gcc (Bart) fix: cmd: shift: use correct context, Fixes SF Bug #155 (Wolfram Sang) chg: Replace XMSrequest external asm with inline asm for GCC. (Bart) v0.84pre5 ~~~~~~~~~ add: Serbian/Yugoslavian for cp852 from freedoslocal (Dejan Strbac) add: Slovenian translations from freedoslocal (Matej Horvat) add: Turkish translations from freedoslocal. fix: Update French translations from freedoslocal (Mateusz Viste) fix: [bugs:#192] FOR %i IN (*.*) do @ECHO %i does not work fix: [bugs:#209] The shell doesn't display any error if exec fails. It will now say "EXE file corrupt" if the .exe file has a bogus header. chg: Reduce ifdef's for GCC, using new ia16-elf-gcc functionality. chg: Use cglobal and cextern macros in asm files for globals. fix: Use last-fit dosalloc for copy&dir buffers to work well with large model fix: Plug memory leak in and around comResFile(). fix: _dos_allocmem takes a pointer to unsigned, not unsigned long. fix: Wrap dprintf macro into do { ... } while (0); fix: Use only libc stdio in DEBUG build, not printf from clib. chg: Remove no longer used tempfile/rmtmpfile. fix: cgetchar_timed and eliminate its call to fputmc. chg: Replace fputmc calls by more direct memset/dos_write calls. fix: non-small (debug) model compilations for Turbo/Borland. chg: Compile debug version in medium memory model instead of large. fix: debug version (large model); enable for watcom. chg: Create and use sfn_creat() and use instead of dos_creatnew() fix: lfn_creat needs to truncate files that already exist. fix: hang for batchfiles that do not end with an EOL character. This fixes a hang with Rugxulo's metados.img. v0.84pre4 ~~~~~~~~~ fix: spelling, by Anders Jonsson fix: Edits to Swedish translation file, by Anders Jonsson fix: Make echolib.bat compatible with cmd.exe (Tom Ehlert) fix: Fix build for GCC-compiled load_icd.exe (Bart) fix: parsefnm failures and cleanup other inline asm for OW and GCC (Bart) fix: revert change keeping context alwyas on heap (caused out-of-memory) (Bart) fix: replace use of inline asm lcall/call for GCC with plain C calls (Bart) v0.84pre3 ~~~~~~~~~ fix: Make sure that ds=ss in XMSexec call (Bart) The newest ia16-elf-gcc floats ds inside functions and with the inline asm doesn't know it's a function call (Bart) chg: fmemcpy now compiles properly with ia16-elf-gcc (remove workaround) (Bart) chg: Use GNU Make instead of OW wmake to compile with ia16-elf-gcc (Bart) chg: Build strings without needing to create/remove the subdirectory (Bart) chg: Move xmssave and some related variables to near transient data This is possible since the resident code no longer references those Be careful to not write to any transient data after the save to XMS (Bart) chg: Fix "TODO make XMSsave two structures in order to drop this subroutine" (Bart) chg: Make XMSexec function near and move 80 resident code bytes to transient section. (Bart) chg: fix xms-swap TODO: first_time either 04ah or 049h --> no jumps (Bart) chg: xms-swap: move residentCS from cs: to ds: (Bart) fix: Stack size for OW needs to be 4K instead of default 2K. This matches Turbo C's default, and allows for some large stack users with LFNs. (Bart) chg: Reduce heap memory by only keeping the necessary rest of the command line. (Bart) chg: Keep the context permanently on the heap via realloc, to reduce fragmentation. (Bart) chg: Properly patch the heap size for Open Watcom The memory layout for OW is different from Turbo C. For Turbo, heap is below stack, but for OW it's the reverse. Hence OW keeps the data segment much more minimal by default. There is however a default sbrk increment of 8096 set by _amblksiz. If we set that to 6K instead the heap will stay at that size, so TSRs are loaded beyond that point (for non-XMS-SWAP that is, with XMS-SWAP it's completely different) (Bart) chg: getEnv: remove static pointers, caller responsible for free. Eliminating the 3-pointer dance and free-ing the environment variable pointer as soon as possible reduces heap fragmentation. (Bart) fix: Fix farwrite and hence copy for Turbo/GCC (Bart) fix: "dir" output for dates with our own printf. It supports %02u but not %.2u. Those produce the same result though (Bart) chg: port to ia16-elf-gcc (Bart) fix: kswap_p is a _seg * pointer so we need MK_SEG_PTR for compilers without _seg (Turbo C 2.01, OW). Otherwise the critical error handler is not installed correctly for non-xms-swap builds. (Bart) chg: Use "add si, byte 10" so old and new NASM generate the same opcodes (Bart) fix: Use proper prototypes on enum{File}Resources callback function (Bart) chg: allow Linux cross-compilation, port build utils to GCC-Linux (Bart) fix: Fix ren for files without extensions (passes NULL ptr for ext) (Bart) fix: Fix LOADHIGH for compilers without _seg pointers. Use FP_SEG instead of casting the pointer to unsigned, as _seg is defined to far on compilers without _seg (e.g. Watcom) (Bart) fix: IF EXIST should auto-fail critical errors due to empty drive (Tom & Jeremy) add: %CD% as alternative to %_CWD% (Tom) fix: Use screen height 25 when 0 returned as current height, from Mateusz Viste, bug #131 see http://sourceforge.net/p/freedos/bugs/131/ (Jeremy) chg: Merged fcompl1 and fcompl2.c to filecomp.c (Bart) chg: Untangle findfirst/next/close definitions to make them more explicit (Bart) chg: Consistently use dos_open/dos_close/dos_read/dos_write, etc The problem with _open, _read, etc. is that they mean different things to Turbo than for OW: Turbo _open is like _dos_open but OW _open is an alias for open (Bart) chg: Eliminate open() in favor of _open/_creat/dos_creatnew (Bart) chg: Eliminate fgets(), replacing with _read() (Bart) chg: Use backspaces instead of gotoxy calls to clear a command line (Bart) chg: Use _write for all printf style writes in prf.c and for putc(har). Remove fflush and setbuf calls (Bart) chg: Eliminate fputs everywhere except for prf.c (Bart) chg: Eliminate read() by using _read() everywhere (Bart) chg: Remove references to fopen / fcloseall for non-debug builds (Bart) chg: Use open/read/close instead of fopen/fread/fclose everywhere (Bart) fix: EnumFileResources function arguments to all use handles instead of streams (Bart) fix: Fix loadModule: it should use an int fd for a handle instead of a FILE *. (Bart) chg: replaced all text mode write()s by binary _write()s to save RTL usage space (Bart) chg: farread/farwrite cleanup of DOS r/w's (Bart) chg: Use handle I/O instead of stream I/O for resources to save space (Bart) chg: Change geninterrupt emulation to use intr() instead of int86x() for consistency (Bart) chg: Centralize LFN functions for mkdir/rmdir/chdir (Bart) fix: Support precision flag and size/precision from argument list in abbreviated printf function, to fix "dir /lfn" (Bart) fix: Don't truncate when not necessary for LFN opens. Works around an FD kernel bug were truncating a 0-byte file caused an error (Bart). fix: "copy con file" (Bart) fix: COPY: trailing /a and /b options only apply to the last (destination) file, not globally, when concatenating, "/a" is the default. (Bart) chg: Replace stream i/o for COPY by simpler handle i/o, so fileno doesn't need to be used all the time. (Bart) chg: Use BIGcopy() for both ascii and binary copies. ASCII just means to check for Ctrl-Z, don't mess with line endings, so do that manually using fmemchr. When eof is detected, no more reads are needed. (Bart) fix: COPY: The /B switch should switch devices to raw mode (see nansi.sys documentation). Fix errors given for "copy [/a|/b] file.txt con". (Bart) chg: Use small printf() from the kernel source with a few modifications to do some buffering. Saves 3.5K in RTL code for OW. (Bart) fix: exit() needs to be overriden for OpenWatcom as well as Turbo C. (Bart) fix: Fix direct _seg pointer casts for Open Watcom (and also Turbo C 2.01)(Bart) fix: Fix size of LFN in struct locffblk, and make sure the ffblk structs are packed (Bart) fix: Fix devopen in OW using stdarg.h and proper prototypes (Bart) fix: Fix xms-swap for Open Watcom (Bart) fix: Set stdout to unbuffered for Watcom as it is by default for Turbo C (Bart) fix: Use stdarg.h to avoid messing with prototypes in, and fixing Open Watcom' use of env_replace (Bart) fix: Update build system to support Open Watcom. Introduce config.b/config.bat like in the kernel source to be able to configure make/wmake locations (Bart) fix: ISR/dir.h/stpcpy/string/?etverify/parsfnm related changes for OW compatibility (Bart) chg: Use IREGS/intrpt instead of struct REGPACK/intr everywhere for OW compatibility. Similarly, USEREGS simulates geninterrupt (Bart) fix: Avoid Turbo C specific use of sizeof in preprocessor expressions (Bart) fix: Adjust makefiles to be compatible with TC 2.01's very limited MAKE utility (no redirection) (Bart) fix: Fix compiler warnings (Bart) chg: Handle .obj dependencies for suppl instead of rebuilding every time (Bart) chg: Prune unused files from stripped-down suppl (Bart) chg: Remove duplicate .h files from suppl source (Bart) fix: Do not compare (signed) to ' ' but use iscntrl() - otherwise, FIXSTRS may chop trailing non-ASCII (eg Russian) words away (Eric Auer). fix: Fixed compilation completely with Turbo C (Blair). fix: Got rid of all '//' comments (Blair) fix: Support for BC (Blair) fix: Fix for compiler oddities (Arkady). fix: Fixed bug in Truename (Blair). fix: Print long filename current directory (Blair). fix: Use safer intr routine rather than directly modify registers (Blair). fix: Moved lfnsup to a place where it will not be overwritten (Blair). add: Add option to compile to support switch character instead of hardcoded '/' (Blair) add: The new SET /E feature. (Blair) fix: Fixed long filename handling in DIR. (Blair) fix: COPY uses static-size buffers now to prevent known problems with dynamic allocation. (Blair) fix: Improved PATH handling routine (Arkady). fix: Fixed (hopefully) bug in %PATH% parsing routing and A:/B: random accessing bug (Blair). fix: Fixed bug where a directory could be found in %PATH% parsing (Blair). chg: Added Polish translation, updated French&Italian translation (Blair). chg: Made RD/MD/CD more buggy-lfn-implementation friendly (Blair). chg: Removed usage of CLIB perror function and reduced executable size by nearly 1 kb. Since perror was only used in ren and del, and only two possible errnos exist, the function can be minimized, and also as an added advantage, the errors that were printed can now be translated (Blair). v0.84pre2 ~~~~~~~~~ add: 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) chg: Size optimizations chg: CONIO dependencies removed - smaller size chg: VER /R now prints the FreeDOS version string chg: SET VAR can display %VAR% instead of syntax error chg: Remove version strings fix: COPY now checks for existance of source file before asking to overwrite destination add: ukr.lng: Ukrainian translated messages add: default.lng: LFNFOR messages add: 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 chg: DIR/LFN: now displays lfn for all files that return one fix: IF: /I option parsing interfered with /whatever tests fix: DIR: divide by 0 {TE, Eric, & Mark Bailey} v0.84pre: ~~~~~~~~~ fix: DIR/VOL: bug#1809, volume label missing spaces {KJD} fix: VOL: syntax error if extra whitespace after drive {KJD} add: CDD: if given path to a valid filename, ignore filename portion instead of error add: SET /U: indicate that the value will be stored in env var in UPPERCASE add: DIR: bug#1889, added limited 4DOS DESCRIPT.ION file support {KJD} add: IF: /I option for case insensitive comparisons, if /I "Aa"=="aA" echo is true fix: IF: bug#1885, fix if exists on system/hidden files {Erwin Veermans} fix: LH: fix wrong errorlevel returned when program goes resident {KJD} fix: default.lng: typos and misc corrections {Bernd Blaauw} fix: swedish.lng & swedish.err so correctly builds add: /Z: lib\dispexit.c missing, added new implementation {KJD} add: /Z: Display exit code after external command {Bernd Blaauw} fix: LH: Errorlevel of program effects LH's error reporting {Eric Auer} chg: BUILD.BAT: Removed CONFIG.MAK and add the warning concering CONFIG.STD fix: CONFIG.MAK: changes of CONFIG.MAK propagate to all make's chg: SUPPL: integrate a stripoped down variant of SUPPL into CVS {Tom Ehlert} [#1794] add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} fix: CLS: cut debug message add: DIR: display LFNs if enabled with /lfn [Tom Ehlert] add: DIR: display FAT32 free space on drive [Tom Ehlert] chg: res_r.c: don't use relative seek; fails under NTFSdos [Tom Ehlert] chg: doc DIR: note about how many entries can be sorted with /O [Eric Auer] bugfix: DIR: /b don't append spurios spaces {fd-doc#226} bugfix: use of the nls thousands separator in convert() [Eduardo Casino] add: ITALIAN.ERR {Roberto Mariottini} bugfix: CHCP: use n to set new codepage [Eduardo Casino] add: cmdinput.c: Ctrl-Left & Ctrl-Right [Tom Ehlert] fix: xms-swap.mak: dependencies [Tom Ehlert] chg: init.c: Don't displays command on startup [Tom Ehlert] {common request} bugfix: init.c: invalid empty MSDOS environment [Tom Ehlert] fix: appendDisable(): should disable APPEND [Eduardo Casino] fix: /LOW option upd: ITALIAN.LNG {Roberto Mariottini} fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} chg: REN: disable APPEND.EXE {Eduardo Casino} fix: DIR: disable APPEND.EXE during DIR processing {Eduardo Casino} bugfix: CLS: use BIOS, unless fd1 is file or NUL {Eric Auer} add: config.h: MUX_AE_MAX_REPEAT_CALL bugfix: MUX-AE: useage of DS:[SI] {Eduardo Casino} bugfix: COPY C: D: heap corruption [#556] {Tom Ehlert} fix: PROMPT $V: include FreeCOM version information [#1776] fix: docu: typo and mailing list [#1774] fix: docu: mailing list at topica {Arkady V.Belousov} upd: german.lng [Eric Auer] bugfix: argv[1] and no ComPath stuff [#1761] fix: typo upd: documentation: batch processing, Bugzilla bugfix: documentation of wildcards [#1727] fix: get_redirection(): double comment mark /* {Arkady V.Belousov} bugfix: get_redirection(): apostrophe used as quote bugfix: readcommandline(): spurious \n after commands [#1721] bugfix: readbatchline(): permit @ before labels [#1747] bugfix: onoffStr(): do not ignore leading argument delimiters [#1736] add/upd: CVS $id$ keywords to/of files bugfix: misidentifying unspecific failures from within SUPPL [#1616] v0.83 Beta 56: ~~~~~~~~~~~~~~ add: DIR: /O (single sort order) {Tom Ehlert} bugfix: CONFIG.H: enabled CHCP by default fix: typos bugfix: cached NLS data not flushed fix: DIR: correct attribute behaviour, no + syntax {Tom Ehlert} fix: DIR /A-S need to default to attrMay == any fix: DIR: bailing out if boolean switches found with /A fix: DIR /S: if not found a single item, display error add: SET /P {based on luojiuming} bugfix: removed /V from CMDHELP_DIR add: DIR /A*** (selected attributes) {based on patch from Michael Devore} v0.83 Beta 54: ~~~~~~~~~~~~~~ bugfix: prevent from executing non-*.bat/com/exe files [part 1) BugID #966] bugfix: calling an external program: preserve leading spaces [BugID #752] bugfix: ECHO: preserve leading spaces [BugID #1081] v0.83 Beta 52: ~~~~~~~~~~~~~~ add: CHCP (disabled by default) bugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313] bugfix: onOffStr(): zaps trailing argument delimiters, e.g. ECHO set= add: save/restore session (swap context) {Tom Ehlert} bugfix: CTTY CON -> missing CR's {Eric Auer} [bugID #1441] v0.83 Beta 50: ~~~~~~~~~~~~~~ bugfix: /?: found on all the command line fix: %0 to return batchfilename as typed on cmd line (bug: maybe upcased) chg: enumResources(): handle fnam == 0 (file open error) bugfix: FreeCOM should accept relative path as argv[0] bugfix: FreeCOM is to pass the fully-qualified path to DOS-4B-00 bugfix: use %1 (and assoc) in FOR commands (activeBatchContext()) add: auto-vars ERRORLEVEL and _CWD (current working directory) bugfix: removed %? because of incompatibly with existing scripts bugfix: none-working LOADFIX {Tom Ehlert} bugfix: XMS-Swap/LOADHIGH: crashes {Tom Ehlert} v0.83 Beta 48: ~~~~~~~~~~~~~~ bugfix: XMS-Swap/LOADHIGH: wrongly calculated UMBs if loaded into UMB {Tom Ehlert} fix: expand environment variables within FOR ()'s (utter hack, to be replaced) chg: do not strip control characters from command line bugfix: FOR: If a pattern fails to match, --> ignore {Tom Ehlert} bugfix: FOR and redirection [BugID #1050, #708, #1041] chg: documentary about new build process, build48.html add: DUTCH.LNG {Bernd Blaauw} chg: BUILD.BAT: To display %LNG% at XMS-Swap remark add: to use on a cdrom to create localized versions {Bernd Blaauw} fix: COMMAND.COM /P/C cmd: hangs in endless loop, should become interactive bugfix: CONFIG.MAK: default location of SUPPL fix: IF ERRORLEVEL non-numeric hack (H? / x?) {Tom Ehlert} [Bug #1066] add: pt/BR Strings {Max M. Velasques} v0.83 Beta 46: ~~~~~~~~~~~~~~ add: COPY: keep file time if not appending chg: upload.txt: update options of DIFF utility bugfix: documentation: link to ftp://sourceforge bugfix: shell\batch.c: incorrect dfn.h path v0.83 Beta 44: ~~~~~~~~~~~~~~ upd: documented bug of 16bit NASM version 0.98.34 compiled on Jun 17 2002 v0.83 Beta 42: ~~~~~~~~~~~~~~ add: feature ENVIRONMENT_KEEP_FREE bugfix: DOS memory corruption by bad struct MCB declaration v0.83 Beta 40: ~~~~~~~~~~~~~~ bugfix: ^Break detection after XMS-Swapping v0.83 Beta 38: ~~~~~~~~~~~~~~ chg: cswap.asm: make local stack 256 (as RBIL suggests) bugfix: cswap.asm: make local stack 200 bytes to let MS NET work (Tom Ehlert) chg: init.c: removed warning about non-used arguments bug: config.h: re-enabled LOADHIGH/FIX chg: BUILD.BAT to handle XMS-Swap better bugfix: CTTY: added to try to set the device flags bugfix: LOADHIGH: disable swapping when executing bugfix: init.c: /p:arg ignores argument add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) chg: COPY: appFile unneccessarily declared FAR (Tom Ehlert) bugfix: cmdinput.c: histGet(,str,maxlen) (Tom Ehlert) bugfix: mux_ae.h: #ifdef --> #if (Tom Ehlert) bugfix: day/month read from ff_time reversed (John Price) bugfix: IF lower==LOWER bug; MS COMMAND compares case-sensitively fix: Several typos in documentation 2003/03/09 Tom Ehlert ~~~~~~~~~~~~~~~~~~~~~~ add: DIR /A** and /O*** 2002/10/16 Alain ~~~~~~~~~~~~~~~~~~~~~~ add: COPY: keep file time 2002/04/02 Tom Ehlert ~~~~~~~~~~~~~~~~~~~~~~ add: XMS-Only Swap feature (FEATURE_XMS_SWAP) 2002/03/31 ska ~~~~~~~~~~~~~~~~~~~~~~ chg: COPY: appFile unneccessarily declared FAR (Tom Ehlert) bugfix: cmdinput.c: histGet(,str,maxlen) (Tom Ehlert) bugfix: mux_ae.h: #ifdef --> #if (Tom Ehlert) bugfix: day/month read from ff_time reversed (John Price) bugfix: IF lower==LOWER bug; MS COMMAND compares case-sensitively fix: Several typos in documentation v0.83 Beta 32: ~~~~~~~~~~~~~~ bugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure. add: if DEBUG enabled: internal command EXIT!! that ignores /P chg: FEATURE_BOOT_KEYS: mandory boot keys (F5/F8) turned into optional compile-time option; disabled by default now as the kernel provides F5/F8 checking chg: some document updates v0.83 Beta 30: ~~~~~~~~~~~~~~ add: SET /I: To display the size and unused area in env segm (about 700 bytes increase of image; WILL BE REMOVED WITH NEXT STABLE RELEASE) bugfix: INIT.C/COMMAND.C: in MS DOS environment no program expects that the string area of an environment is used and is therefore killed. FreeCOM now zeroes the string counter in order to let SUPPL work correctly. Warning: Known Bug: Now test is made, if the two bytes for the counter is not available, thus, the env_nullStrings() function fails. bugfix: INIT.C: negated test for FreeDOS's build >= 2025 v0.83 Beta 28: ~~~~~~~~~~~~~~ bugfix: scancmd.c: /B and /A let COPY fail (ec == E_Ignore) (bug 829) upd: HTML section v0.83 Beta 25: ~~~~~~~~~~~~~~ bugfix: pre-compiled package BINARY.ZIP without command-line editing chg: FreeCOM archive (== executable) is opened read-only. v0.83 Beta 21: ~~~~~~~~~~~~~~ bugfix: process_input(): iscntrl() does not advance ip possible bugfix: force to default to _unsigned_ char as built-in macros do not work with signed char > 127 v0.83 Beta 15: ~~~~~~~~~~~~~~ bugfix: expalias: if malloc() fails, random expanded is free'ed bugfix: nls_maketime(): 12hour display does not free AM/PM id fix: dbg_printmem() if compiled in Large memory model, near is invalid 2001/06/11 ska ~~~~~~~~~~~~~~~~~~~~~~ fix: dbg_printmem() if compiled in Large memory model, near is invalid 2001/06/11 ska ~~~~~~~~~~~~~~~~~~~~~~ release of v0.83 Beta 14: add: ALIAS HTML documentation bugfix: MEMORY displays batch nesting level, although, not implemented, yet 2001/06/10 ska ~~~~~~~~~~~~~~~~~~~~~~ bugfix: Single point of configuration CONFIG.MAK/.H: CONFIG.MAK <-> Compiler specific settings, paths etc. CONFIG.H <-> FreeCOM releated settings, included commands etc. bugfix: DEFAULT strings for COMMAND /?, WHICH /?, DOSKEY /?, DIR /? (/A & /O) add: error message if debugging when to open the resource file failed bugfix: links in FreeCOM.html & typos in commands database add: check for low memory during init() when debugging bugfix: TYPE: first argument only bugfix: DATE: does not accept empty line bugfix: >>PATH<< with empty %PATH% --> PATH=(null) fix: BREAK/VERIFY ignore trailing spaces fix: >>PATH ;<< remove PATH environment variable fix: cache 3 environment variables to overcome nested useage (e.g. when loading message segment to print environment variable) bugfix: keep trailing spaces of command line v0.83 Beta 14: ~~~~~~~~~~~~~~ add: ALIAS HTML documentation bugfix: MEMORY displays batch nesting level, although, not implemented, yet bugfix: Single point of configuration CONFIG.MAK/.H: CONFIG.MAK <-> Compiler specific settings, paths etc. CONFIG.H <-> FreeCOM releated settings, included commands etc. bugfix: DEFAULT strings for COMMAND /?, WHICH /?, DOSKEY /?, DIR /? (/A & /O) add: error message if debugging when to open the resource file failed bugfix: links in FreeCOM.html & typos in commands database add: check for low memory during init() when debugging bugfix: TYPE: first argument only bugfix: DATE: does not accept empty line bugfix: >>PATH<< with empty %PATH% --> PATH=(null) fix: BREAK/VERIFY ignore trailing spaces fix: >>PATH ;<< remove PATH environment variable fix: cache 3 environment variables to overcome nested useage (e.g. when loading message segment to print environment variable) bugfix: keep trailing spaces of command line chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands fix: config.mak: missing libpath & "-d" causes crashes fix: cmdinput.c: first histGet() is not #if'ed chg: new directory structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N bugfix: mktempfile(): if realloc() fails, fn is not deallocated bugfix: showcmds(): always display all implemented (though possibly not available) features fix: criter.asm: DEBUG does no longer compile to .COM (for consistency) chg: removed all NULLs to prevent NULL problematic, functions must be used fully prototyped now v0.82 pl 3: ~~~~~~~~~~~ bugfix: Ask for FreeCOM location when STRINGS are missing [#687] bugfix: INIT: FreeCOM-path and TTY can be in any order chg: SCRIPTS\MAKECMD.BAT: replaces MAKE_LNG.BAT, make localized FreeCOMs add: SCRIPTS\MAKE_LNG.BAT: Make language-specific FreeCOM from *.LNG files {Bernd Blaauw} add: SPANISH.LNG/ERR {Aitor Santamara Merino} add: copy.c: BIGcopy() - large buffer r/w copy {Tom Ehlert} add: total update/rewrite GERMAN.LNG {Clemens Lser} bugfix: FIXSTRS: TEXT_CMDHELP_FOR: Invalid warning for %v {Bernd Blaauw} bugfix: CRITERR: to use DOS API {Tom Ehlert/Bart Oldeman} bugfix: LOADHIGH: deallocating context if /L is present {Tom Ehlert} fix: set.c: warning missing prototype strchr() bugfix: /F (AutoFail) for the XMS_Swap variant bugfix: COPY * X: re-linked to correct SUPPL version fix: typos [#1694,#1696,#1695] add: FOR/?: example [#1679] bugfix: typo: bad varable specification [#1678] fix: copy(): replace chsize() to not fill with '\0's {Tom Ehlert} add: copy(): Speed-Up by pre-creating the file {Tom Ehlert} bugfix: BATCH.C: extract of label name failed due to macro {Tom Ehlert} add: Serbian CP437 LNG/ERR files {Dejan Strbac} add: Swedish CP850 LNG/ERR files {Oscar Molin} v0.82 pl 2: ~~~~~~~~~~~ chg: Prevent double-parsing of redirection in CALL and IF chg: updated FreeCOM implementation status doc add: documentation for Benny levels, IF and TESTS\BENNY.BAT bugfix: FREECOM.COM /?: is to terminate unless /P is present [Andrew Sly] bugfix: Cleanup HTML docs to pass W3C validation fix: typo in HISTORY /? {Andrew Sly} chg: wilcard matching: COPY/REN *.TXT ???b.*: If length of source filename is less than 3, the superflous question marks are ignored, as in MS COMMAND v6.22 COPY, but INCOMPATIBLE to same version's REN, which embeds spaces bugfix: CRITSTRS: hexa-decimal (%&??) interpretation {Strbac Dejan} upd: STRINGS\DUTCH.LNG {Bernd Blaauw} bugfix: CVS problem regarding strings\dutch.lng add: Russian/CP866 language file {Sandul} bugfix: dfnstat(): Use DOS-44-09 for "X:" {Bart Oldeman} fix: memory leak (newname) in REN add: MS COMMAND-style wildcards for REN {Wolf Bergenheim} add: Serbian language files {Strbac Dejan} v0.82 pl 1: ~~~~~~~~~~~ chg: Version number scheme: all v0.83 Beta <> really are predecessors of v0.82 pl 1 fix: DIR: /O default sort order add: DEL: /V option [#1587] chg: tracemode: print prompt prior command [#1487] add: CALL /Y: To enable tracemode during command bugfix: PROMPT $T: hour: space padded; fraction zero padded [#1481] bugfix: command line scanner: must accept ' and ` as filename characters hence dropping them as quote character [#1244] bugfix: DIR: /4 synonym for /Y [#937] bugfix: COPY: remove created files on error [#756] fix: COPY: broken wildcarded source pattern add: COPY: colon'ed device names on command line, e.g. COPY CON: file [#225] fix: COPY: con: is misinterpreted as C: fix: DIR: /O: endless loop /OU; ignored /OG; /OE: return 0 if no extension add: DIR: /O: multiple /O** conditions {Tom Ehlert} bugfix: COPY: process directories as if "*.*" were appended bugfix: split(): out-of-mem condition during building argument array v0.81 beta 1: ~~~~~~~~~~~~~ bugfix: _fstrchr() doesnot find '\0' bugfix: NULL problematic v0.81 beta 0: ~~~~~~~~~~~~~ bugfix: "copy 1 + 2 + 3 target" copies first & last file only add: interactive command flag add: FDDEBUG may redirect output into file bugfix: STRINGS resource length value counts 1. string twice sub: enumResources() won't check secondary files no longer fix: MKTOOLS must include $(CFG) into list add: command WHICH fix: BUILD.BAT and accompanying makefiles for TC++ v1.01 bugfix: if ENHANCED_INPUT && !HISTORY, CurRight falls through to CurLeft bugfix: CB_CATCH: In DEBUG mode: recursive test fails always bugfix: KSSF: restore parentPSP on exit chg: using STRINGS resource for all non-interactive messages chg: moved all assembly files to NASM v0.80b ~~~~~~ add: DIR /Y to display 4digit year fix: DIR displays "bytes free" at the very end, but if more than one argument is specified, it only displays the free bytes of the very last argument. The line is now printed after the display of each argument. bugfix: When the "bytes free" are displayed the used drive letter had been deallocated already. add: NLS-compatible input of date add: NLS-compatible display of date & time (incl DIR) fix: parse years 80..199 as century 1900 (by Arkady) chg: removed some static variables chg: made all global functions & variables static to LOADHIGH.C sub: LH.ASM/LOADHIGH.C: duplicate functions (memory API, farmemcmp) fix: doc of DATE, TIME, FreeCOM v0.80a ~~~~~~ chg: two-digit year -> 2000 if less than 80 add: DATE /D and TIME /T v0.80: ~~~~~~ chg: canexit disabled by default, allowed within initialize() chg: command table uppercased as Installable Commands use uppercased names add: installable COMMAND extensions FEATURE_EXTENSIONS add: F1, F3, F5, cur-right add: French Strings file add: German Strings file add: useage of %COPYCMD% v0.79d2: ~~~~~~~~~ bugfix: "CD." and analogeous commands v0.79d1: ~~~~~~~~~ add: FEATURE_ENHANCED_INPUT and it's non-defined variant bugfix: "%1" could writer behind end of string bugfix: check of length of external command line was considered too long chg: moved check for length of external command line in order to let batch files use the internal length v0.79d: ~~~~~~~~ bugfix: "line too long" error if last line of batch files has no newline bugfix: root path not recognized, e.g. in "C:\PATH> \program" 2001/04/31 ska ~~~~~~~~~~~~~~~~~~~~~~ chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands fix: config.mak: missing libpath & "-d" causes crashes fix: cmdinput.c: first histGet() is not #if'ed chg: new directory structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N bugfix: mktempfile(): if realloc() fails, fn is not deallocated bugfix: showcmds(): always display all implemented (though possibly not available) features fix: criter.asm: DEBUG does no longer compile to .COM (for consistency) chg: removed all NULLs to prevent NULL problematic, functions must be used fully prototyped now 2001/02/27 ska ~~~~~~~~~~~~~~~~~~~~~~ fix: criter.asm: DEBUG does no longer compile to .COM (for consistency) chg: removed all NULLs to prevent NULL problematic, functions must be used fully prototyped now 2001/02/20 ska ~~~~~~~~~~~~~~~~~~~~~~ release v0.81 beta 1 bugfix: _fstrchr() doesnot find '\0' bugfix: NULL problematic 2001/02/16 ska ~~~~~~~~~~~~~~~~~~~~~~ bugfix: "copy 1 + 2 + 3 target" copies first & last file only add: interactive command flag add: FDDEBUG: redirect output into file add: command WHICH chg: moved all assembly sources to NASM chg: using STRINGS resources for all non-interactive strings bugfix: if ENHANCED_INPUT && !HISTORY, CurRight falls through to CurLeft bugfix: CB_CATCH: In DEBUG mode: recursive test fails always bugfix: KSSF: restore parentPSP on exit 2001/02/14 ska ~~~~~~~~~~~~~~~~~~~~~~ fix: parse years 80..199 as century 1900 (by Arkady) chg: removed some static variables chg: made all global functions & variables static to LOADHIGH.C sub: LH.ASM/LOADHIGH.C: duplicate functions (memory API, farmemcmp) fix: doc of DATE, TIME, FreeCOM 2001/02/08 ska ~~~~~~~~~~~~~~~~~~~~~~ chg: two-digit year -> 2000 if less than 80 add: DATE /D and TIME /T 2000/12/13 ska ~~~~~~~~~~~~~~~~~~~~~~ released v0.80 2000/12/10 ska ~~~~~~~~~~~~~~~~~~~~~~ add: Installable Commands interface (MUX_AE.*) FEATURE_INSTALLABLE_COMMANDS chg: F3 == complete string add: cur-right at end of string == F1 fix: F5 removes cursor sometimes 2000/11/28 (Owen Rudge ) ~~~~~~~~~~~~~~~~~~~~~~ - Added support for F1, F3 and F5, as in MS COMMAND.COM F1 = Insert next character from last buffer F3 = Complete string (NOTE: in this version, replaces string) F5 = Places current string in buffer, moves to next line 2002/10/09 Michael Kjrling ~~~~~~~~~~~~~~~~~~~~~~ bugfix: directory commands now support periods without leading space 2000/09/26 ska ~~~~~~~~~~~~~~~~~~~~~~ bugfix: "%1" expansion could overwrite end of string bugfix: length of external command line was assumed too long chg: moved check of length of ext cmdline before exec() in order to allow batch files use the internal length 2000/08/15 ska ~~~~~~~~~~~~~~~~~~~~~~ chg: layout of CVS: + removed all pre-compiled files but COMMAND.COM for English + pre-compiled files can be downloaded from ftp://freedos.sourceforge.net/pub/freedos/freecom/ See DOWNLOAD.TXT + created a "localizer" package add: FIXSTRS.EXE now creates a third file STRINGS.LOG to help to localize the strings; see DOCS\LOCALIZE.TXT 2000/08/15 Ron Cemer ~~~~~~~~~~~~~~~~~~~~~~ bugfix: Piping, when the tempfile is opened for read-only access for the 2nd command it's still opened for write-only for the 1st one. This may fail, see DOCS\PIPING.TXT 2000/07/24 Ron Cemer ~~~~~~~~~~~~~~~~~~~~~~ fix: COPY fix: environment handling 2000/07/10 Ron Cemer ~~~~~~~~~~~~~~~~~~~~~~ bugfix: for DIR /S fix: COPY (started) 2000/07/10 ska ~~~~~~~~~~~~~~~~~~~~~~ chg: To support to change the STRINGS.DAT file without recompiling FreeCOM, the format of STRINGS.DAT and FIXSTRS was updated see FIXSTRS.C for more information 2000/06/22 ska ~~~~~~~~~~~~~~~~~~~~~~ Added TC++1 fix contributed by Ron Cemer 2000/06/22 ska ~~~~~~~~~~~~~~~~~~~~~~ released version v0.79b 2000/06/22 ska ~~~~~~~~~~~~~~~~~~~~~~ o add: CDD - changes drive and directory o add: FEATURE_LAST_DIR - "CD -" as in 4/Ndos o bugfix: "CD C:" has to display cwd of drive C: 01-Jun-2000 (D. Lucas Parker ) ~~~~~~~~~~~~~~~~~~~~~~ o Added PUSHD, POPD, and DIRS commands similar to 4/NDOS, in file DSTACK.C 1-Apr-2000 0.79 Henry Voigt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bugfix: ver.c : options uninitilized - every second output of ver with the same option is empty (except FreeCom-string) 19-May-2000 James Tabor ~~~~~~~~~~~~~~~~~~~~~~ Import FreeCom from John Price CVS at gcfl.net to the new CVS at Sourceforge.net. 30-Mar-2000 0.79 John Price ~~~~~~~~~~~~~~~~~~~~~~ Added fddebug command so you can turn debug output on and off. 30-Mar-2000 0.79 Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ (Merged in code from Revision 0.78ska1 & 0.78ska2) add: internal command CTTY: redirects the three standard file descriptors stdin, stdout and stderr to the specified device add: FEATURE_CALL_LOGGING & tool PTCHLDRV bugfix: Y2K: DIR displays year 2000 as "100" + bugfix: if: case-insensitive compare in "==" format + bugfix: if: added support for quoted operands of "==" format + add: if: detailed error messages + bugfix: if: keyword "EXIST" misspelled + bugfix: echo: "ECHO" does not display the ECHO status + bugfix: goto: label may be prefixed by one colon + bugfix: "skipwd" is commented out --> SUPPL's skipwd() is used which is not 100% compatible, though 20-Sep-1999 0.78 Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ chg: added v0.77 patches <> chg: centralized DEBUG stuff (see debug.*) add: SET: Issues no-such-variable if a variable could not be removed bugfix: COPY *.C A: chg: automatic load of messages and keep them in memory add: session management add: comments add: command line scanner acts over both internal command lines and arguments of COMMAND.COM itself ==> added longname options chg: replaced access() by dfnstat() chg: replaced stat() by dfnstat() chg: split() may recieve NULL as line --> empty line add: every internal command that can display some information, can be called with parameter == NULL and this info is displayed. cmd_echo(NULL) will display ECHO status. add: ECHO. hack chg: every internal command detects and scans the options in the same way; see CMT3.TXT add: DEL accepts multiple arguments bugfix: "FOR %a IN (dir\*.*) DO" expands to "dir\..." instead of just "..." bugfix: %9 wrong, if 9 > number of paramters chg: %0 returns fullname; see CMT2.TXT chg: rewritten COPY. Now behaves as described in CMT4.TXT 29-Apr-1999 0.77 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o dir.c: changed dir so it always shows the bytes free. Changed so that "dir command" with no extension will do as "dir command.*" (as it should). Also made the display of the directory not include the whole filespec, but only the directory o copy.c: Now works if dest is just a drive letter. (i.e "copy file a:") 25-Apr-1999 0.77 Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ bugfix: alias.c: aliasexpand(): The main loop is multiply executed, if at least one alias was expanded (controlled by variable 'd'). However, because 'ptr' is never resetted, the second loop always immediately fails, because 'ptr' is still NULL. bugfix: batch.c: batch_params(): Copying a quoted argument: If the string is not terminated, the do-while loop stops, then copies the '\0' byte, then increments s2 --> s2 now behind the string. bugfix: batch.c: batch(): fullname is duplicated into heap, but not freed if this function fails bugfix: batch.c: batch(): no error checking of batch_params() add: cmdinput.c: readcommand(): ^C: as ESC, also sets ECHO to ON bugfix: copy.c: cmd_copy(): If malloc of sources fails, 'p' is not freed bugfix: dir.c: cmd_dir(): dircmd can be NULL bugfix: filecomp.c: complete_filename(): makelower undefined if count < 0 bugfix: for.c: cmd_for(): missing out-of-memory check with batch_params() bugfix: goto.c: cmd_goto(): leave the current FOR contexts add: command.h/misc.c: match(), matchtok(), match_() test if a word begins a line, if so, skip over it and following spaces add: misc.c: comFile(): returns the absolute filename of COMMAND.COM add: misc.c: comPathFile(): returns the name of a file located in the directory as COMMAND.COM chg: init.c: ComDir: replaced by ComPath, comFile() & comPathFile() fix: init.c: initialize(): combination of "/p" and "/c"|"/k" did not work bugfix: command.c: process_input(): FOR hack: On command line one can enter "FOR %a IN () DO ...". The current implementation expanded the %A's. chg: alias.c: ltrim() & rtrim() moved to MISC.C, all "skip whitespace" code pieces use these functions now add: misc.c: trim(): combination of rtrim() & ltrim() add: assert()'s to every function 24-Mar-1999 0.77 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Added support for swapable exec. There is a compile-time directive so you can leave it out, or use it. IT DOES NOT WORK UNDER FREEDOS. Probably a kernel problem, but that has not been determined yet. o changed the way we run autoexec.bat or a batch file on the command line. This seemed to clear up some bugs with running autoexec.bat. o Changed set command so you can use a space between the variable and the value. Prints Syntax error if you don't have a space or a '='. 24-Mar-1999 0.76b Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o date.c: bugfix: detection for invalid date strings. Now the whole string must match: ^\s*\d+(.(\d+(.\d*)?)?)?\s*$ The numbers can be delimited by any character from the 7-bit ASCII set, which is printable, but not alphanumerical. One need not specify all three parts (in which case the delimiter may be omitted, too). If one specify; 1 number --> only the day changes 2 numbers --> month/day; year remains unchanged 3 numbers --> month/day/year o time.c: bugfix: Detection of invalid time strings One can specify: ^\s*\d+.\d+(.(\d+(.\d*)?)?)?\s*([aApP]([mM]|\.[mM]\.)?\s*$ If one specifies: 1 number --> error 2 numbers --> hour:minute, seconds & hundreds default to zero 3 numbers --> hour:minute:seconds, hundreds defaults to zero 4 numbers --> hour:minute:seconds.hundreds The numbers may be delimited by any character from the 7-bit ASCII set, which is printable, but not alphanumerical. o err_hand.c: bugfix: Print garbage on screen, if no disk in floppy drive An "interrupt" function saves & restores all registers and also sets up DS correctly. o created parsenum.c 11-Feb-1999 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o command.c: changed the spawnl call back to using the exec function. Now that we are handling the environment correctly, this seems to work better. It passes new environment variables (even ones that were created by this copy of command.com) to the child process. This was suggested by Steffen Kaiser. o using keypressed() that I wrote instead of Turbo C's kbhit() function because for some reason kbhit() hangs under the FreeDOS kernel. o prints seconds as it waits for a keypress from user (during initial boot) o Fixed path to autoexec.bat. o Changed openStrFile() function to try to read the strings from the end of command first, and then to try to read strings.dat in the same directory as command.com. This helps when running from the debugger. 01-Feb-1999 0.76 Rob Linwood ~~~~~~~~~~~~~~~~~~~~~~ o alias.c: added code to allow alias commands to contain extra whitespace o added "?" command that shows the available commands. 31-Jan-1999 0.76 (John P. Price ) ~~~~~~~~~~~~~~~~~~~~~~ o dir.c: Changed dir_print_header to use function INT21,AH=69 instead of the function it was using. I'm not sure if this will fix anything or not. Also fixed bug with changing and restoring the current drive. o ver.c: changed /r to identify the FreeDOS kernel. If you are using kernel build 2000 or greater, it also shows the kernel version! o init.c: when command.com is started, it shows how much memory command.com is not hogging! Hopefully this will increase soon! 28-Jan-1999 0.75i (John P. Price ) ~~~~~~~~~~~~~~~~~~~~~~ o alias.c: Changed noalias character from a dot to an asterisk (*). 25-Jan-1999 0.75i Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o This patch includes the CP/M style device name support: o Changed any open() and fopen() calls, when definitely sure that they are called for disk files only, into devopen() and fdevopen(). o Support for COPY is a hack. Rob or John should double check it, or possibly rewrite the whole file. (Thanx Steffen! - John :-) Changes in COPY.C: bugfix: setting time in ASCII mode before writing final ^Z bugfix: copy(): if bsiz < 128: the opened files are not closed chg: all error "return" statements perform the actions in the same sequence to allow the code optimizer to re-use code add: support for CP/M style device names (openf.h) chg/bugfix: overwrite(): use vcgetcstr(); could overflow the buffer chg: there were two individual flags ASCII and BINARY to indicate which option was specified. Internally only the ASCII flag was used, if it was clear, the files were copied in binary mode. To support devices the two flags are passed unchanged to the copy() function and, if both are clear (== none specified on command line), it defaults to ASCII for devices, but will not append the ^Z character. Due to this, the destination file must be opened in ASCII mode, too; otherwise the newline character had to be handled manually. o Two new files: openf.c & openf.h 25-Jan-1999 0.75i Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o This patch addresses the two bugs reported by Eric Kohl : o alias.c: aliasdel(): accesses dynamic memory after it was free()'ed. o split()'s code to skip leading whitespaces crashes at end of string. 22-Jan-1999 0.75i Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o bugfix: on suggestion of Charles Dye (raster@highfiber.com) "/ccommand" "/c" must work without a space between [MS COMMAND compatibly] also mimics: "/c/? dir" --> bad command or filename o add: DR DOS compatibly: "/c:" and "/c=" even supports wierd looking: "/c:dir/?" o add: DR DOS compatibly: "/p:AUTOEXEC_replacement" o sub: calling _fullpath() for ComDir; at this point the path must be fully-qualtifed by convention of the environ 16-Dec-1998 0.75h (John P. Price ) ~~~~~~~~~~~~~~~~~~~~~~ o alias.c: Changed so that a dot before a command will disable alias expansion. I was "noalias" but I prefer the shorter solution. 16-Dec-1998 0.75h Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o bugfix in init() for the /C branch (collecting arguments) o tracemode interaction in parsecommandline() o vcgetcstr() to fetch a visible user input, incl. validation check o command line parsing now exactly as the help screen (strings.txt) describes o show help screen using display_string() o set exitflag (and exit if allowed) if help screen was issued or a bad option was found o load messages into conventional far memory o change in message.c that string_index is not allocated dynamically o The "load messages into memory" feature allocates the block the messages are read into using the DOS API. It is not guarranteed that this block is freed by DOS upon termination of the program, therefore the atexit() function (installed by init()) explicitly frees the block, because it seems to be the best (and most secure) place to do so. o is designed to work for a file STRINGS.DAT *less* than 64KB only! o bugfix: preserve ECHO state of interactive command line (see TEST1.BAT) o bugfix with infinite loop in aliasexpand() when the useFlag warps 04-Dec-1998 0.75g Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o changed dosalloc.c in the suppl library to fix the environment problem. 03-Dec-1998 0.75f (John P. Price ) ~~~~~~~~~~~~~~~~~~~~~~ o alias.c: changed to convert to lower case instead of upper o cls.c: cls now sets the text colors to lightgray on black before clearing the screen. o command.c: Added code to remove white space from end of command in docommand function. Also added nextcmd char pointer so we don't loose the other commands in the line. This fixes the bug with "type filename.c | more" o dir.c: Rewrote DIR command. fixed problem with "DIR .COM" and other bugs. Recursive switch does not work now, but it will be added soon. o init.c: finished batch file trace mode. Fixed bug with /C command line switch running batch files. Added about 2 second delay where user can press F8 to run autoexec.bat in tracemode, or press F5 to bypass autoexec.bat completely. o messages.c: Reduced the ammount of memory allocated by not reading in entire index, but only the index element needed. 27-Oct-1998 0.75e Rob Green ~~~~~~~~~~~~~~~~~~~~~~ o command.c: changed line in is_delim function to include backslash and period. 27-Oct-1998 0.75e Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o bugfix: cmd_del(): Prompting the user for "DEL ab*.*" o chg: display_string(): Invalid FreeDOS ID is not displayed on screen o chg: get_redirection(): join '|'-loop with the other loop o chg: get_redirection(): allocate filenames (instead of parsecommand()) o bugfix: get_redirection(): Missing closing quote o bugfix: parsecommandline(): replace tmpnam() by tmpfn() to ensure that the temporary file is placed into the temporary directory instead of the current one o chg: alias.c: to reflect changes in tempfile.c o chg: rmtmpfile(): to close file pointer o chg: tempfile(): to use tmpfn() o add: tmpfn(): to create a temporary filename 13-Sep-1998 0.75d (Hans B Pufal ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ o added an icon for the program. fdcom.ico. 13-Sep-1998 0.75d (John P. Price ) ~~~~~~~~~~~~~~~~~~~~~~ o added VOL command. o fixed a couple of bugs in the COPY command. o move nearly all messages to external file that is appended to end of command.com. command.com is now an EXE type program, but has only been renamed to .COM. This allowed the file to be longger than 64K. Also changed model to small instead of tiny. o changed VER to print system info when /R is used. /D shows redistribution info now. 13-Sep-1998 0.75d Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o Corrected/rewrote ^Break handling to work on external commands. 13-Sep-1998 0.75d (Rob Lake ) ~~~~~~~~~~~~~~~~~~~~~~ o added COPY command. Not all functionality is implemented yet, but it's a great start! 10-Aug-1998 0.75b Steffen Kaiser ~~~~~~~~~~~~~~~~~~~~~~ o Corrected ^Break handling in batch.c. If one batch file (BATCH1) calls another (BATCH2), pressing ^Break or ^C most of the time asks to terminate BATCH1.BAT (Y/N/A). If you press 'Y', you should only terminate BATCH1, but BATCH2 should continue. But if you press 'A' (or ^C), all batch files should terminate. o added modifyable batch scripts (following the standard). o bug: nested comments in old split() o bug: DEL memory allocation o added ^Break checks to cmd_type(), cmd_dir() o added: chkCBreak(0) [aka "cbreak"] is a generic form that autodetects if currently a batchfile is active and displays the batchfile prompt, if so. The batchfile prompt now displays the name of the batchfile. 09-Aug-1998 0.75a (Rob Lake ) ~~~~~~~~~~~~~~~~~~~~~~ o dir.c: fixed bug that caused blank lines to be printed o dir.c: renamed _Read_Dir to Read_Dir o del.c: changed check for ^C o del.c: alloced mem for char **arg o misc.c: changed split function o misc.c: added freep function o truename.c: _truename now sets errno o created build.bat 07-Aug-1998 0.75 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Fixed carrage return output to better match MSDOS with echo on or off. 04-Aug-1998 (Hans B Pufal) ) ~~~~~~~~~~~~~~~~~~~~~~ o call.c: added lines to initialize for pointers. This fixed the lock-up that happened sometimes when calling a batch file from another batch file. 02-Aug-1998 (Hans B Pufal) ) ~~~~~~~~~~~~~~~~~~~~~~ o batch.c: Fixed bug in ECHO flag restoration at exit from batch file o command.c: Fixed return value when called with /C option o Terminate label on first space character, use only first 8 chars of label string 30-Jul-1998 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Fixed bug where if you typed something, then hit HOME, then tried to type something else in insert mode, it locked up. o Changed default insert mode to on. There should be a way to change this. Maybe options to doskey command. o Added VERIFY command 30-Jul-1998 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Changed filename completion so that a second TAB displays a list of matching filenames! o made filename be lower case if last character typed is lower case. o Moved filename completion code to filecomp.c. o Change ver command to display email address to report bugs, and the web page address for updates. o fixed so that it find_which returns NULL if filename is not executable (does not have .bat, .com, or .exe extension). Before command would to execute any file with any extension. (opps!) 29 Jul 1998 (Rob Lake rlake@cs.mun.ca) ~~~~~~~~~~~~~~~~~~~~~~ o changed date.c and time.c, and wrote datefunc.c and timefunc.c to impliment _dos_getdate, _dos_setdate, _dos_gettime and _dos_settime. This is the first of many steps to make the shell compatible under Pacific C. 28 Jul 1998 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Added CLS command. o Put ifdef's around all commands and added include file config.h Now you can define exact what commands you want to include in command.com. o Also added ifdefs for optional features: aliases, command history and filename completion. o Added display of available internal commands and options at startup. 20 Jul 1998 (John P Price ) ~~~~~~~~~~~~~~~~~~~~~~ o Fixed bug in DATE.C. o Fixed bug in LH.ASM. o Separated commands into individual files. 19 Jul 1998 (Hans B Pufal) ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ o Preserve state of echo flag across batch calls. o Implementation of FOR command 16 Jul 1998 (Rob Lake rlake@cs.mun.ca) ~~~~~~~~~~~~~~~~~~~~~~ Added TRUENAME command. 16 Jul 1998 (Hans B Pufal ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ batch.c A new version, implements CALL, ECHO, GOT, IF, PAUSE, SHIFT and BEEP. There is a stub for FOR but that's all. cmdtable.c New file to keep the internal command table. I plan on getting rid of the table real soon now and replacing it with a dynamic mechanism. command.c A new (improved ;) version. Conforms closely to MS-DOS specs. Cleaned up (and fixed) the redirection handler. command.h Version D with changes. Look for the HBP tag. redir.c Modified file, now supports append redirects. 07/13/98 version 0.74d (Rob Lake rlake@cs.mun.ca) ~~~~~~~~~~~~~~~~~~~~~~ INTERNAL.C o removed most of the commands and placed them in there own file -- del, ren, set and ver o created DEL.C, REN.C SET.C and VER.C o fixed bug that caused del not to delete files with no attributes o the critical error handler count number of times called, autofails at 5 calls 07/12/98 version 0.74c (Rob Lake rlake@cs.mun.ca) ~~~~~~~~~~~~~~~~~~~~~~ Various Files: o removed redundant use of error message defines and moved error printing calls to ERROR.C to reduced program size. o created MISC.C o created ERR_HAND.C/H o created ERROR.C 07/08/1998 version 0.74b (John P. Price (linux-guru@gcfl.net)) ~~~~~~~~~~~~~~~~~~~~~~~~ COMMAND.C o fixed call to spawnl so that it would pass command line arguments correctly. 07/08/1998 version 0.74 (John P. Price (linux-guru@gcfl.net)) ~~~~~~~~~~~~~~~~~~~~~~~~ COMMAND.C/COMMAND.H: o Now sets COMSPEC environment variable o misc clean up and optimization o added date, time and type commands o changed to using spawnl instead of exec. exec does not copy the environment to the child process! DIR.C o removed extra returns; closer to MSDOS o fixed wide display so that an extra return is not displayed when there is five filenames in the last line. ENVIRON.C o commented out show_environment function. Not used anymore. INTERAL.C o removed call to show_environment in set command. o moved test for syntax before allocating memory in set command. o misc clean up and optimization. o created DATE.C o created TIME.C o created TYPE.C 07/01/98 version 0.73 (Rob Lake) ~~~~~~~~~~~~~~~~~~~~~~ o New DIR commands supported: /S, /B, /L, /A and /W. (/R changed to /S). Also /? added. o Supports DIRCMD in environment. o Supports turning off commands with hyphen (ex. /-S turns off recursive listing) o Changed error messages for DIR and DEL to more MS-DOS'ish o Moved error messages from DIR.C and DEL.C to COMMAND.H (more may go there soon) o Fixed bug that caused dir *.ext/X not to work (no spaces between filespec and slash) o Added wildcard support for DEL command o Added prompt and help switch for DEL command, /P and /? respectively. o Added support for /C when envoking the shell o Added /P support when Kernel loads shell. This means the shell now is permanent and runs the autoexec.bat (/E is not implemented) o Added my name (Rob Lake) to the developer listing o Changed version routine to print out copyright notice with no args, and with appropriate switches, warranty and redistribution notices and developer listing 07/13/97 version 0.72b ~~~~~~~~~~~~~~~~~~~~~~ Disabled a feature that caused a crash on some machines. o Replaced setcursor calls in cmdinput.c with _setcursortype o Added dir.c to the distribution (was left out in 0.72) 07/12/97 version 0.72 ~~~~~~~~~~~~~~~~~~~~~ More bug fixes and code cleanup o Rewrote cmdinput.c to be more efficient (Marc Desrochers) o Added insert/overstrike modes (Marc Desrochers) o Replaced findxy() with pointers into BIOS (maxx, maxy) (Marc Desrochers) o Fixed bug that disallowed listing of root directories o Fixed bug that didn't search the first path (again!) 06/14/97 version 0.71 ~~~~~~~~~~~~~~~~~~~~~ Lots of bug fixes, plus some additional features. o New DIR command. Now more like MS-DOS's DIR. /p supported, /s coming soon o bug fix in internal.c - parse_firstarg o Rewrote parser in batch.c (Steffan Kaiser) o Ctrl-Break checking in various places (Steffan Kaiser) o Error level setting/checking (%? in batch files) (Steffan Kaiser) o bug fix in cmdinput.c ("%i" on command-line caused weird behavior) o bug fix in where.c (first item in path wasn't searched) 08/27/96 version 0.70 ~~~~~~~~~~~~~~~~~~~~~ Finally added Oliver Mueller's ALIAS command! Also numerous bug fixes. o Added ALIAS command o Removed support for - as a switch in LOADHIGH.C o Bugfixes in BATCH.C. %0 was returning garbage o Removed lots of unused variables, reducing # of warnings when compiling o Other miscellaneous code clean-ups o Changed WHERE.C to use a little less memory 07/26/96 version 0.61 ~~~~~~~~~~~~~~~~~~~~~ Bugfixes o Added hook to the PATH command o Fixed CD.. bug 07/26/96 version 0.60 ~~~~~~~~~~~~~~~~~~~~~ Lots of internal changes here... Not much added to the interface. o Changed internals to use first,rest parameters instead of arrays of params o Fixed some bugs o Some other things I don't remember :) 01/17/96 version 0.50 ~~~~~~~~~~~~~~~~~~~~~ Version 0.40 was never released because I was home on Christmas vacation, and I couldn't upload it. By the time I got back to school, I had the LOADHIGH patch from Svante Frey, so I decided to jump up to 0.50 without any release of 0.40... - Tim Norman o LOADHIGH/LOADFIX/LH support added!!!! Many thanks go to Svante Frey! o bug fixed in command parsing that didn't handle / switches correctly... o removed debugging output from history.c 01/06/96 version 0.40 (never released) ~~~~~~~~~~~~~~~~~~~~~ o added redirection and piping support!!! (see redir.c and command.c) o fixed a stupid pointer problem in where.c that was causing LOTS of problems in the strangest places... o added day of the week support to prompt.c (oops, that was already supposed to be there! :) o fixed and reorganized the EXEC code!!! Thanks to Svante Frey! o reorganized command.c and internal.c to handle parsing internal commands more efficiently and consistently. o changed the behavior of MD, CD, RD to work without spaces (e.g. CD\DOS) o small changes here and there to make it work with redirection/piping (e.g. DIR only pauses if you're not doing redirection) 12/14/95 version 0.31 ~~~~~~~~~~~~~~~~~~~~~ o modified cmdinput.c to work with non-standard screen sizes (see 28.com) o fixed a bug in history.c that made it not work when you hit the up arrow on the first line o fixed DIR to work a little more like MS-DOS's DIR (see internal.c) o fixed some code in where.c to make things a bit more efficient and nicer 12/10/95 version 0.30 ~~~~~~~~~~~~~~~~~~~~~ o used Borland's spawnve to fix exec problem o fixed CD again so you don't need a space after it o couple of spelling fixes 08/06/95 prerelease of version 0.30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ o reorganized code into separate source modules. o added batch processing support (thanks to Evan Jeffrey). o added exec code (thanks to Steffan Kaiser). o removed environment handling (thanks again to Steffan Kaiser) [ 08/08/95 -- Matt Rains ] o formatted this development log. o formatted all existing source modules so that they comply with recommended programming practice. o added MD command. o added RD command. o added VER command. o replaced CD command. o modified DIR command. o DIR now called regardless of other DIR.??? files. this is done because of exec() problems. 01/15/95 version 0.20 ~~~~~~~~~~~~~~~~~~~~~ o formatted all existing source modules. o added prompt support. o added drive selection. o added dir command. o started this development log. 01/01/95 version 0.10 ~~~~~~~~~~~~~~~~~~~~~ o removed some scaffolding. o modified CD. o added tab file completion. o added command line history. 11/11/94 version 0.01 ~~~~~~~~~~~~~~~~~~~~~ o initial release. ================================================ FILE: docs/html/build48.html ================================================ HOW to compile FreeCOM

HOW to Compile FreeCOM v0.8x in Ten Steps

Because of several complaints about how to compile FreeCOM, this description has been crafted to show this process step-by-step.

Table of Contents

Preparations
     Used System
     Required Programs and Libraries
System Configuration
     CONFIG.SYS
     AUTOEXEC.BAT
One-time Preparations
     Contents of Directory C:\BIN
     Contents of Directory C:\
Ten Steps to Compile FreeCOM v0.8x


Preparations

This description starts at the scratch, hence, it is assumed that no other tools are already installed and up and running. If there are some program available, you must take precautions to incorporate them into the process.

Used System

This examples uses the following system:
  • VMware, VirtualBox, DOSEMU2, DOSBOX-X (to emulate an unique PC, with a newly formatted, virtual partition)
  • OS: FreeDOS kernel, binary release downloaded from: https://github.com/FDOS/kernel;
  • Shell: FreeCOM v0.83 Beta 46 or later (tested with both binary release and XMS-Swap release); downloaded from FreeCOM's home page on GitHub
    The binary variant is installed as the default shell COMMAND.COM, the XMS-Swapping variant is installed as COM-XMS.COM; both on the root directory of the hard disk parition.

Required Programs and Libraries

All this stuff will be made accessable to the Virtual PC through CD-Rom, as this is the only variant for this VMware release.
  • Nasm (aka Netware Assembler) is used to compile enclosed assembly files; Nasm is hosted on https://www.nasm.us/, too; Version 2.15 or newer is recommended of the 16-bit pre-compiled Nasm.
    The Nasm Zip-file is unpacked into directory nasm on the CD-Rom.
  • Open Watcom or GCC-ia16 are the recommended compilers, but Borland compilers are still supported.
  • Turbo C++ v1.01 is used to compile the enclosed C files, download from the Borland museum.
    The Turbo C++ Zip-file is unpacked into directory tcpp101 on the CD-Rom.
  • Some unzip-utility for DOS, I'm using UnZip 5.12 of 28 August 1994, by Info-ZIP.
    Executable is located at the root directory of the CD-Rom.
  • Some plain text editor for DOS, I'm using Elvis v2.1_4 for DOS.
    The executable is named vi.exe and is located at the root directory of the CD-Rom.
  • The source of FreeCOM v0.83 Beta 48, located on the root directory of the CD-Rom.
    Or pick some newer release.
  • The SUPPL library pre-compiled for Turbo C++ v1.01, located on the root directory of the CD-Rom. *** SUPPL is now included within the FreeCOM source archive, though it may still work from standalone version.

System Configuration

CONFIG.SYS

files=20
device=fdxms.sys
device=NEC_IDE.SYS /D:CD001
;shell=com-xms.com /p/e:256

AUTOEXEC.BAT

path c:\bin;c:\tcpp101\bin
set TEMP=C:\Temp
SHSUCDX.EXE  /D:CD001

One-time Preparations

Note: On drive D: the CD-Rom has been mounted.
MKDIR %TEMP%
MKDIR C:\BIN
COPY D:\NASM\NASM.EXE D:\VI.EXE D:\UNZIP.EXE C:\BIN
d:
cd tcpp101
install

Contents of Directory C:\BIN

 Volume in drive C has no label
 Volume Serial Number is 58EF-6DA7

 Directory of C:\BIN

.                    <DIR>  11-03-02  9:44a
..                   <DIR>  11-03-02  9:44a
VI       EXE       372,158  04-25-01 12:37p
SHSUCDX  EXE        15,726  10-20-00 10:34p
NASM     EXE       252,452  09-12-02  6:37p
UNZIP    EXE        43,691  08-29-94  9:37p
         4 file(s)        684,027 bytes
         2 dir(s)      24,221,696 bytes free

Contents of Directory C:\

 Volume in drive C has no label
 Volume Serial Number is 58EF-6DA7

 Directory of C:\

KERNEL   SYS        40,962  10-27-02 11:17p
COMMAND  COM        86,573  10-16-02  9:10p
COM-XMS  COM        88,203  10-16-02  9:07p
CONFIG   SYS            86  10-30-02  1:24p
AUTOEXEC BAT            69  10-30-02 11:28a
FDXMS    SYS         4,836  03-02-02  6:55p
NEC_IDE  SYS        29,089  04-26-96  8:37a
TEMP                 <DIR>  04-25-01  1:32p
TCPP101              <DIR>  11-03-02  9:56a
BIN                  <DIR>  11-03-02  9:44a
         7 file(s)        249,818 bytes
         3 dir(s)      24,221,696 bytes free

Ten Steps to Compile FreeCOM v0.83 Beta 48

c:
CD \
unzip d:\COM083BE.ZIP
unzip -q freecom.zip
del freecom.zip 
cd freecom\suppl\
unzip -n d:\suppl.zip
cd ..
vi config.mak
build

There should be a COMMAND.COM located in the current directory now.

There is also a sample build log.

The build script uses the environment variables SWAP and LNG.


Appendix A: Description of settings

  • FILES=20 is required by Turbo C++.

  • The driver fdxms.sys provides a XMS API similiar to HIMEM.SYS

  • The driver NEC_IDE.SYS I've got along with some Oak IDE-CD-Rom device and seems to handle all recent IDE-CD-Rom drivers pretty well, like the emulated CD-Rom in VMware.
    The option /D:CD001 causes the driver to install a device named CD001 for the CD-Rom device in order to be found by the CD-redirector later on.

  • Uncomment (remove the semicolon from the first column of the line) the line in order to use the XMS-Swapping variant of FreeCOM v0.83 Beta 46.

  • The two directories in which DOS is to search for executable programs:

    1. In C:\BIN all relevant tools, such as assembler and Unzip, will be located.
    2. In c:\tcpp101\bin the executables of the Turbo C++ compiler are located.
  • The environment variable TEMP points to the directory temporary files are to be created in.

  • Loads the CD-Rom mid-level driver, similiar to MSCDEX, the option /D:CD001 must specify the same driver name as the low-level CD-Rom driver.

  • Create the temporary directory, if not already present.

  • Create the directory for the executables, if not already present.

  • Copy all the executables, like assembler, text editor and unzip-utility, to the central directory.

  • The unpacked Turbo C++ v1.01 install files are located in this directory.

  • Runs the Turbo C++ v1.01 installation program. The following settings are used:

    • Source drive: D
    • Source directory: \TCPP101
    • select entry Turbo C++ Directory
    • Target directory: C:\TCPP101
      All the remaining installation directories should automatically be changed below this directory.
    • select entry Start Installation
  • The SHSUCDX presents the long filename com083Beta48.zip as COM083BE.ZIP, hence, unzipping the FreeCOM source archive.
    Note: This is the only point to change when compiling another FreeCOM release usually; just unpack the particular .ZIP file here. However, it is not recommended to overwrite an elder release of FreeCOM; when doing so, you should at least pass the -r option to build!

  • Because the FreeCOM archive is a double-zipped archive, FREECOM.ZIP is the real archive containing the source files. In result a new directory FREECOM containing all the source tree is created. The option -q causes unzip to run quitely.

  • Go to the default location of the SUPPL library.

  • Unzip the pre-compiled SUPPL library, the option -n causes unzip to not complain about the already present files in the current directory.

  • Go to the main directory of FreeCOM.

  • Edit the configuration of the build process via adopting the file CONFIG.MAK:
    Note: The default configuration has been adjusted to comply with these steps, hence, no adoptions are required; so you might skip this step as well.

  • Actually runs the build process:

    • in order to force to re-built all portions of FreeCOM, e.g. when the source code was overwritten with another version or when switching between XMS-Swapping enabled or disabled, pass the -r option as the first argument to build.
    • to build the XMS-Swapping variant of FreeCOM specify xms-swap as the first (or second) argument, e.g.:
      build.bat xms-swap
      .
    • to build FreeCOM with some specific language other than English, specify the language as the last argument, e.g.:
      build.bat Dutch
      or
      build.bat xms-swap Dutch
      . For each supported language, a corresponding .LNG file is located in sub-directory STRINGS, hence, the command DIR STRINGS\*.LNG displays a list of supported languages. Do not specify the extension .LNG on build's command line!

    The environment variable SWAP is internally used by the build script and is removed upon successful finish.
    The script stores the selected language, or English if none has been selected on command line and the variable is not already defined, into the environment variable LNG; hence, the selected language keeps permanently selected between different runs of build, until reset by the user manually as the last argument of the build script, by removing or changing the variable directly or by rebooting the system.
  • Note: This Logfile stops when building the TOOLS directory.

    File not found. - 'C:\FREECOM\LASTMAKE.MK'
    File not found. - 'C:\FREECOM\TOOLS\*.MAP'
    File not found. - 'C:\FREECOM\TOOLS\*.COM'
    File not found. - 'C:\FREECOM\UTILS\*.MAP'
    File not found. - 'C:\FREECOM\CRITER\*.OBJ'
    File not found. - 'C:\FREECOM\CRITER\*.CFG'
    MAKE0000.$$$ => C:\FREECOM\UTILS\TCCDOS.CFG
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    mktools.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    mkctxt.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    chunk.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    mkinfres.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    MAKE0000.$$$ => C:\FREECOM\STRINGS\TCCDOS.CFG
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    fixstrs.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    FIXSTRS: loading file DEFAULT.LNG
    FIXSTRS: loading file english
    FIXSTRS: building STRINGS resource
    FIXSTRS: building STRINGS library source files
    strings.h => C:\FREECOM\STRINGS\..\strings.h
    MAKE0001.$$$ => C:\FREECOM\STRINGS\MKSTRLIB.BAT
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    critstrs.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    CRITSTRS: load file DEFAULT.ERR
    CRITSTRS: load file english
    CRITSTRS: Running validation check
    CRITSTRS: Dumping CRITER strings resource
    TLIB 3.01 Copyright (c) 1987, 1990 Borland International
    +str0000.obj &
    +str0001.obj &
    +str0002.obj &
    +str0003.obj &
    +str0004.obj &
    +str0005.obj &
    +str0006.obj &
    +str0007.obj &
    +str0008.obj &
    +str0009.obj &
    +str000a.obj &
    +str000b.obj &
    +str000c.obj &
    +str000d.obj &
    +str000e.obj &
    +str000f.obj &
    +str0010.obj &
    +str0011.obj &
    +str0012.obj &
    +str0013.obj &
    +str0014.obj &
    +str0015.obj &
    +str0016.obj &
    +str0017.obj &
    +str0018.obj &
    +str0019.obj &
    +str001a.obj &
    +str001b.obj &
    +str001c.obj &
    +str001d.obj &
    +str001e.obj &
    +str001f.obj &
    +str0020.obj &
    +str0021.obj &
    +str0022.obj &
    +str0023.obj &
    +str0024.obj &
    +str0025.obj &
    +str0026.obj &
    +str0027.obj &
    +str0028.obj &
    +str0029.obj &
    +str002a.obj &
    +str002b.obj &
    +str002c.obj &
    +str002d.obj &
    +str002e.obj &
    +str002f.obj &
    +str0030.obj &
    +str0031.obj &
    +str0032.obj &
    +str0033.obj &
    +str0034.obj &
    +str0035.obj &
    +str0036.obj &
    +str0037.obj &
    +str0038.obj &
    +str0039.obj &
    +str003a.obj &
    +str003b.obj &
    +str003c.obj &
    +str003d.obj &
    +str003e.obj &
    +str003f.obj &
    +str0040.obj &
    +str0041.obj &
    +str0042.obj &
    +str0043.obj &
    +str0044.obj &
    +str0045.obj &
    +str0046.obj &
    +str0047.obj &
    +str0048.obj &
    +str0049.obj &
    +str004a.obj &
    +str004b.obj &
    +str004c.obj &
    +str004d.obj &
    +str004e.obj &
    +str004f.obj &
    +str0050.obj &
    +str0051.obj &
    +str0052.obj &
    +str0053.obj &
    +str0054.obj &
    +str0055.obj &
    +str0056.obj &
    +str0057.obj &
    +str0058.obj &
    +str0059.obj &
    +str005a.obj &
    +str005b.obj &
    +str005c.obj &
    +str005d.obj &
    +str005e.obj &
    +str005f.obj &
    +str0060.obj &
    +str0061.obj &
    +str0062.obj &
    +str0063.obj &
    +str0064.obj &
    +str0065.obj &
    +str0066.obj &
    +str0067.obj &
    +str0068.obj &
    +str0069.obj &
    +str006a.obj &
    +str006b.obj &
    +str006c.obj &
    +str006d.obj &
    +str006e.obj &
    +str006f.obj &
    +str0070.obj &
    +str0071.obj &
    +str0072.obj &
    +str0073.obj &
    +str0074.obj &
    +str0075.obj &
    +str0076.obj &
    +str0077.obj &
    +str0078.obj &
    +str0079.obj &
    +str007a.obj &
    +str007b.obj &
    +str007c.obj &
    +str007d.obj &
    +str007e.obj &
    +str007f.obj &
    +str0080.obj &
    +str0081.obj &
    +str0082.obj &
    +str0083.obj &
    +str0084.obj &
    +str0085.obj &
    +str0086.obj &
    +str0087.obj &
    +str0088.obj &
    +str0089.obj &
    +str008a.obj &
    +str008b.obj &
    +str008c.obj &
    +str008d.obj &
    +str008e.obj &
    +str008f.obj &
    +str0090.obj &
    +str0091.obj &
    +str0092.obj &
    +str0093.obj &
    +str0094.obj &
    +str0095.obj &
    +str0096.obj &
    +str0097.obj &
    +str0098.obj &
    +str0099.obj &
    +str009a.obj &
    +str009b.obj &
    +str009c.obj &
    +str009d.obj &
    +str009e.obj &
    +str009f.obj &
    +str00a0.obj &
    +str00a1.obj &
    +str00a2.obj &
    +str00a3.obj &
    +str00a4.obj &
    +str00a5.obj &
    +str00a6.obj &
    +str00a7.obj &
    +str00a8.obj &
    +str00a9.obj &
    +str00aa.obj &
    +str00ab.obj &
    +str00ac.obj &
    +str00ad.obj &
    +str00ae.obj &
    +str00af.obj &
    +str00b0.obj &
    +str00b1.obj &
    +str00b2.obj &
    +str00b3.obj &
    +str00b4.obj &
    +str00b5.obj &
    +str00b6.obj &
    +str00b7.obj &
    +str00b8.obj &
    +str00b9.obj &
    +str00ba.obj &
    +str00bb.obj &
    +str00bc.obj &
    +str00bd.obj &
    +str00be.obj &
    +str00bf.obj &
    +str00c0.obj &
    +str00c1.obj &
    +str00c2.obj &
    +str00c3.obj &
    +str00c4.obj &
    +str00c5.obj &
    +str00c6.obj &
    +str00c7.obj &
    +str00c8.obj &
    +str00c9.obj &
    +str00ca.obj &
    +str00cb.obj &
    +str00cc.obj &
    +str00cd.obj &
    +str00ce.obj &
    +str00cf.obj &
    +str00d0.obj &
    +str00d1.obj &
    +str00d2.obj &
    +str00d3.obj &
    +str00d4.obj &
    +str00d5.obj &
    +str00d6.obj &
    +str00d7.obj &
    +str00d8.obj &
    +str00d9.obj &
    +str00da.obj &
    +str00db.obj &
    +str00dc.obj &
    +str00dd.obj &
    +str00de.obj &
    +str00df.obj &
    +str00e0.obj &
    +str00e1.obj &
    +str00e2.obj 
    strings.lib => C:\FREECOM\STRINGS\STRINGS\..\strings.lib
    strings.lst => C:\FREECOM\STRINGS\STRINGS\..\strings.lst
    context.h_c => C:\FREECOM\CRITER\..\context.h_c
    context.inc => C:\FREECOM\CRITER\..\context.inc
    MAKE0000.$$$ => C:\FREECOM\LIB\TCCDOS.CFG
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    alprmblk.c:
    alsysblk.c:
    beep_l.c:
    beep_n.c:
    brk_get.c:
    brk_set.c:
    cbreak.c:
    cbs.c:
    cd_dir.c:
    cgetch.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    cgettime.c:
    chgctxt.c:
    chgdrv.c:
    chgenv.c:
    chgenvc.c:
    chgenvr.c:
    cmdinput.c:
    comfile.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    compfile.c:
    ctxt.c:
    ctxt_adr.c:
    ctxt_as.c:
    ctxt_chg.c:
    ctxt_clr.c:
    ctxt_get.c:
    ctxt_inf.c:
    ctxt_mk.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    ctxt_mkn.c:
    ctxt_pop.c:
    ctxt_psh.c:
    ctxt_rnu.c:
    ctxt_set.c:
    ctxt_ss.c:
    ctxt_vw.c:
    curdatel.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    curtime.c:
    cwd.c:
    dateget.c:
    dateset.c:
    dbg_c.c:
    dbg_mem.c:
    dbg_prnt.c:
    dbg_s.c:
    dbg_sn.c:
    devopen.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    dispcnt.c:
    drvnum.c:
    efct_001.c:
    exec.c:
    exec1.c:
    farread.c:
    fcompl1.c:
    fcompl2.c:
    fdattr.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    fdevopen.c:
    fdsattr.c:
    fillcomp.c:
    find.c:
    freep.c:
    frsysblk.c:
    fstpcpy.c:
    gallstr.c:
    get1mcb.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    getenv.c:
    goxy.c:
    grabfcom.c:
    gumblink.c:
    hdlrctxt.c:
    hist_get.c:
    hist_set.c:
    inputdos.c:
    is_empty.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    is_fnamc.c:
    is_fnstr.c:
    is_pchr.c:
    isadev.c:
    keyprsd.c:
    kswap_c.c:
    lastdget.c:
    lastdset.c:
    leadopt.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    ltrimcl.c:
    ltrimsp.c:
    lwr1wd.c:
    match.c:
    messages.c:
    mk_rddir.c:
    mktmpfil.c:
    msg_dflt.c:
    msg_dps.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    msg_fstr.c:
    msg_get.c:
    msg_gpt.c:
    msg_mkey.c:
    msg_prmp.c:
    mux_ae.c:
    nls.c:
    nls_date.c:
    nls_time.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    num_fmt.c:
    onoff.c:
    openf.c:
    optsb.c:
    optsi.c:
    optss.c:
    parsenum.c:
    pr_date.c:
    pr_prmpt.c:
    pr_time.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    prprompt.c:
    realnum.c:
    res.c:
    res_r.c:
    res_w.c:
    resfile.c:
    rmtmpfil.c:
    rtrimcl.c:
    rtrimsp.c:
    salloc.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    samefile.c:
    scancmd.c:
    scanopt.c:
    showcmds.c:
    skqwd.c:
    split.c:
    sumblink.c:
    tempfile.c:
    timeget.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    timeset.c:
    tmpnam.c:
    trimcl.c:
    trimsp.c:
    txtlend.c:
    unquote.c:
    vcgetch.c:
    vcgetstr.c:
    where.c:
    err1.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err2.c:
    err3.c:
    err4.c:
    err5.c:
    err6.c:
    err7.c:
    err8.c:
    err9.c:
    err10.c:
    err11.c:
    err12.c:
    err13.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err14.c:
    err15.c:
    err16.c:
    err17.c:
    err18.c:
    err19.c:
    err20.c:
    err21.c:
    err22.c:
    err23.c:
    err24.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err25.c:
    err26.c:
    err27.c:
    err28.c:
    err29.c:
    err30.c:
    err31.c:
    err32.c:
    err33.c:
    err34.c:
    err35.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err36.c:
    err37.c:
    err38.c:
    err39.c:
    err40.c:
    err41.c:
    err42.c:
    err43.c:
    err44.c:
    err45.c:
    err46.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err47.c:
    err48.c:
    err49.c:
    err50.c:
    err51.c:
    err52.c:
    err53.c:
    err54.c:
    err55.c:
    err56.c:
    err57.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err58.c:
    err59.c:
    err60.c:
    err61.c:
    err62.c:
    err63.c:
    err64.c:
    err65.c:
    err66.c:
    err67.c:
    err68.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err69.c:
    err70.c:
    err71.c:
    err72.c:
    err73.c:
    err74.c:
    err75.c:
    err76.c:
    err77.c:
    err78.c:
    err79.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    err80.c:
    TLIB 3.01 Copyright (c) 1987, 1990 Borland International
    +alprmblk.obj &
    +alsysblk.obj &
    +beep_l.obj &
    +beep_n.obj &
    +brk_get.obj &
    +brk_set.obj &
    +cbreak.obj &
    +cbs.obj &
    +cd_dir.obj &
    +cgetch.obj &
    +cgettime.obj &
    +chgctxt.obj &
    +chgdrv.obj &
    +chgenv.obj &
    +chgenvc.obj &
    +chgenvr.obj &
    +cmdinput.obj &
    +comfile.obj &
    +compfile.obj &
    +ctxt.obj &
    +ctxt_adr.obj &
    +ctxt_as.obj &
    +ctxt_chg.obj &
    +ctxt_clr.obj &
    +ctxt_get.obj &
    +ctxt_inf.obj &
    +ctxt_mk.obj &
    +ctxt_mkn.obj &
    +ctxt_pop.obj &
    +ctxt_psh.obj &
    +ctxt_rnu.obj &
    +ctxt_set.obj &
    +ctxt_ss.obj &
    +ctxt_vw.obj &
    +curdatel.obj &
    +curtime.obj &
    +cwd.obj &
    +dateget.obj &
    +dateset.obj &
    +dbg_c.obj &
    +dbg_mem.obj &
    +dbg_prnt.obj &
    +dbg_s.obj &
    +dbg_sn.obj &
    +devopen.obj &
    +dispcnt.obj &
    +drvnum.obj &
    +efct_001.obj &
    +exec.obj &
    +exec1.obj &
    +farread.obj &
    +fcompl1.obj &
    +fcompl2.obj &
    +fdattr.obj &
    +fdevopen.obj &
    +fdsattr.obj &
    +fillcomp.obj &
    +find.obj &
    +freep.obj &
    +frsysblk.obj &
    +fstpcpy.obj &
    +gallstr.obj &
    +get1mcb.obj &
    +getenv.obj &
    +goxy.obj &
    +grabfcom.obj &
    +gumblink.obj &
    +hdlrctxt.obj &
    +hist_get.obj &
    +hist_set.obj &
    +inputdos.obj &
    +is_empty.obj &
    +is_fnamc.obj &
    +is_fnstr.obj &
    +is_pchr.obj &
    +isadev.obj &
    +keyprsd.obj &
    +kswap_c.obj &
    +lastdget.obj &
    +lastdset.obj &
    +leadopt.obj &
    +lowexec.obj &
    +ltrimcl.obj &
    +ltrimsp.obj &
    +lwr1wd.obj &
    +match.obj &
    +messages.obj &
    +mk_rddir.obj &
    +mktmpfil.obj &
    +msg_dflt.obj &
    +msg_dps.obj &
    +msg_fstr.obj &
    +msg_get.obj &
    +msg_gpt.obj &
    +msg_mkey.obj &
    +msg_prmp.obj &
    +mux_ae.obj &
    +nls.obj &
    +nls_date.obj &
    +nls_time.obj &
    +num_fmt.obj &
    +onoff.obj &
    +openf.obj &
    +optsb.obj &
    +optsi.obj &
    +optss.obj &
    +parsenum.obj &
    +pr_date.obj &
    +pr_prmpt.obj &
    +pr_time.obj &
    +prprompt.obj &
    +realnum.obj &
    +res.obj &
    +res_r.obj &
    +res_w.obj &
    +resfile.obj &
    +rmtmpfil.obj &
    +rtrimcl.obj &
    +rtrimsp.obj &
    +salloc.obj &
    +samefile.obj &
    +scancmd.obj &
    +scanopt.obj &
    +showcmds.obj &
    +skqwd.obj &
    +split.obj &
    +sumblink.obj &
    +tempfile.obj &
    +timeget.obj &
    +timeset.obj &
    +tmpnam.obj &
    +trimcl.obj &
    +trimsp.obj &
    +txtlend.obj &
    +unquote.obj &
    +vcgetch.obj &
    +vcgetstr.obj &
    +where.obj &
    +err1.obj &
    +err2.obj &
    +err3.obj &
    +err4.obj &
    +err5.obj &
    +err6.obj &
    +err7.obj &
    +err8.obj &
    +err9.obj &
    +err10.obj &
    +err11.obj &
    +err12.obj &
    +err13.obj &
    +err14.obj &
    +err15.obj &
    +err16.obj &
    +err17.obj &
    +err18.obj &
    +err19.obj &
    +err20.obj &
    +err21.obj &
    +err22.obj &
    +err23.obj &
    +err24.obj &
    +err25.obj &
    +err26.obj &
    +err27.obj &
    +err28.obj &
    +err29.obj &
    +err30.obj &
    +err31.obj &
    +err32.obj &
    +err33.obj &
    +err34.obj &
    +err35.obj &
    +err36.obj &
    +err37.obj &
    +err38.obj &
    +err39.obj &
    +err40.obj &
    +err41.obj &
    +err42.obj &
    +err43.obj &
    +err44.obj &
    +err45.obj &
    +err46.obj &
    +err47.obj &
    +err48.obj &
    +err49.obj &
    +err50.obj &
    +err51.obj &
    +err52.obj &
    +err53.obj &
    +err54.obj &
    +err55.obj &
    +err56.obj &
    +err57.obj &
    +err58.obj &
    +err59.obj &
    +err60.obj &
    +err61.obj &
    +err62.obj &
    +err63.obj &
    +err64.obj &
    +err65.obj &
    +err66.obj &
    +err67.obj &
    +err68.obj &
    +err69.obj &
    +err70.obj &
    +err71.obj &
    +err72.obj &
    +err73.obj &
    +err74.obj &
    +err75.obj &
    +err76.obj &
    +err77.obj &
    +err78.obj &
    +err79.obj &
    +err80.obj
    MAKE0000.$$$ => C:\FREECOM\CMD\TCCDOS.CFG
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    alias.c:
    beep.c:
    break.c:
    call.c:
    cdd.c:
    chdir.c:
    cls.c:
    copy.c:
    ctty.c:
    date.c:
    del.c:
    dir.c:
    dirs.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    doskey.c:
    echo.c:
    exit.c:
    exit2.c:
    fddebug.c:
    for.c:
    goto.c:
    history.c:
    if.c:
    memory.c:
    mkdir.c:
    path.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    pause.c:
    popd.c:
    prompt.c:
    pushd.c:
    rem.c:
    ren.c:
    rmdir.c:
    set.c:
    shift.c:
    time.c:
    truename.c:
    type.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    verify.c:
    which.c:
    TLIB 3.01 Copyright (c) 1987, 1990 Borland International
    +alias.obj &
    +beep.obj &
    +break.obj &
    +call.obj &
    +cdd.obj &
    +chdir.obj &
    +cls.obj &
    +copy.obj &
    +ctty.obj &
    +date.obj &
    +del.obj &
    +dir.obj &
    +dirs.obj &
    +doskey.obj &
    +echo.obj &
    +exit.obj &
    +exit2.obj &
    +fddebug.obj &
    +for.obj &
    +goto.obj &
    +history.obj &
    +if.obj &
    +memory.obj &
    +mkdir.obj &
    +path.obj &
    +pause.obj &
    +popd.obj &
    +prompt.obj &
    +pushd.obj &
    +rem.obj &
    +ren.obj &
    +rmdir.obj &
    +set.obj &
    +shift.obj &
    +time.obj &
    +truename.obj &
    +type.obj &
    +verify.obj &
    +which.obj
    MAKE0000.$$$ => C:\FREECOM\SHELL\TCCDOS.CFG
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    cswapc.c:
    batch.c:
    cmdtable.c:
    command.c:
    Turbo C++  Version 1.01 Copyright (c) 1990 Borland International
    expalias.c:
    init.c:
    kswap.c:
    loadhigh.c:
    module.c:
    redir.c:
    ver.c:
    Turbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International
    Warning: __fstpcpy defined in module FSTPCPY.OBJ is duplicated in module FSTPCPY
    Warning: _exit defined in module cswapc.c is duplicated in module EXIT
    Warning: _putenv defined in module ENV_PUT.OBJ is duplicated in module PUTENV
    shell\command.exe => C:\FREECOM\COMMAND.COM
    infores =>> C:\FREECOM\COMMAND.COM
    criter\criter1 =>> C:\FREECOM\COMMAND.COM
    criter\criter =>> C:\FREECOM\COMMAND.COM
    strings\strings.dat =>> C:\FREECOM\COMMAND.COM
    Poking: @19DF:0080 = 1




Copyright 2002 © Steffen Kaiser - former maintainer of FreeCOM

Elvis - The VI clone ================================================ FILE: docs/html/commands/FreeCOM.html ================================================ Description of Features and Implementation Status of FreeCOM

  1. Introduction
  2. FreeCOM Command Line Syntax - Useage, Switches and Options
  3. Environment Variables
  4. Internal Commands
  5. User Prompt
    1. Command Line Syntax
    2. Command Line Editing
  6. Features of FreeCOM
  7. Status of FreeCOM / To-do List
  8. Appendix
    1. Compile FreeCOM - sample
    2. Download
    3. CVS Resources
    4. Bug Tracking / Bugzilla
    5. EBNF


Introduction

FreeCOM is a:
  • Command Line Interface,
  • (user) shell and/or
  • COMMAND.COM replacement
for DOS. It has been spawned as part of FreeDOS, a project that aims to implement a GNU GPL'ed DOS.

The main duty of FreeCOM is to prompt the user to enter commands, which are interpreted, processed directly by FreeCOM or executed as executable files.

Those commands processed by FreeCOM directly are called Internal Commands.

Non-internal commands, which cannot be processed by FreeCOM directly, are called External Commands, because FreeCOM will search for files equally named as typed-in.

Besides to implement certain commands FreeCOM offers some features.


Command Line Syntax, Useage, Switches and Options

EBNF: COMMAND.COM [ path [ console ] ] [{ option }] [ '/' ( K | C ) <> ]

If present, the first non-option argument specifies the location in which FreeCOM resides. This location is later stored in the environment variable COMSPEC. Since DOS3+ this option is no longer necessary to find the shell invoked during the boot process, but it may be used to let the system boot a primary shell from one location, but use a shell of the same version from a different location later on.
One shallt not point to a RAMdisk at this time, because FreeCOM needs to reload certain information relatively early during execution, before AUTOEXEC.BAT had been executed, in which, normally, FreeCOM is copied into the RAMdisk.
For convinience FreeCOM checks, if at the given location a FreeCOM exists and is accessable, if not, the given location is ignored. Also, the standard requires to specify a path only, but FreeCOM accepts an absolute filename, so accepting that FreeCOM is not necessarily named COMMAND.COM.

The second non-option argument, if present, specifies the console FreeCOM shall enable. This setting is system-wide and is not limited to FreeCOM or just this particular process tree. In its result, this argument is identical to the CTTY command.

FreeCOM knows the following options:

  • /?: Issues a help screen, then exists.
  • /!: Enable/disable debugging support, if compiled to FreeCOM.
  • /Y: Enables trace/single step mode. This mode is deaktivated when the user prompt has been reached.
  • /D: Disables to parse AUTOEXEC.BAT, even if the /P option is present. This switch is usually set by the kernel, when F5 had been pressed during bootup.
  • /F: Enables autofail of Critical Errors; then instead of displaying the Abort/Retry/Ignore/Fail dialog, Critical Errors are automatically answered with Fail.
  • /P: Installs a primary copy of FreeCOM. Such instance:
    1. cannot be terminated with the EXIT command.
    2. executes the AUTOEXEC.BAT script before any other command.
    The /P option may have an argument to specify an alternate name for the AUTOEXEC script, e.g.: /P:FDAUTO.BAT.
  • /E: Sets another size of the environment segment, in which all the environment variables are stored, e.g.: /E:1024.
  • /L: Sets the size of the internal command buffer. Note: This option is ignored currently, the internal buffer always defaults to 512 bytes.
  • /U Sets the size of the internal user input buffer. Note: This option is ignored currently. The input buffer always defaults to 255 bytes, which is the maximum.
  • /Z: Displays the errorlevel whenever an external program terminates. Avaiable, if FreeCOM had been compiled DISP_EXITCODE.
  • /LOW: Forces to load FreeCOM low. Note: Currently this option has no effect, because no part of FreeCOM is loaded high.
  • /MSG: Installs the message server. Note: Because the message server is not used nowadays, this option forces to permanently load FreeCOM's messages into memory.
  • /SWAP: Toggles, if to default to swapping or not; due to different default values of this internal flag, it is recommended to always prefix the option with '+' to enable or '-' to disable swapping.
The options /K and /C are special cases and do not behave as normal options does. They are exclusive and all characters at the right side of such option (except an optional argument sign) specify a command to execute, e.g.: /C DIR /s, /C=DIR /s, and /CDIR /s do behave exactly the same and execuate the command DIR /s.
If these options are used in conjunction with the /P option, the AUTOEXEC.BAT script is executed prior executing the specified command.
In opposite to /K the /C option does not enter the interactive shell prompt after executing the specified command unless the /P options is present, too.

Boolean options, which can only be enabled or disabled, may be prefixed by '+' to enable or '-' to disable it.


Environment Variables

Environment variables can be freely assigned using the SET command, e.g. executing:
CMD: SET var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas
assigns this nonsense to the variable var1. Later on, the value of the variable can be used by writing: %var1%, thus, writing the name of the variable enclosed without whitespace by two percent signs. Warning: Environment variables are expanded fully into plain text before the command line is furtherly parsed. If a variable contains an odd number of quotes, the remaining command line must contain the closing quote in order to operate properly. Also see this:
CMD: SET var=text del CMD: IF text==%var% GOTO label
The second line looks uninteresting, but once the environment variable has been expanded the line has morphed into:
CMD: IF text==text del GOTO label
not that funny anymore, because the IF command interpretes only the string text==text as condition, but del GOTO label is executed as command.

FreeCOM uses a number of environment variables for its own purpose.

  • COMSPEC: FreeCOM loads some information on demand, these data are stored in the FreeCOM executable. The value of this environment variable contains the filename FreeCOM shall use. The contents can be changed with the SET command.
  • DIRCMD: The user may define default values for the DIR command. Any options specified within DIRCMD are prefixing any entered ones, so to say FreeCOM behaves as if the user always types:
    CMD: DIR %DIRCMD% «other arguments»
    This variable must be changed using the SET command.
  • COPYCMD: This variable contains default options for the COPY command.
  • PROMPT: FreeCOM prompts the user to enter commands to run, the prompt can be customized by changing the contents of this variable.
    This variable can be changed using the SET or the PROMPT commands. Latter one includes a detailed description of the format of the prompt string.
  • PATH: When FreeCOM is to execute an external command and this one does not contain no path, FreeCOM searched for the command in a number of paths. These ones are enumerated by the PATH environment variable.
    This variable can be changed using the SET or the PATH commands. Latter one includes a detailed description of the format of the search path.

There are a number of automatic variables that do not follow the above mentioned syntax and which contents is automatically generated. Unlike the normal variables these automatic variables are constructed of exactly two characters, the first one is a single percent sign and the second one the variable identifier:

  • %?: expands to the current errorlevel, which is the exit code of the previously executed external command.
  • %0: in batch scripts only: is the name of the script currently executed.
  • %1 through %9: in batch scripts only: are the first through nineth argument passed to the currently executed batch script. If less than nine arguments had been passed to the script, they return an empty string. To access the tenth argument please refer to the SHIFT command.
  • FOR %v IN (...) DO «any command»: %v may use any letter, the FOR command creates a new variable, which is valid in the «any command» following the DO keyword.
  • %%: Is no real variable, but expands to a single percent sign.

Because automatic variables have one percent sign only, it sometimes lead to confusion within the FOR command, e.g. in:
CMD: SET adam=eva CMD: FOR %a in (*.*) DO echo %adam% %a
%adam is interpreted as [%a]dam.


Internal Commands

Internal commands will be processed by FreeCOM directly, they are available to the user without presence of any external files, in fact they hide External Commands named equally.

The synopsises of the internal commands are described in a style derived from EBNF.


User Prompt

FreeCOM knows two modes:
  1. Interactive, and
  2. batch processing.
The second one performs batch scripts, which are more or less a sequence of commands written to a file. Such files may contain any external commands, internal commands and calls to other batch files as well.

In interactive mode FreeCOM prompts the user to enter a command, the line is interpreted, parsed and, finally, either rejected because of an error or executed.

Command Line Syntax

FreeCOM accepts the following command line:
EBNF: [ ':' ] [ '?' ] [ '@' ] [ '*' ] { command [{ argument | redirection }] : '|' } EBNF: redirection ::= ( '<' | '>' | '>>' ) filename

The first optional ? must not be mixed up with the command ?!

Description:

The colon marks the line as label, which causes to let FreeCOM ignore the line completely as no interpretation is tried on this line, neiter are any redirections created.

The ? forces FreeCOM to enable the trace mode for this line. In trace mode FreeCOM prompts the user wether to execute the resulting command.

The optional @ disables the echo status for this line. If the echo status is enabled, the line is displayed right before it is executed; see ECHO for more details.

The asterisk * is available only, if aliases are compiled into FreeCOM; if present, the alias expansion is skipped.

If commands are chained with the | symbols, those commands are to be executed as a pipe. For instance the command line:
CMD: cmd1 | cmd2 | cmd3
forms a pipe consisting of the three individual commands cmd1, cmd2, and cmd3, where the standard output stream of cmd1 is connected to the standard input stream of cmd2 and the output of cmd2 to the input of cmd3. Note: Because DOS is no multitasking environment, pipes are simulated with file and the three-command pipe will look like this:
CMD: cmd1 >%TEMP%\cmd###1.tmp CMD: cmd2 <%TEMP%\cmd###1.tmp >%TEMP%\cmd###2.tmp CMD: cmd3 <%TEMP%\cmd###2.tmp
The files are temporary ones and will be removed as soon as they are no longer required, meaning the tempfile #1 is removed after cmd2 terminates and tempfile #2 upon termination of cmd3.

Redirections tie the standard input or output stream to a file or device, for instance:
CMD: cmd arg >outfile
redirects the standard input stream of cmd to the file infile and the standard output stream to outfile. The double output redirection specifies to append to an existing file rather than overwriting it.

Command Line Editing

FreeCOM offers two methods to interactively enter command lines:
  1. standard input, and
  2. enhanced input.
The first one just calls a DOS function, whereas the second one processes each key for its own. Which method FreeCOM uses is defined at compile time.

If the echo state is enabled, the user is prompted with the PROMPT string; otherwise no visible or audible prompt is issued to indicate an user activity request.

In either mode the ENTER key terminates the editing and lets FreeCOM start to interprete the entered line.

The standard input mode does neither support command line history, except the last command line in some circumstances, nor file completion. The following keys have a special meaning:
Key Meaning
F1 Get next character from last line, if available
F3 Get last line, if available
F5 Place current line in last-line buffer and restart editing on a blank line
F6 Insert the pseudo-character End-of-file
backspace delete character to the left
cursor left delete character to the left
cursor right Get next character from last line, if available

The enhanced input mode does support command line history and file completion. The following keys have a special meaning:
Key Meaning
F1 Get next character from last line, if available
F3 Get last line, if available
F5 Place current line in last-line buffer and restart editing on a blank line
backspace delete character to the left
cursor down Replace the current input line with the previous line from the history
cursor left move cursor one character one position to the left
cursor right Move cursor one position to the right; at the end of the line get next character from last line, if available
cursor up Replace the current input line with the next line from the history
delete Deletes the character on the cursor
end Moves the cursor to the end of the line
ESC Clear current line
home moves the cursor to the beginning of the line
insert Switch between insert and overwrite mode
TAB Take the current word for a file and try to complete it
^C Clear current line and enable echo state. The echo state is enabled to ensure the user gets to know he is on the command line of FreeCOM rather than stuck in a non-interruptable program.



Features of FreeCOM

FreeCOM implements the following features:
    SKAUS_EVALUATE_PERL: $_ = $features


Status of FreeCOM

FreeCOM's development currently targets the v1.0 version, which is to provide all functionality (features) of commonly known COMMAND.COMs at minimum, but probably at the cost of optimization and performance.

The To-Do list:
Feature Target
Swapping without any supporting secondary programs (KSSF.COM and VSPAWN.COM) v0.90
INT-2E backdoor v0.90
Wildcards for REN, same filename pattern matching code for REN, COPY and DIR v0.93
IF /I v0.85
Input/output functions to replace <stdio.h> by <io.h> (aka replace FILE*-based I/O by handle-based one) v0.95
Strict error recognition, probably _doserrno based v0.97
Support for DOS=HIGH v0.90
Code sharing of modules v0.91
Redirection in conjunction with Swapping v0.90
Optimize FreeCOM for size post v1.0
Other swap storage areas, e.g. XMS and EMS post v1.0
Long filenames post v1.0
internal commands mostly done
Aliases: ALIAS done
Command line history: HISTORY done
Directory stack: DIRS, PUSHD, and POPD done
MUX-AE interface done
Enhanced command line editing, file completion done
Last directory recognition: CD, CDD, PUSHD done
Control Break handler done
Critical Error handler done
IF ERRORLEVEL H<letter> done (v0.82pl1)
Full support for DOS NLS done (v0.82pl1)
DIR /O and DIR /A done (v0.82pl2)

Footnotes:


Appendix

Compile FreeCOM - sample

Due to heavy request, there is a sample description how to compile FreeCOM in ten steps.

Download

FreeCOM can be downloaded from SourceForge in several ways and packages:
  1. source code files from the CVS repository
  2. tarball and pre-compiled packages from anonymous FTP
  3. tarball and pre-compiled packages via HTTP
  4. tarball and one pre-compiled package as file release

Resources accessable via anonymous FTP

SourceForge closed the FTP - Services.

Resources accessable via HTTP

http://freedos.sourceforge.net/freecom/packages/ contains several variants of tarballs and pre-compiled packages of FreeCOM. The files immediately located in the directory contain the most current major release of FreeCOM, whereas the subdirectories include Beta releases of the upcoming release.

The packages themselves include:
file name contents
COM###.ZIP or Com###Beta##.ZIP tarball (the source code tree without CVS information)
BINARY.ZIP the most commonly used pre-compiled FreeCOM with almost any feature, but debugging enabled.
This release uses standard swapping mechanisms!
XMSSWAP.ZIP the most commonly used pre-compiled FreeCOM with almost any feature, but debugging enabled.
This release uses XMS-Only swapping mechanism!
PLAINEDT.ZIP As BINARY.ZIP but using the plain command line editor of the kernel instead of the enhanced one
DEBUG.ZIP As BINARY.ZIP with debugging support enabled.
This variant is a lot larger than the standard release and can generate lots of output.
LOCALIZE.ZIP As BINARY.ZIP but targetted at maintainers of a language description file (*.LNG).
SUPPL.ZIP the SUPPL library required for linking FreeCOM precompiled for use with Turbo C++ v1.01
DOCS.ZIP a package with these HTML documents

File Releases on SourceForge

On SourceForge so-called File Releases can be created. The file release section of the FreeCOM module contains a source ZIP and a binary ZIP file, they are equal to the tarball and the BINARY.ZIP on the anon FTP space respectively. Unlike the FTP space, old versions are kept, but no Beta versions or side branches.

CVS Resources

On SourceForge a short description of how to access the CVS repository is located. Following those instructions will download the main trunk of the specified module of the repository, e.g.:
cvs -z6 co freecom
downloads the MAIN trunk, also called HEAD, of FreeCOM.

Alternatively the WebCVS -- follow the Browse CVS link there and remember to select the MAIN branch -- might be helpful in order to download a handful of files.

However, CVS allows to branch the development of a module at some point from the main trunk into side trees. On these branches the module can be developed further, new features can be added etc., without disturbing the main trunk (and therefore the primary release) of the module. When the side development proved its worthiness, the changes are merged into the main trunk and, hence, becomes part of the primary release.

Branches are marked by tags, though, unlike normal tags branch tags automatically evolve with the file, what means that when a file from a specific branch is updated, the branch tag automatically move from the current version of the file to the new one.
To check out a branch, create a new directory, change within it and execute:

cvs -z6 co -r tag freecom
, where tag is the name of the branch you want to download. Note: It is not advisable to use the same directory to manage files for two different branches.

The FreeCOM module has the following active branches:

Tag Meaning
expExec Stack-based execution context implementation
expSpawn Module based FreeCOM, bases on expRes branch

The FreeCOM module has the following obsoleted branches:

Tag Meaning
expRes Resource management implementation.
Finally merged into trunk as of 2001/03/10

Bug Tracking / Bugzilla

FreeCOM uses FreeDOS's Bugzilla for tracking bugs and the like.

EBNF

Documents encode the synopsis of the commands with operators derived from EBNF (Extended Backus-Naur Formula).

Type setting

Depending on different meanings characters are set into various shapes:
Name Meaning Example
terminal characters to be enterred on command line or displayed by the computer; EBNF: "terminal symbols" ECHO
'string' The quotes remove the metafunction of the enclosed characters in order to specify EBNF operators as terminal symbols. EBNF: "terminal symbols" '|'
bold operators that constructs portions together; EBNF: "operators" |
italic placeholders for arguments, which are explained in the description; EBNF: "non-terminal symbols" varname

Operators

The EBNF uses the following operators:
Symbol Meaning
| alternative; use either left or right token
() parenthizes enclose tokens limiting the range of |
[] brackets enclose optional tokens, thus, they may appear zero or one time; they also limit the range of |
{} curly brackets enclose repitive tokens, which may appear one or more times; they also limit the range of |
{ : } as the normal curly brackets, but any repitive tokens are delimited by the token(s) right of the colon; for instance:
{ file : '+' }
is the same as:
file [{ '+' file }]
and applies to:
  • file
  • file + file
  • file + file + file
  • file + file + file + file
  • ...
« » is a placeholder for an arbitary string of terminal symbols, which further syntax is described by the enclosed text in English natural language.
::= assigns a meaning (right side) to a non-terminal symbol (left side); for instance
	DIR [ { option | filespec } ]
	option ::= / ( A | B | C )
Any occurance -- only one here -- of option on the right side of an ::= or where no ::= is present at all is to be replaced by the right side of option::=.

Unless modified by above mentioned operators a sequence of tokens specifies that each token must be present exactly one time in exactly that order.
Note: For the sake of clearness, spaces are inserted between tokens. These spaces do not mean that a space is allowed at this place! Also, the fact that no _ is present does not mean that at this place is none allowed. It is assumed that the reader will find the places where optional spaces are valid either by "doing" or by reading the examples.





Copyright 2000-2001 © Steffen Kaiser - current maintainer of FreeCOM

Elvis - The VI clone ================================================ FILE: docs/html/commands/appendix.html ================================================ Appendix to the Description of Features and Implementation Status of FreeCOM

Appendix to the Description of Features and Implementation Status of FreeCOM

Current Directory

The current directory is the default directory of a drive.

DOS stores a default directory for each drive. When a path is specified with a drive specification only, such as D:, it is completed with this default directory of that drive to construct the absolute path to be used.


Current Working Direcory

In opposite to the current directory the current working directory is the absolute path constructed out of the currently selected drive and current directory of that drive.

Path Specification

In DOS an absolute path is constructed out of several components:
  1. drive,
  2. directory,
  3. filename, and
  4. file extension.
like this: D:\DIR1\DIR2\FILENAME.EXT.

The drive is a single letter from A through Z followed by a colon :.

The remaining part of a path consists of similiar components delimited by a single backslash \. The last component is also called filename. Each of these components may be formed of a name, up to eight characters long, and an extension, up to three characters long. Both parts are delimited by a single dot .. Although the extension may be absent, the filename must have at least one character.
Note: The term filename is not limited to files in the usual sense, but may apply to any name visible in a directory, such as subdirectories and volume labels, as well.

To ease the way to enter a path the user may specify a relative path, rather than an absolute one. In such path one or more components may be missing:

  • If no drive is specified, what means that no colon is specified, the path is prefixed by the currently selected drive.
  • If the directory is not prefixed by the backslash or no directory is specified at all, the current directory of the drive is inserted right behind the colon.
  • Some programs may append an absent extension to the very last filename component.

Examples, assume the current directories of
Drive Current Directory
C: \FREEDOS\HELP
D: \TEMP\TEXT
The currently selected drive is C:.

  1. C:\
    The root directory of drive C:.
  2. .
    The current working directory, ergo: C:\FREEDOS\HELP.
  3. ..
    The parent directory, ergo: C:\FREEDOS.
  4. D:
    The current directory of drive D:, ergo: D:\TEMP.
  5. D:.
    The current directory of drive D:, ergo: D:\TEMP.
  6. D:..
    The parent directory of drive D:, ergo: D:\.
  7. ..\BIN
    Because there is neither a drive nor a leading backslash, both the currently selected drive and the current directory of that drive is inserted before the given path, ergo: C:\FREEDOS\HELP\..\BIN.
    The embedded component .. has the same meaning as when specified alone: parent directory, though, here in the context of the directory C:\FREEDOS\HELP\. That means that the final absolute path is: C:\FREEDOS\BIN.

Path specifications that do not conform to above mentioned format lead to various different behaviour of the various programs, because there is no standard to scan, parse and interprete such patterns. Problems include:

  • multiple backslashes,
  • multiple dots,
  • multiple colons, or a colon at a position unequal to two,
  • The current directory . or parent directory .. special directories in the context of a root directory, such as C:\., C:\.., or C:\TEMP\..\...

Note: The special directories . and .. are no phantom directories or virtual entries, but standard entries of every directory except the root directories. These entries help crash recovery tools, such as CHKDSK or SCANDISK, to find errors within the directory structure and restore it to a valid file tree. Therefore a common assumption that a tripple dot ... directory means parent-of-parent is incorrect, though, might be supported by certain programs.


Standard Rules for Options

Options are prefixed by one forward slash "/", the following character identifies the option and is called option character, for instance: /A

Some commands do accept long option names, where a complete word identifies the option rather than a single character, e.g. /MSG.

Some option may be used in conjunction with an argument. The argument is appended to the option with one colon ":" or one equal sign "=", for instance: /A:hr or /P=fdexec.bat.

Multiple options without argument maybe merged together as a single option with embedded slashes, e.g. /W/S, instead of /W /S.
An option with argument may be the last one of such merged options.

Options without arguments enable or disable certain features. Therefore, those options are sometimes called boolean options or flags.
Boolean options may be prefixed by a minus "-" sign, in order to disable or turn off the option; otherwise, the option is enabled.
Without user invention a boolean option is disabled by default. However, some commands allow the user to change the default settings of certain options, e.g. COPY and DIR.


I/O Redirection

In DOS the standard input and output can be redirected to a file or another device; however, although it is common to use these I/O streams today, some programmers cowardly ignore them for reasons of speed or program size.

If the input stream is redirected to a file or device, instead of polling the keyboard and request the user to interactively enter characters via the keyboard, those characters are read from the file or device. Usually these programs terminate when the file has been read wholely.

If the output stream is redirected to a file or device, instead of issuing the information onto screen, it is dumped into the file or device. Per convention each program has two output streams: one (called standard output) to issue normal information and one (called standard error output) for error messages the user should not miss.

Redirections are specified on command line and effect exactly that command invoked herein, regardless if the command is an external or internal one, an alias or batch script. The utter exception is the FOR command, which requires that the redirection is to apply to the command specified behind the DO keyword rather than FOR itself.
If more than one redirection is specified on the command line and they effect the same stream (input, output, or error), the rightmost one superceed any previous one.

Redirections are syntactically specified like this:
EBNF: operator target EBNF: operator ::= '<' | '>' [ '>' ] EBNF: target ::= file | device
Although it is not relevant where the redirections are placed on the command line, it is common praxis to place them at the end of it.

The operators have the following meaning:
Operator Redirection
< Input stream
> Output stream; target file is overwritten
>> Output stream; output is appended to target, if it already exists
EXAMPLES: EXAMPLE: 1 CMD: cmd Input stream is redirected to file IN2, because it is the rightmost one. EXAMPLE: 2 CMD: cmd out
Input stream is redirected to file IN, the output streams is redireced into file OUT. If the file OUT already exists, the old contents is discarded and replaced by the new one; otherwise, the OUT is created anew. EXAMPLE: 3 CMD: cmd >out
As example 2, but instead of replacing the contents of OUT, if the file already exists, the new information is appended to the end of the file. EXAMPLE: 4 CMD: FOR %a IN (*.*) DO ECHO %a >out
As mentioned earlier, FOR is an exception and passes forth the redirections to each invocation of the command specified right of the DO keyword. So this examples overwrites the output file each time the ECHO command is performed, thus, instead of creating a file list, only the last found file is recorded into OUT. EXAMPLE: 5 CMD: IF EXIST out DEL out CMD: FOR %a IN (*.*) DO ECHO %a >>out
This sequence eliminate the problem, the IF command is required to actually replace the file rather than appending the file list to the probably existent file.

Pipes

Another form of redirection is piping. Hereby, the output stream of one command is connected to the input stream of another command. Pipes can combine any number of commands this way. Because DOS is no multitasking system, pipes are simulated by spawning the first command with an output redirection capturing the issued information into a temporary file and then the second command with an input redirection from that very same temporary file, on completation of the second command the temporary file is deleted. EXAMPLES: EXAMPLE: 1 CMD: cmd1 | cmd2 | cmd3
Which is similiar to this sequence:
CMD: cmd1 >%TEMP%\t1 CMD: cmd2 <%TEMP%\t1 >%TEMP%\t2 CMD: DEL %TEMP%\t1 CMD: cmd3 <%TEMP%\t2 CMD: DEL %TEMP%\t2 EXAMPLE: 2 The first and last command can have an input or output redirection respectively, like so:
CMD: cmd1 | cmd2 | cmd3 out
Which is similiar to this sequence:
CMD: cmd1 >%TEMP%\t1 %TEMP%\t2 CMD: DEL %TEMP%\t1 CMD: cmd3 <%TEMP%\t2 >out CMD: DEL %TEMP%\t2 EXAMPLE: 3 The error stream can be piped as well:
CMD: cmd1 |& cmd2 | cmd3
Which is similiar to this sequence:
CMD: cmd1 >&%TEMP%\t1 CMD: cmd2 <%TEMP%\t1 >%TEMP%\t2 CMD: DEL %TEMP%\t1 CMD: cmd3 <%TEMP%\t2 CMD: DEL %TEMP%\t2
Here only the error messages of cmd1 are passed into cmd2; the error messages of both cmd2 and cmd3 are issued to the screen.

Nested redirections

Batch scripts or when external programs invoke other programs or another shell, redirections may be nested, e.g.:

Consider the batch file BATCH.BAT:

@ECHO OFF
ECHO 1
ECHO 2 >out_2
ECHO 3
which is invoked via:
CMD: BATCH >out_1
When the script BATCH gets executed, the actual output stream is redirected to the file OUT_1. Therefore the output of the first ECHO command is redirected into this file.
Because the second ECHO command has its own output redirection, its output is redirected into the file OUT_2. On completion of ECHO the redirection is closed and the former one is restored.
What causes that the output of the third ECHO command is redirected into OUT_1 again.

Wildcards

DOS accepts certain placeholders instead of files, so you can specify one or more files with the same wildcard pattern. In opposite to other systems each program expands wildcards individually instead of let the shell do this; however, the shell must epxand wildcards for its internal commands.

FreeCOM supports the standard DOS wildcards as supported by the DOS kernel itself:
Wildcard Meaning
* Any remaining body, except a dot (.)
? Any character, except the dos (.); acts as *, if the last character

Wildcards are allowed in the last portion of a qualified path, that means behind the last backslash (\) or colon (:).
Wildcards match either before or behind the dot delimiting the filename and its extension.
Whether or not directories or volume lables or hidden and system files do match a pattern depends on the command expanding it.
Letters match case-insensitively.

Examples:
Pattern Meaning
*.* Any file in the current directory
c:*.* Any file in the current working directory of drive C:
* Any file without an extension. Some commands, such as DIR, interprete a single * as *.*
a*.* Any file, which first character is an A, neither the remainder of the filename nor the extension of the file matters
a?.* same as above
a???.* same as above
a*b.* same as above
a?b.* Any file, which first character is an A and the third one is a B; the remaining characters nor the extension matter
file?.txt All files, which first four characters are FILE and which extension is equal to TXT
\scripts\*.pl Any perl file in the directory \SCRIPTS located in the root directory of the currently selected drive

Warning: There are common mistakes about wildcards, as DOS has less functional wildcards than other systems, in particular:

  • a*bc.*txt: Any character right of an asterisk * up to the dot . or the end of the filename is ignored; this pattern is equal to: a*.*.
  • a?.?: A question mark ? as the last character of either the filename or file extension has the same effect as an asterisk * and does not mean exactly one any character, in particular no character must be present; this pattern is equal to a*.*.

Batch Scripts

The shell lets to automate simple tasks by writing batch scripts. These are plain text files with one command is written at one line. Any command, both internal and external ones, can be used in batch scripts, along with redirections, pipes, environment variable substitions a.s.o. The script is performed line-by-line.

By default, before executing a line, it is displayed onto the screen, in order to prevent this, one can turn off this feature with the ECHO command or prefix each line with the Ad sign (@), e.g.:
CMD: ECHO This line is displayed CMD: @ECHO This line is NOT displayed
Commonly batch scripts start with the line:
CMD: @ECHO OFF
in order to turn off to echo each line furtherly in the script processing and to suppress to echo the line itself, too.

Lines starting with a colon (:) label this particular script line, in order to be jumped to with the GOTO command, e.g.:
CMD: @ECHO OFF CMD: IF "%1"=="" GOTO useage CMD: ECHO argument1=%1 CMD: ECHO argument2=%2 CMD: ECHO argument3=%3 CMD: GOTO ende CMD: :useage CMD: ECHO Useage: %0 {arguments}... CMD: :ende

  • If the script is invoked with no argument, line 2 performs the GOTO command and, thus, skips the lines 3 through 7 and proceeds with line 8.
  • Otherwise the three ECHO commands are invoked and the GOTO command of line 6 skips the ECHO'ing of the error message in line 8 and proceeds in line 9.
If the shell hits a line starting with a colon, it is silently skipped; not even redirections are evaluated in opposite to the REM command.

When the shell reaches the end of the file, the batch processing terminates. The errorlevel of the last spawned external command remains unchanged. Because the shell closes the batch script and re-opens it each time a command, for both internal and external ones, is invoked, one can savely replace floppy disks during a batch processing, e.g.:
CMD: @ECHO OFF CMD: ECHO Copying disk1 CMD: COPY files\*.* C:%1 CMD: :disk2 CMD: PAUSE Insert disk #2, then hit ENTER CMD: IF NOT EXIST disk2 GOTO disk2 CMD: ECHO Copying disk2 CMD: COPY files\*.* C:%1 CMD: :disk3 CMD: PAUSE Insert disk #3, then hit ENTER CMD: IF NOT EXIST disk2 GOTO disk3 CMD: ECHO Copying disk3 CMD: COPY files\*.* C:%1 CMD: ECHO Copying done.

When a batch file is invoked within another batch file, the previous ones does not proceed once the called one terminates, regardless of the nesting level; this is called chaining, one chains to another program and does not intend to come back. To have a batch script behave like an external program in this regard, it must be invoke via the CALL command, e.g.:
CMD: @ECHO OFF CMD: ECHO %0 - line 2 CMD: CALL batch2 CMD: ECHO %0 - line 4
and BATCH2.BAT:
CMD: ECHO %0 - line 1
================================================ FILE: docs/html/commands/cmd.html ================================================ Internal Commands of FreeCOM List of commands and features of FreeCOM:





ALIAS - Display or change an alias

Requirements: FEATURE_ALIASES

Synopsis

  1. ALIAS
  2. ALIAS name '=' [ «string» ]

The first format without any argument displays all defined aliases.

The second format assigns the specified string to the alias with the specified name. If the string is empty, the named alias is removed.

Once an aliase is defined, a command line of the form: name { argument }
is replaced by: <<string>> { argument }
This mechanism is called alias expansion, because the alias name expands to the specified «string». To prevent alias expansion the command must be prefixed by one asterisk, e.g.: *name arguments

Examples

Example: 1

ALIAS dir=dir /w
C> dir
displays short directory listing from now on.

Example: 2

ALIAS
displays all currently defined aliases, e.g.:
DIR=dir /w
in this case.

Example: 3

ALIAS dir=
removes the previously defined alias dir, thus, DIR displays the long output as by default again.


FEATURE_ALIASES - Command aliases

See also: ALIAS

If defined on compilation of FreeCOM, command aliases are supported.

New aliases are defined using the command:
ALIAS name '=' «string»

Aliases are removed using the command:
ALIAS name '='

When FreeCOM is interpreting a command line, the command -- the very first word -- is matched against all defined aliases. This word is separated from its arguments by whitespaces and cannot contain any path delimiters, such as backslashes or colons.
If the command matches an alias, the name is substituted by the «string»associated to the aliases, e.g. by defining the alias ls by:
ALIAS ls=dir /w/o

let FreeCOM interprete the command line:
C> ls /a

exactly as if one had typed in:
C> dir /w/o /a

To prevent the alias expansion an asterisk is prefixed before the command, e.g.:
C> *ls /a

really tries to execute the command:
ls /a

which usually is an external command.

Aliases may be used to hide or re-place internal commands, e.g.:
ALIAS dir=xdir

effectively hides the internal command DIR and will always execute the -- usually -- external command XDIR.

Aliases may be nested, so if both alias definitions mentioned above are in place, the command:
C> ls /a

is really executed as:
xdir /w/o /a

where the ls command is substituted by the command dir /w/o, then dir is detected as alias, too, and hence replaced by xdir.
The same alias is never substituted twice, neither directly nor transitively, so:
ALIAS dir=dir /w

is allowed as well as:
ALIAS ls=dir /w/o
ALIAS dir=ls -l

command results in
ls ls -l /w/o
dir dir /w/o -l

As implied above, aliases are expanded when needed and not when they are defined.

Aliases are storred for each instance of FreeCOM individually and are inherited by secondary instances from the parent.

Options

Compile-time options:
  • ALIAS_DEFAULT_SIZE: The size reserved for all aliases per FreeCOM instance. Default: 1024


BEEP - Issue a Beep

Requirements: CMD_BEEP

Synopsis

BEEP

Issues a beep.
At this time FreeCOM supports audible beeps only.


BREAK - Display or Set Extended Break Checking

Requirements: CMD_BREAK

Synopsis

BREAK [ ON | OFF ]

Displays or sets the Extended Break status.

By pressing ^Break or ^C (Control-Break or Control-C) an user may signal the currently running program to halt. Most programs will abort to the prompt, but some may decide to just cancel the current action, but remain active.

DOS checks for ^Break/^C (Control-Break or Crontrol-C) each time a program issues a console input/output request. When Extended Break checking is enabled (ON), DOS checks for ^Break each time a program issues a request.


CALL - Call a Nested Batchfile or Program

See also: LOADFIX, LOADHIGH
Optional requirements: FEATURE_KERNEL_SWAP_SHELL

Synopsis

  1. CALL [/Y] program [ «arguments» ]
  2. CALL [/Y] [ /S | /N ] program [ «arguments» ]

Calls a program or batch script.

If the program is a batch script, that means it has the extension .BAT, CALL nests the batch script within the already running one. Without CALL the invoked batch script would terminate all already running batch scripts.

If present, the arguments are passed unchanged to the invoked program.

Options

Unless stated otherwise all options of this command do follow the standard rules for options.
  • /S: If program is not a batch script, the external program is executed by swapping FreeCOM out of memory. This process will require more time, especially if FreeCOM is to be reloaded from a floppy, some internal settings are lost, e.g. command line history, but it will free as much memory as possible for the external program.

    This option and, thereby, this function is available only, if FreeCOM had been compiled with some support for swapping.

  • /N: If program is not a batch script, the external program is executed directly, with swapping disabled. /N superceeds /S.
  • /Y: Enables tracemode during execution of the command.

Note: In the future to swap FreeCOM out of memory during the execution of an external program will be the default behaviour.


CANCEL - Terminate all scripts

Synopsis

CANCEL [ n ]
Terminates all currently active batch scripts and, if present, assigns the specified number n to the errorlevel.

Note: This command is a hidden internal command.


CD - Change current directory of a drive

See also: CDD, CHDIR, DIR, DIRS, MD, PUSHD, RD
Requirements: CMD_CHDIR
Optional requirements: FEATURE_LAST_DIR

Synopsis

  1. CD
  2. CD [ drive ':' ] path
  3. CD '-'
CD is 100% compatible with the CHDIR command; there is no difference -- beside the spelling -- between them.

The first variant shows the current working directory as absolute path.

The second variant changes the current directory of the given drive. If no drive is specified on command line, the current directory of the currently selected drive (disk) is changed. This command does not change the currently selected drive in opposite to CDD!

The third variant changes back into the last visited directory and drive. The commands CD, CHDIR, CDD, and PUSHD save the current working directory before performing the specified directory change; the command CD '-' restores this saved directory. This command is available only, if the feature LAST_DIR has been enabled during the compilation of FreeCOM.

Options

There are no options for this command.

Examples

Example: 1

CD \freedos\help
Changes the current working directory of the currently selected drive to the path \FREEDOS\HELP.

Example: 2

CD c:\freedos\help
Changes the current directory of drive C:.

Example: 3

Assuming the current working directory is \FREEDOS\HELP and the currently selected drive is C:. CD
Displays C:\FREEDOS\HELP

Example: 3

The command sequence, provided the first two worked successfully:
CD \FREEDOS\HELP
CD ..
CD -
changes first into the directory \FREEDOS\HELP, then into its parent directory, which is \FREECOM. And finally CD - changes back to \FREEDOS\HELP, because this was the previous directory before previous CD-like command.

Because CD - saves the previous directory, too, any subsequent: CD -
will switch between these two directories; until another directory is changed to.


CDD - Changes the current working directory

See also: CD, DIR, MD, PUSHD, RD
Requirements: CMD_CDD

Synopsis

  1. CDD
  2. CDD [ drive ':' ] path
  3. CDD '-'
The behaviour of CDD is similiar to the CD command, but it always changes both the currently selected drive and the current directory, thus, it changes the current working directory.

For further details please see the CD command.


CHDIR - Change current directory of a drive

This command is 100% compatible to CD, please see there


CLS - Clear screen

See also: ECHO, TYPE
Requirements: CMD_CLS

Synopsis

CLS
Clears the screen and resets the character colours to white on black.


COPY - Copy one or more files to another location

See also: DEL, REN
Requirements: CMD_COPY

Synopsis

  1. COPY [{ option }] source [{ option }] target [{ option }]
Copies the source file into the target file. See also: \REF{wildcards}

Before parsing its command line COPY parses any option specified by the environment variable COPYCMD.

Options

Unless stated otherwise all options of this command do follow the standard rules for options.
  • /A see below
  • /B: Specifies the mode, in which the file is copied, /A forces ASCII and /B forces binary mode.

    These options do alter the mode of the file immediately preceeding them and all following ones, until changed again.

    In binary mode the file is copied and nothing is changed at all.

    In ASCII mode COPY takes special care about linefeeds / newline characters and the end-of-line character.

    • On read, the newline characters, which are a sequence of two different bytes in DOS, are transformed into a single character, as known from Unix-style systems. On write, this single character is transformed into the two-byte sequence.
      So, if both files are copied with different modes, newline characters are transformed into either way.
    • If the end-of-file character is found on read, the remaining contents of the file is ignored. On write, such character is appended after the last character has been written.
    By default, files are copied in binary mode, whereas devices, e.g. CON:, are copied in ASCII mode, but no end-of-file is appended.

Arguments

  • source: The source file.
    If more than one source file is specified, the target must be a directory.
  • target: The target of the COPY process.
    If target is a directory, the destination file is placed into this directory, but with the same filename as the source file.
    If exactly one source is specified, but no target, target defaults to just ., which represant the current directory.


CTTY - Change TTY (console)

Requirements: CMD_CTTY

Synopsis

CTTY device
With this command the console device can be changed. A console device performs all basic input and output operations. This change is more complete than IO-redirections, because latter one might not catch all output, for instance the error messages. See example 3 below.
Because the console is a bidirectional virtual device, meaning it is to perform input and output, the specified device must not a unidirectional device, such as PRN.

To specify a second argument on the command line of FreeCOM has the same effect.

Attention: This command is to effect the whole system, not only FreeCOM itself; so the effect of CTTY does not only depend on the implementation status of FreeCOM, but on the DOS kernel, too.

Also, some programs access the screen or keyboard directly, rather than using the DOS functions; these programs are not effected by CTTY.

Examples

Example: 1

CTTY aux
Changes the console to the AUX: device, which is usually the first serial communication port COM1:. If this line is connected to a terminal or a terminal emulator, the system can be controlled from the terminal by now.

Example: 2

CTTY nul
any command sequence
CTTY con
The first command discards any output. If a program attempts any input operation, it gets none. Some programs may not handle such situation correctly.
So, any output, even error messages, are discarded during the command sequence.
The second command changes the console back to the screen/keyboard pair.
To display a string onto screen or read from keybord the usual I/O-redirections may be used, for instance:
  • ECHO This line appears on the screen >CON
  • PAUSE >CON
    This PAUSE command will get its input even within the "CTTY nul" environment.


DATE - Display or set current date

See also: TIME
Requirements: CMD_DATE

Synopsis

  1. DATE [ /D ]
  2. DATE [ /D ] date
The first variant displays the current system date, then enters a loop prompting the user for a new date. The loop terminates, if the user entered a valid new date or just pressed the ENTER key.

The second variant does not display the current date and tries to change the date to the specified date. On success the command terminates, otherwise enters the loop explained above.

The individual portions of a date may be separated by at least: dots ., forward slashes / or dashes -. Other nationally used characters may be supported, too.
DATE will support partial formats:

  • A single numnber: specifies the day only.
  • Two numbers: specifies the day and the month in the order used by the national date format, which is MM/DD for American and Japanese and DD/MM for European format.
  • Three numbers: specifies a full date including day, month and year in the order suitable for the national date format, which is:
    • MM/DD/[CC]YY: for American,
    • DD/MM/[CC]YY: for European and
    • [CC]YY/MM/DD: for Japanese format.
    If the year portion is less than 100, the century is assumed to be 1900, if it is greater or equal than 80; otherwise the century is 2000.

    Note: Some European countries introduced the so-called business date in 1996 or so, which is the same as the Japanese format; it makes sorting of literal dates a lot easier. If FreeCOM will or will not support it, will depend on the NLS used by DOS.


Symbolical names of monthes are not support (yet).

Options

All options must precced any argument.

/D prevents from prompting the user.

  1. In variant 1, the date is displayed only.
  2. In variant 2, the date is tried to be changed, but the loop is not entered on failure.

Examples

Example: 1

DATE /D
Just display the current system date.

Example: 3

DATE 2/1/00
Sets the current date to 1st February of 2000.


DEL - Delete files

See also: DIR
Requirements: CMD_DELETE

Synopsis

DEL [{ options | pattern }]
Deletes files, if pattern matches a directory, all files within this directory are deleted.

When all files are to be deleted, a warning prompt is issued.

Options

Unless stated otherwise all options of this command do follow the standard rules for options.
  • /P: Prompts the user before delete a file.
  • /V: Displays, which files are deleted.

Examples

Example: 1

DEL FILE1.EXT FILE2.EXT
Deletes the files FILE1.EXT and FILE2.EXT.

Example: 2

DEL /P *.bak
Deletes all files with extension BAK, but prompts the user for each single file before deleting it.

Example: 3

DEL.
Deletes all files within the current directory.


DIR - Displays the contents of the directory

See also: CHDIR, MKDIR, RMDIR
Requirements: CMD_DIR

Synopsis

DIR [{ options | pattern }]

DIR displays the contents of direcories and/or the attributes of files, whatever the pattern specifies. If no pattern is specified on command line, the current working directory is displayed. The actual information displayed depends on the specified options and is explained below.

A pattern may contain wildcards, which are expanded against both files and directories. To specify a directory is essentially equal to write: directory\*.*.

Unlike options patterns are performed in sequence, that means that if two patterns are specified, first all entries matching the first one, then all entries matching the second one are displayed; instead of to display the matching entries intermixed.

Before parsing its command line DIR parses any option specified by the environment variable DIRCMD.

Options

Unless stated otherwise all options of this command do follow the standard rules for options.
  • /A: (All) Wildcards are matched against System and Hidden files, too.
  • /A**: (Attribute) Wildcards are matched against files with selected attributes set or clear. The argument of the /A option is a sequence of:
    • ? meaning: attribute ? must be set, or
    • -? meaning: attribute ? must not be set.

    The following attributes, the ? above, are supported:

    • R for: read-only,
    • H for: hidden,
    • S for: system,
    • D for: directory, and
    • A for: archive.

    If the same attribute is specified twice within the same /A option, the last one superceeds previous ones; if more than one /A option is specified, the last one superceeds all previous ones.

  • /B: (Bare) Displays the lines with the information of files and directories only. The ones displaying the volume label, the serial number, totals etc. are suppressed. In combination with /S the absolute path of the files is displayed.
  • /L: (Lower-case) Filenames are displayed in lower-case letters rather than capitol ones.
  • /O: (Order default) is a synonym of /ONG.
  • /O**: (Order) Sort the entries displayed in a specific order. The following sort orders are supported:
    • D sort by last modification date (earliest first)
    • E sort by file extension
    • G group directories first
    • N sort by file name
    • S sort by size (smallest first)
    • U do not sort (unsorted)

    Each sort order, except U, may be prefixed by a hyphen to reverse the sort order. U effectively cancels any previous setting or specified sort order, e.g. to override an /O option from the DIRCMD environment variable.

    If the same sort order is specified twice within the same /O option, the last one superceeds previous ones; if more than one /O option is specified, the last one superceeds all previous ones.

    Warning: The entries are cached within memory before displaying them; if FreeCOM runs short on memory, to sort is disabled completely or the entries are sorted in chunks only.

  • /P: (Page) Page the output -- pause the display after issuing one screen-full.
  • /S: (Subdirectories) Recursively display directories.
  • /W: (Wide) Displays five filenames per line and suppress the information about the file size, date etc.
  • /Y: (Year) Displays a 4-digit year, rather than just two digits.
  • /4: (4digit Year) is a synonym of /Y.

Examples

Example: 1

DIR
Displays the contents of the current directory, but ignore System and Hidden files. The output may look like this:
!!todo!!

Example: 2

DIR a* bb* *.txt
First displays all files, that begin with the letter A; then all files, that begin with two letters B, are displayed and at last all files with the extension TXT.

Example: 3

DIR /w a* b*
DIR a* /w b*
DIR a* b* /w
Because the position of options is not significant, all these examples behave the same way and display the matching files in wide or also called short form, which may look like this:
!!todo!!


DIRS - Display the directory stack

See also: CD, CHDIR, POPD, PUSHD
Requirements: CMD_DIRS

Synopsis

DIRS
Displays all directories stacked with the PUSHD command.


ECHO - Displays a string onto screen

See also: TYPE
Requirements: CMD_ECHO

Synopsis

  1. ECHO [ ON | OFF ]
  2. ECHO «string»
  3. ECHO.
When executing a batch script each line is displayed to the console before executing it by default. The first variant of ECHO enables or disables this behaviour. To disable echoing the commands is equal to prefix each line of a batch script with the Ad-symbol @.
If ECHO is invoked with no argument at all, the current echo status is displayed.
When entered on an interactive command line the echo status controls whether or not the PROMPT string is displayed.

The second variant displays the specified «string».
Note: Because of variant 1 «string» may not expand to the single words ON or OFF without another character.

The third variant displays an empty line. No space must be placed between the dot and ECHO.

Examples

Example: 1

ECHO
Displays the current echo status, e.g. responding:
ECHO is on

Example: 2

@ECHO OFF
Disables the echo status. Because the Ad-sign @ disables the echo status right for this line, this command disable echoing all the next lines of a batch script and is not echoed to the console itself. It is, therefore, best placed in the first line of a batch script.

Example: 3

ECHO Just a text
Displays Just a text


FEATURE_ENHANCED_INPUT - Enhanced command line editing

See also: FEATURE_FILENAME_COMPLETION, FEATURE_HISTORY

If enabled on compilation of FreeCOM, enhanced command line editing features are activated. Otherwise, FreeCOM uses the default buffered input DOS API function #0A.

If this feature is disabled, neither command line history nor filename completion is available.

Besides the other features various key bindings recognized, which are listed in the general FreeCOM documentation.


ERASE - Delete files

This command is 100% compatible to DEL, please see there


EXIT - Terminate shell

Synopsis

EXIT
Terminates the currently running shell, unless FreeCOM had been started with the /P option. In this case, EXIT works like CANCEL.


FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor

If defined on compilation of FreeCOM and if FreeCOM is to terminate although it is forbidden -- e.g. by passing the /P option when executing FreeCOM --, the console is changed to the keyboard/monitor pair automatically after some insuccessful prompts to reboot the system.

Options

Compile-time options:


FEATURE_BATCH - Batch script processing

Requirements: IMPLICIT

The batch script processing is always enabled.

Options

Compile-time options:
  • BATCH_NESTLEVEL_MIN: Minimal supported batch nesting level. Default: 5


ENVIRONMENT_KEEP_FREE - keep free space in environment segment

If defined on compilation of FreeCOM, FreeCOM tries to keep the unused space in the environment segment equal to or greater than ENVIRONMENT_KEEP_FREE. The default value is 256.


FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present

If defined on compilation of FreeCOM, FreeCOM waits three seconds on startup, if the /P switch is present. If during this time a key has been pressed, F5 will bypass AUTOEXEC.BAT execution and F8 will enable trace mode.
F5 is equal to to pass the /D switch to FreeCOM.
F8 is equal to to pass the /Y switch to FreeCOM.


FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)

If defined on compilation of FreeCOM, calls to the Installable Commands API are made before executing any command. The API is situated at MUX-AE, the Multiplexer interrupt 0x2F function 0xAE.

The interface is documented elsewhere, for instance RBIL (Ralph Brown's interrupt list).


FEATURE_NLS - use DOS NLS

If defined on compilation of FreeCOM, FreeCOM uses the information retrievable by the currently active DOS NLS using the API functions #65.

These information influence:

  • the format displaying time and date information,
  • the characters to delimit items in lists,
  • the currency string and display format,
  • how to up- (and supported by some NLS only) to lower-case characters,
  • how to sort characters.


FEATURE_CALL_LOGGING - Startup logging

If defined on compilation of FreeCOM, all startups of a FreeCOM instance is logged into a file.

The drive the logfile is created on can be changed at run-time with the external tool PTCHLDRV.

Options

Compile-time options:
  • LOG_FILE: The name of the logfile. Default: C:\FreeCom.log


FEATURE_FILENAME_COMPLETION - Filename completion

Requirements: FEATURE_ENHANCED_INPUT

If defined on compilation of FreeCOM and if the enhanced command line editing is activated as well, the tabulatur key binding becomes available.

When the tabulator key is pressed, the word the cursor is located on actually or is immediately preceeding is separated and tried to match against files, like a DIR command would do, e.g. when hitting tab at the command line:
bar\f_ some arguments

-- where the underscore _ is to mark the location of the cursor and is no actual character -- causes FreeCOM to try to locate any files or directories matching the filename pattern bar\f*.*.
If none is found, a beep is issued to indicate that error and the command line remains unchanged.
Otherwise as many characters are appended to the filename as are the same for all found matches, e.g.:

  1. if exactly one match was found, its name is appened.
  2. if, for example, the files or directories: FOO, FUU.TXT or FUU are present in the directory BAR, no character is appened, because there are no equal characters following the already present f character.
  3. if, for example, the files or directories: FOO, FOO.TXT or FOO1.TXT are present in the directory BAR, the two characters OO are appened, because all found matches share these two characters immediately following the already present characers. Hence, the command line is expanded to:
    bar\FOO_ some arguments

    Please note that the case of all characters will match the case of the retrieved filenames.
In addition, because in the cases 2 and 3 the file completion was not complete because more than one match was found, a beep is issued. In this situation to hit the tabulator key a second time, without an intervueing other key press, causes to display all available matches, but keeps the command line unchanged otherwise.
If exactly one filename match was found, hence the file completion was complete, and if the found match is a directory, a backslash is appended to. This allows to walk into deep levels of directories speededly.

If the cursor had been placed, for instance, under the backslash in above mentioned command line, the full string bar\f had been tried to be completed as well. This behaviour differs from other implementations.

Options

Compile-time options:
  • FILE_SEARCH_MODE: Filemode passed to the DOS API to aquire matching directory entries. Default: Read-Only, Archive, Directory


FEATURE_DIRSTACK - Directory stack

See also: DIRS, POPD, PUSHD

This feature is automatically enabled, if PUSHD is enabled.

The directory stack pushes and pops directories on demand via the commands PUSHD and POPD. DIRS displays all pushed directories.

Please see the documentation of the mentioned commands.

Options

Compile-time options:
  • DIRSTACK_DEFAULT_SIZE: The amount of bytes reserved to store items of the directory stack. Default: 256


FEATURE_HISTORY - Command line history

See also: HISTORY
Requirements: FEATURE_ENHANCED_INPUT

If enabled on compilation of FreeCOM and the enhanced command line editing is acivated as well, the command line history becomes available.

When commands are enterred manually on the command line prompt of FreeCOM, old command lines are storred in the history and can be retrieved later using the key bindings of F3, F1 and the cursor Up and Down keys.
Without the command line history at most one line is cached.

The command:
HISTORY

displays all cached command lines.

The command:
HISTORY number

resizes the amount of bytes reserved to cache command lines to number bytes. Doing so all cached command lines are deleted.

Each instance of FreeCOM maintains its own command line history, which is initially inherited from the particular parent instance, if any.

Options

Compile-time options:
  • HISTORY_DEFAULT_SIZE: The amount of bytes reserved initially. Default: 256


FEATURE_LAST_DIR - Change back to last directory

See also: CD, CDD, CHDIR, POPD, PUSHD

If defined on compilation of FreeCOM, every change of the current directory using an internal command records the previous directory and enables the - shortcut for CD, CDD and CHDIR.

Example:

C> CD \
C> CD freedos\bin
C> CD -
C> CD -

The first CD command changes into the root direcotry, the second into the directory \FREEDOS\BIN, any subsequent CD - commands will change between the root directory and \FREEDOS\BIN.


FOR - Repeat a command

Requirements: CMD_FOR

Synopsis

FOR '%' letter IN '(' { word | pattern } ')' DO «any command»
Executes «any command» for several values assigned to the variable letter. The values are read strictly left to right from the words and patterns enclosed in parenthises; where patterns are words containing wildcards and are replaced by all matching filenames.

Any occurence of a percent sign % and the specified letter is replaced by the current value of the FOR loop. Note: The letter is case-sensitively matched!

Warning #1: Unlike most commands I/O-redirections are passed forth to the command instead of to apply them to FOR itself, e.g.:
FOR %a IN (*.*) DO ECHO %a >q
repeatedly executes the ECHO command with the redirection >q, hence, effectively overwriting the file each time.
Warning #2: Due the syntactical problem that the FOR variable is specified as '%' letter, which is also a legal start of an environment variable, the following kludge had been included to support FOR and its special variables:

  • You can use as many percent character as you wish as long as you use exactly the same number for a particular FOR variable.
  • Before any environment variables are expanded, the command line is checked for the skeleton specified within the synopsis (there must not be specified no redirection between the FOR and DO keywords), if it is found, the FOR command is executed without expanding any environment variables -- they get expanded each time the command is invoked.
  • Known Bug: Otherwise any environment variables are expanded and, if it happens that a valid FOR command is found now, the environment variables within the command are expanded a second time. In this case the I/O redirections are applied to FOR, too, instead of passing them forth to the command.
  • FOR commands as part of the command of CALL, IF, and FOR itself are never found before expanding the environment variables.

Warning #3: Due a bug in MS COMMAND (BugID #1050) the right parenthesis must be followed by at least one whitespace, this allows the "feature" to embed such characters within the words and patterns, e.g.:
FOR %a in (a()a b()b) DO command
executes the command two times, first replacing %a by a()a, second by b()b.

Examples

Example: 1

FOR %z IN (*.*) DO copy %a a:
Performs a COPY xyz A: command for each file in the current directory. Its behaviour is equal to COPY *.* A:

Example: 2

FOR %z IN (a?b*.TXT) DO CALL batch arg %z
Executes the batch script batch.bat for each file matching the pattern A?B*.TXT located in the current directory. Within the script, the automatic variable %1 always expands to the constant argument arg, whereas %2 expands to the filename of the current loop.

Example: 3

FOR %a IN (1 2 3 4 5) DO ECHO %a
Is equal to the command sequence:
ECHO 1
ECHO 2
ECHO 3
ECHO 4
ECHO 5
Because these words do not contain no wildcards, they are not matched as filenames.

Example: 4

FOR %g IN (1 2 3*) DO ECHO %g
Performs the commands:
ECHO 1
ECHO 2
and the ECHO command for each file in the current directory, that has no extension and which name starts with the digit three.


GOTO - Goto label

Requirements: CMD_GOTO

Synopsis

GOTO [ ':' ] label
Normally all commands of a batch script are executed in the sequence in which they are appear with the script. GOTO controls the command flow by unconditionally jumping to the specified label; the commands following that label will be executed then. A label is written as a colon in the first column of a line and the name of the label immediately behind. If FreeCOM hits a label in the normal flow, it is ignored completely, even any redirection characters are ignored.

The label must be located in the same script file as the GOTO itself, if it appears more than once, the first occurance takes precedence.

Conditional jumps can be contructed with help of the IF command, see example 2.

Examples

Example: 1

GOTO ende
Jumps the to label :ende

Example: 2

IF "%1"=="" GOTO emptyCommandLine
Jumps to label :emptyCommandLine, if no argument had been passed to the batch script. For instance:
@ECHO OFF
IF "%1"=="" GOTO error
REM do something sane here
GOTO ende

:error
ECHO You must pass an argument to me!

:ende


HISTORY - Display command line history

Requirements: FEATURE_HISTORY

Synopsis

  1. HISTORY
  2. HISTORY number

The first format without any argument displays all cached command lines.

The second format resizes the memory pre-allocated for the command line history cache to number bytes.


IF - Conditional execution of a command

Synopsis

  1. IF [ NOT ] EXIST file «command»
  2. IF [ NOT ] ERRORLEVEL number «command»
  3. IF [ NOT ] string '==' word «command»
  4. IF [ NOT ] quoted-string '==' quoted-string «command»
Conditionally executes the specified «command». If the keyword NOT is specified, the condition is negated, meaning, the «command» is executed, if the condition evaluates to false.

The first condition evaluates to true, if the specified file exists. Wildcards are supported. On local file systems one can test for character devices, too.

The second variant evaluates to true, if the errorlevel is currently assigned to a number greater or equal than the specified number. Errorlevels are assigned when external commands terminates or via CANCEL or QUIT.
Due to compatibly with other DOS shells FreeCOM does not check, if the specified errorlevel is a number, but silently accepts any string. This allows to use the so-called Benny levels, where you can specify HA, HB, ... , HZ or xa, xb, ... , xz instead of 1, 2, ... , 26. Some malformed batch script use this syntax to make mapping of errorlevels to drive letters more visible. See example 5.

The third and four ones are true, when the left string is case-sensitively equal to the string on the right side of the double equal sign. Either side may be quoted by double quotes, though, if the right side is not quoted, the first word is tested only.

Examples

Example: 1

IF NOT EXIST c:\command.com ECHO There is no COMMAND.COM in C:\

Executes the ECHO command, if a file C:\COMMAND.COM does not exist.

Example: 2

IF EXIST c:\fdos\nul GOTO have_fdos_directory

Branch the interpretation of the batch script to the label, if the file C:\FDOS\NUL exists. Because the filename NUL corresponds to the character device NUL:, which always exists, this test may be used to probe for the existance of the path C:\FDOS, because all character devices are virtually present in every directory of local filesystems.

Example: 3

IF %1==name ECHO First argument is "name"

ECHO is executed, if the first argument of the current batch script is "name" (without the quotes). %1 may expand to any string, even with embedded whitespaces, but without an embedded double equal sign. Also, metacharacters included within the argument are evaluated.

Example: 4

IF "%1"=="first name" ECHO First argument is "first name"

ECHO is executed, if the first argument of the current batch script is "first name" (without the quotes). %1 may expand to any string, even with embedded whitespaces or an embedded double equal sign or metacharacters.

Example: 5

«program»
SET drv=
FOR %%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
IF ERRORLEVEL 27 SET drv=
IF "%drv%"=="" goto error_no_drive_letter

Assuming that «program» is setting the exit code to 1..26 for the drive letter, e.g. when searching for RAMdisks, this code snippet assigns the drive letter to the environment variable drv or unsets the variable on error.

Note: The following code is equal to the above one and fully compatible to all shells: «program»
SET drv=
IF ERRORLEVEL 1 SET drv=A
IF ERRORLEVEL 2 SET drv=B
IF ERRORLEVEL 3 SET drv=C

...
IF ERRORLEVEL 25 SET drv=Y
IF ERRORLEVEL 26 SET drv=Z
IF ERRORLEVEL 27 SET drv=
IF "%drv%"=="" goto error_no_drive_letter


FEATURE_LOAD_MESSAGES - Load messages permanently

If enabled on compilation of FreeCOM, the /MSG becomes available.

If this option is present, when an instance of FreeCOM is created, the FreeCOM messages are loaded into memory permanently. Otherwise, the messages are loaded on demand and are removed from memory when an external command is executed, in order to conserve memory.

This feature may help to run FreeCOM on disk- and floppyless boxes.


LOADFIX - Load an external program above the first 64KB memory

See also: CALL, LOADHIGH

Synopsis

LOADFIX program [{ argument }]
Loads and executes an exepacked program, that would abort execution with the error message "Packed file corrupt" otherwise.

Attention: This command is not available in the XMS-only variant of FreeCOM!

Example:

LOADFIX program.exe


LOADHIGH - Load an external program into high memory

See also: CALL, LOADFIX

Synopsis

LOADHIGH [{ option }] program [{ argument }]
Loads and executes an external program in high memory, also called UMB. This command is used to load TSRs, such mouse drivers, into the upper memory to conserve the conventional memory for programs.

Example:

LOADHIGH lmouse.com


MD - make directory

See also: CD, MKDIR, RD
Requirements: CMD_MKDIR

Synopsis

MD path
Creates a directory of the specified name path. Any parent directories must already exist.

Examples

Example: 1

MD C:\1

Creates the directory 1 in the root directory of drive C:.

Example: 2

MKDIR C:\1\2\3

Creates the directory 3 in the directory \1\2 of drive C:. If the directory C:\1\2 does not exist, yet, the command fails.


MEMORY - Display the internally used memory

Requirements: CMD_MEMORY

Synopsis

MEMORY

Displays the useage of internal memory of FreeCOM. Note: The internals of FreeCOM are currently under heavy construction, the actual output might vary heavily from this example.

Examples

MEMORY
may display this:
Environment segment    : max  1200 bytes; free     8 bytes
Context segment        : max  2304 bytes; free  2252 bytes
        Aliases        : limit  1024 bytes, current     5 bytes,     0 items
        History        : limit   256 bytes, current    34 bytes,     2 items
        Directory stack: limit   256 bytes, current     5 bytes,     0 items
        Last dir cache : used      0 bytes,     0 items
        Swapinfo       : used      0 bytes,     0 items
Heap                   : free 482080 bytes
  • The Environment segment is the storage area, the environment variables are storred in. It may be changed passing the /E option to FreeCOM.
  • FreeCOM stores several internal information into the Context segment; the aliases - modified by the ALIAS command -, the history - displayed using the HISTORY command, accessed by pressing the cursor Up/Down keys on command line -, the directory stack - displayed with the DIRS command and accessed using the PUSHD and POPD commands -, the last directory - accessed with the CD - command -, and, finally, some internal command used by the low-level swap interface of FreeCOM.
  • The heap is the storage area FreeCOM can allocated memory from itself. This value is useful for FreeCOM developers mostly.
  • max specifies the maximum amount of bytes allocatable within this storage area.
  • free specifies the unused bytes within this storage area.
  • limit specifies the maximum amount of bytes allocatable for the particular information within the area.
  • current specifies the amount of bytes currently allocated for the particular information.
  • items specifies the number of items storred for the particular information, e.g. how many directories have been pushed onto the stack using PUSHD.


MKDIR - Make directory

This command is 100% compatible to MD, please see there


PATH - Display or set the search path

Requirements: CMD_PATH

Synopsis

  1. PATH
  2. PATH [ '=' ] { path : ';' }
  3. PATH;
Displays or assigns a new search path.

The first variant displays the currently active search path.

The second one assigns the specified paths to the search path. The leading equal sign, if present, is ignored.

The third variant empties the search path.

When FreeCOM searches for an external command or a batch script, which has no path specified, it is search for in all the directories specified in the search path. If the current directory . is not mentioned in the search path, it is searched through first.

Examples

Example: 1

PATH c:\fdos\bin;c:\tools;d:\others\bin;bin

If FreeCOM is to execute an external program, e.g. XCOPY, FreeCOM will search for the program in the following directories in the specified order, the first program file found is executed:
  1. the current directory
  2. C:\FDOS\BIN
  3. C:\TOOLS
  4. D:\OTHERS\BIN
  5. BIN

Note: Because the last directory specification is a relative one, rather than an absolute one, the program is searched for in the sub-directory BIN of the current directory.


PAUSE - Pauses batch file execution

Requirements: CMD_PAUSE

Synopsis

  1. PAUSE
  2. PAUSE «string»

Pauses the batch file execution until a key is pressed.

PAUSE prompts the user with the specified string or, if none is specifed, "Press any key to proceed"

Examples

Example: 1

PAUSE
Just pauses the execution.

Example: 2

PAUSE Execution paused, press any key to proceed ...
Pauses execution displaying this string.

Example: 3

PAUSE >nul
Pauses execution, but does not display any prompt.


POPD - Change back to the last pushed directory

See also: CD, CDD, DIRS, POPD
Requirements: CMD_CDD, CMD_POPD

Synopsis

  1. POPD
  2. POPD '*'

The first variant changes the current directory back to the one, in which the last PUSHD command was executed.

The second one clears all entries of the directory stack, but does not change the current directory.


PROMPT - Display or set the shell prompt

Requirements: CMD_PROMPT

Synopsis

PROMPT
PROMPT [ '=' ] prompt

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


PUSHD - Push the current working directory onto the directory stack

See also: CD, CDD, DIRS, POPD
Requirements: CMD_CDD, CMD_PUSHD

Synopsis

PUSHD directory

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


QUIT - Terminate the current script

Synopsis

QUIT [ n ]
Terminates the current active batch script and, if present, assigns the specified number n to the errorlevel.

Note: This command is a hidden internal command.


RD - Remove directory

See also: CD, MD, RMDIR
Requirements: CMD_RMDIR

Synopsis

RD path

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


REM - Marks comments or remarks in batchfiles

Requirements: CMD_REM

Synopsis

REM «string»

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


REN - Rename files

See also: RENAME
Requirements: CMD_RENAME

Synopsis

REN «source» «destination»
Renames the source file(s) into the target file(s). See also: \REF{wildcards}

The «destination» must not contain any path specification, the «source» file is renamed within the directory it is currently located in, see example 2 below. Any wildcards used within «destination» are replaced by the corresponding character of the source filename, see example 4 below.

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1

REN file1.txt file2.txt
Renames file1.txt into file2.txt

Example: 2

REN path\file1.txt file2.txt
Renames path\file1.txt into path\file2.txt

Example: 3

REN path\file*.txt *.bak
Renames all files located within directory path with extension .txt and which filename is beginning with file, such as file.txt, filea.txt and file99xx.txt, into *.bak files.

Example: 4

REN *.DAT A*.*
Renames all files located within the current directory with extension .DAT into files by replacing the very first character of the filename by the letter A, all other characters, the file extension and path are remain unchanged.

Example: 5

REN *.TXT ??b*.bak
Renames all files located within the current directory with extension .TXT into files by replacing the third character of the filename by the letter B and the file extension to .BAK, all other characters and the file path are remain unchanged.

Warning: If the source file name consists of one character only, the second question mark in the destination pattern is ignored, hence, e.g. the file A.TXT is renamed into AB.BAK by this example, what is incompatible to MS COMMAND v6.22 (maybe others, too), which embedds a space as second character making the file inaccessable, but what is exactly the same behaviour of the same MS COMMAND's COPY command.


RENAME - Rename files

This command is 100% compatible to REN, please see there


RMDIR - Remove directory

This command is 100% compatible to RD, please see there


SET - Display or set environment variables

Requirements: CMD_SET

Synopsis

  1. SET [{ option }]
  2. SET [{ option }] variable '=' «string»

The first variant (without any argument) displays all the currently defined environment variables in the format (without any whitespaces before or after the equal sign): name '=' «value»

The second variant assigns a new value «string» to the specified variable. If the variable already exists, the old value is overwritten without notice; otherwise it is newly created.

Options

Unless stated otherwise all options of this command do follow the standard rules for options. All options must preceed the assigment, if present.

  • /C: forces to keep the exact case of the letters of the variable name; by default all letters are uppercased to keep compatibly.
  • /I: has been temporarily included to the SET command to allow an easy way to display the current size of the environment segment, because it is one of the most frequently reported, but not reproduceable bug report. Once this option has been encountered, all the remaining command line is ignored.
  • /P: Prompts the user with the specified «string» and assigns the user's input to the variable. If no input is made, hence, one taps just ENTER, an empty value is assigned to the variable, which is then removed from the environment.


SHIFT - Shift the arguments of a batch script

Requirements: CMD_SHIFT

Synopsis

  1. SHIFT
  2. SHIFT DOWN

Shifts the arguments of a batch script one position up (first variant) or down (second variant).

Within a batch script the automatic variables %0 through %9 are replaced by the script name and the first nine arguments. This can be imagined as a window to ten arguments of the script. SHIFT will allow to move this window of ten arguments towards its end (up) or its start (down).

After SHIFT has been executed, the former %0 is hidden and inaccessable, %1 became %0, %2 became %1 a.s.o, %9 became %8 and the formerly hidden tenth argument became %9.
SHIFT DOWN reverses one SHIFT command.

SHIFT can be called as many times as wanted, SHIFT DOWN won't allow to underflow the very first argument.

Examples

Example: 1

If the batch script B.BAT:
@ECHO OFF
ECHO 0: %0
ECHO 1: %1
ECHO 2: %2
had been executed using:
B.BAT 1 2 3 4
it displays:
B.BAT
1
2

If a SHIFT command had been inserted as second line, the same call displays:
1
2
3


TIME - Display or set current time

See also: DATE
Requirements: CMD_TIME

Synopsis

  1. TIME [ /T ]
  2. TIME [ /T ] time
Variant 1 displays the current time, then enters a loop prompting the user to enter a new time. The loops terminates when a valid time had entered or the user just pressed the ENTER key.

Variant 2 does not display the current time, but tries to change the current time to the specified time, on failure the loop as explained above is entered.

The individual portions of a time may be sperated by at least: dots ., colons : and forward slashes /. Other nationally used characters may be supported, too. If a certain number of portions are specified:

  1. error,
  2. hour:minute; seconds and hundreds default to zero,
  3. hour:minute:seconds; hundreds defaults to zero,
  4. hour:minute:seconds.hundreds;
  5. more than 4 portions result in an error.
Separated by no, one or more whitespaces the am/pm modifiers may follow optionally. If present they alter the given time as follows:
  • AM: if hour is equal to 12, it becomes 0 (midnight).
  • PM: f hour is greater than 12, it is incremented by 12.

Options

All options must preceed any arguments.

/T: prevents from prompting the user.

  1. In variant 1, the time is displayed only.
  2. In variant 2, the time is tried to be changed, but the loop is not entered on failure.

Examples

Example: 1

TIME /T
Just displays the current time.

Example: 2

TIME 18:2
Sets the current system time to 6:02 PM.


TRUENAME - Display the true name of a file

Requirements: CMD_TRUENAME

Synopsis

TRUENAME path

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


TYPE - Display the contents of files

See also: DIR, ECHO
Requirements: CMD_TYPE

Synopsis

TYPE { pattern }

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


VER - Display the version information about FreeCOM and DOS

Requirements: CMD_VER

Synopsis

VER [{ option }]

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


VERIFY - Display or set verify level

Requirements: CMD_VERIFY

Synopsis

VERIFY [ ON | OFF ]

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


VOL - Display the volume label of a drive

See also: DIR

Synopsis

VOL [ drive ]

Options

Unless stated otherwise all options of this command do follow the standard rules for options.

Examples

Example: 1


WHICH - Search and display the executable file of specified commands

Requirements: CMD_WHICH

Synopsis

WHICH [{ command }]

Searches for the specified command(s) the same way as if it would be specified on command line as command itself. If an executable file is found, its path is displayed in this format:
command «tab» path

The «tab» stands for the tabulator character (ASCII 9).
If the command is not found only the command part, but neither a path nor the «tab» is displayed.

Internal commands, installable commands and aliases are not found.

Examples

Example: 1

WHICH which
Returns a file or nothing, because WHICH is an internal command.

Example: 2

WHICH command
Could display for instance:
command	C:\COMMAND.COM

Please note that command is the string "command" and no placeholder.


Appendix

Current Directory

The current directory is the default directory of a drive.

DOS stores a default directory for each drive. When a path is specified with a drive specification only, such as D:, it is completed with this default directory of that drive to construct the absolute path to be used.

Current Working Direcory

In opposite to the current directory the current working directory is the absolute path constructed out of the currently selected drive and current directory of that drive.

Path Specification

In DOS an absolute path is constructed out of several components:
  1. drive,
  2. directory,
  3. filename, and
  4. file extension.
like this: D:\DIR1\DIR2\FILENAME.EXT.

The drive is a single letter from A through Z followed by a colon :.

The remaining part of a path consists of similiar components delimited by a single backslash \. The last component is also called filename. Each of these components may be formed of a name, up to eight characters long, and an extension, up to three characters long. Both parts are delimited by a single dot .. Although the extension may be absent, the filename must have at least one character.
Note: The term filename is not limited to files in the usual sense, but may apply to any name visible in a directory, such as subdirectories and volume labels, as well.

To ease the way to enter a path the user may specify a relative path, rather than an absolute one. In such path one or more components may be missing:

  • If no drive is specified, what means that no colon is specified, the path is prefixed by the currently selected drive.
  • If the directory is not prefixed by the backslash or no directory is specified at all, the current directory of the drive is inserted right behind the colon.
  • Some programs may append an absent extension to the very last filename component.

Examples, assume the current directories of
Drive Current Directory
C: \FREEDOS\HELP
D: \TEMP\TEXT
The currently selected drive is C:.

  1. C:\
    The root directory of drive C:.
  2. .
    The current working directory, ergo: C:\FREEDOS\HELP.
  3. ..
    The parent directory, ergo: C:\FREEDOS.
  4. D:
    The current directory of drive D:, ergo: D:\TEMP.
  5. D:.
    The current directory of drive D:, ergo: D:\TEMP.
  6. D:..
    The parent directory of drive D:, ergo: D:\.
  7. ..\BIN
    Because there is neither a drive nor a leading backslash, both the currently selected drive and the current directory of that drive is inserted before the given path, ergo: C:\FREEDOS\HELP\..\BIN.
    The embedded component .. has the same meaning as when specified alone: parent directory, though, here in the context of the directory C:\FREEDOS\HELP\. That means that the final absolute path is: C:\FREEDOS\BIN.

Path specifications that do not conform to above mentioned format lead to various different behaviour of the various programs, because there is no standard to scan, parse and interprete such patterns. Problems include:

  • multiple backslashes,
  • multiple dots,
  • multiple colons, or a colon at a position unequal to two,
  • The current directory . or parent directory .. special directories in the context of a root directory, such as C:\., C:\.., or C:\TEMP\..\...

Note: The special directories . and .. are no phantom directories or virtual entries, but standard entries of every directory except the root directories. These entries help crash recovery tools, such as CHKDSK or SCANDISK, to find errors within the directory structure and restore it to a valid file tree. Therefore a common assumption that a tripple dot ... directory means parent-of-parent is incorrect, though, might be supported by certain programs.

Standard Rules for Options

Options are prefixed by one forward slash "/", the following character identifies the option and is called option character, for instance: /A

Some commands do accept long option names, where a complete word identifies the option rather than a single character, e.g. /MSG.

Some option may be used in conjunction with an argument. The argument is appended to the option with one colon ":" or one equal sign "=", for instance: /A:hr or /P=fdexec.bat.

Multiple options without argument maybe merged together as a single option with or without embedded slashes, e.g. /WS or /W/S, instead of /W /S.
However, because some commands do accept long option names, the way with embedded slashes is more secure and is recommended therefore.
An option with argument may be the last one of such merged options.

Options without arguments enable or disable certain features. Therefore, those options are sometimes called boolean options or flags.
Boolean options may be optionally prefixed by a plus "+" or minus "-" sign. So, the boolean option O can be written in three ways:

  1. /+O: The option is enabled.
  2. /-O: The option is disabled.
  3. /O: (neither plus nor minus sign) The option is toggled or flipped; this means if the option is enabled currently, it is disabled; but if it is disabled currently, it is enabled.

Without user invention a boolean option is disabled by default, so both /+O and /O behave the same most of the time. However, some commands allow the user to change the default settings of certain options, e.g. COPY and DIR.

I/O Redirection

In DOS the standard input and output can be redirected to a file or another device; however, although it is common to use these I/O streams today, some programmers cowardly ignore them for reasons of speed or program size.

If the input stream is redirected to a file or device, instead of polling the keyboard and request the user to interactively enter characters via the keyboard, those characters are read from the file or device. Usually these programs terminate when the file has been read wholely.

If the output stream is redirected to a file or device, instead of issuing the information onto screen, it is dumped into the file or device. Per convention each program has two output streams: one (called standard output) to issue normal information and one (called standard error output) for error messages the user should not miss.

Redirections are specified on command line and effect exactly that command invoked herein, regardless if the command is an external or internal one, an alias or batch script. The utter exception is the FOR command, which requires that the redirection is to apply to the command specified behind the DO keyword rather than FOR itself.
If more than one redirection is specified on the command line and they effect the same stream (input, output, or error), the rightmost one superceed any previous one.

Redirections are syntactically specified like this:
operator target
operator ::= '<' | '>' [ '>' ] [ '&' [ '>' ] ]
target ::= file | device

Although it is not relevant where the redirections are placed on the command line, it is common praxis to place them at the end of it.

The operators have the following meaning:
Operator Redirection
< Input stream
> Output stream; target file is overwritten
>> Output stream; output is appended to target, if it already exists
>& Output and error stream; target file is overwritten
>>& Output and error stream; output is appended to target, if it already exists
>&> Error stream; target file is overwritten
>>&> Error stream; output is appended to target, if it already exists

Examples

Example: 1

cmd <in1 <in2

Input stream is redirected to file IN2, because it is the rightmost one.

Example: 2

cmd <in >&out

Input stream is redirected to file IN, output and error streams are joined together and redireced into file OUT. If the file OUT already exists, the old contents is discarded and replaced by the new one; otherwise, the OUT is created anew.

Example: 3

cmd <in >>&out

As example 2, but instead of replacing the contents of OUT, if the file already exists, the new information is appended to the end of the file.

Example: 4

FOR %a IN (*.*) DO ECHO %a >out

As mentioned earlier, FOR is an exception and passes forth the redirections to each invocation of the command specified right of the DO keyword. So this examples overwrites the output file each time the ECHO command is performed, thus, instead of creating a file list, only the last found file is recorded into OUT.

Example: 5

IF EXIST out DEL out
FOR %a IN (*.*) DO ECHO %a >>out

This sequence eliminate the problem, the IF command is required to actually replace the file rather than appending the file list to the probably existent file.

Pipes

Another form of redirection is piping. Hereby, the output stream of one command is connected to the input stream of another command. Pipes can combine any number of commands this way. Because DOS is no multitasking system, pipes are simulated by spawning the first command with an output redirection capturing the issued information into a temporary file and then the second command with an input redirection from that very same temporary file, on completation of the second command the temporary file is deleted.

Examples

Example: 1

cmd1 | cmd2 | cmd3

Which is similiar to this sequence:
cmd1 >%TEMP%\t1
cmd2 <%TEMP%\t1 >%TEMP%\t2
DEL %TEMP%\t1
cmd3 <%TEMP%\t2
DEL %TEMP%\t2

Example: 2

The first and last command can have an input or output redirection respectively, like so:
cmd1 | cmd2 | cmd3 <in >out

Which is similiar to this sequence:
cmd1 >%TEMP%\t1 <in
cmd2 <%TEMP%\t1 >%TEMP%\t2
DEL %TEMP%\t1
cmd3 <%TEMP%\t2 >out
DEL %TEMP%\t2

Example: 3

The error stream can be piped as well:
cmd1 |& cmd2 | cmd3

Which is similiar to this sequence:
cmd1 >&%TEMP%\t1
cmd2 <%TEMP%\t1 >%TEMP%\t2
DEL %TEMP%\t1
cmd3 <%TEMP%\t2
DEL %TEMP%\t2

Here only the error messages of cmd1 are passed into cmd2; the error messages of both cmd2 and cmd3 are issued to the screen.

Nested redirections

Batch scripts or when external programs invoke other programs or another shell, redirections may be nested, e.g.:

Consider the batch file BATCH.BAT:

@ECHO OFF
ECHO 1
ECHO 2 >out_2
ECHO 3
which is invoked via:
BATCH >out_1

When the script BATCH gets executed, the actual output stream is redirected to the file OUT_1. Therefore the output of the first ECHO command is redirected into this file.
Because the second ECHO command has its own output redirection, its output is redirected into the file OUT_2. On completion of ECHO the redirection is closed and the former one is restored.
What causes that the output of the third ECHO command is redirected into OUT_1 again.

Hidden Internal Commands

There are some special internal commands, that are not directly visible nor accessable. They are hidden because of two main purposes:
  1. Many of them are of internal nature and should not used by the user.
  2. They are extensions to the normal batch language and may, therefore, clash with a particular installation. To prevent this clash those commands are hidden by default and can be made directly accessable via the ICMD command.

Hidden internal commands can be access by prefixing the command with ::=. This token usually specifies a label within the batch language, given the nature of the labels, they may be comments as well. Due to the latter variant, most non-FreeCOM shells won't see the ::=, hence, ignore those commands.

For example: C> ::=CANCEL 30

cancels (terminates) all currently active batch files and assigns 30 to the current errorlevel. ================================================ FILE: docs/html/commands/db2html ================================================ #!perl ## Formats the command DB files into HTML. ## See INFO ## if the TOC exists, it is inserted right at the start of the ## HTML file #na)me: of object described herein; should match the filename #de)scription: one line description #eq)ual to: name of object 100% equal to this one, no further entries # allowed #se)e also: references #re)quirements: which other objects this object depends on #op)tional: optional requirements for certain features #co)nflicts: which other objects this object conflicts with require 'parse.pl'; $ref = { 'appendix' => sub { '"; } , 'cmd' => sub { ''; } , 'main' => sub { my $n = shift; $n =~ s/^[_-]+//g; return '"; } , 'section' => sub { "\n

" . ucfirst(lc($_[0])) . "

\n"; } , 'subsection' => sub { "\n

" . $_[0] . "

\n"; } }; $file_toc = "TOC"; $file_html = "../cmd.html"; ## $file_cmd = "CMDLIST"; # List of commands to be automatically linked %headers = ( 'na', 'name', 'de', 'description', 'eq', 'equal to', 'se', 'see also', 're', 'requirements', 'op', 'optional requirements', 'co', 'conflicts with' ); my($na, $de, $eq, $se, $re, $op, $co); my( @se, @re, @op, @co); %toc = (); $htmlHowToFormatOptions = ' Unless stated otherwise all options of this command do follow the
standard rules for options. '; &openCmdList; &htmlOpenHtml; &htmlOpenTOC; @ARGV = glob("*.db") unless $#ARGV >= 0; for (@ARGV) { &handle($_); } # &dumpAppendix; &htmlCloseTOC; &htmlCloseHtml; &closeCmdList; exit 0; sub handle { my($file) = @_; ## Read header of file if(!open(IN, $file)) { &log("Cannot open file \"$file\": $!"); } else { ($na, $de, $eq, $se, $re, $op, $co) = (); while() { chomp; last if /^\s*$/; if(/^(.+?):\s*/) { my($key) = $1; my($value) = $'; next unless $value; $key =~ tr/A-Z/a-z/; $key =~ s/\s+/ /g; if(length($key) < 2) { &log("Invalid header key '$key' in $file\n"); } else { my($keyname) = substr($key, 0, 2); if(substr($headers{$keyname}, 0, length($key)) eq $key) { eval "\$$keyname = \$value"; } else { &log("Unknown header key '$key' in $file"); } } } else { &log("Syntax error in header section of $file"); } } if($na && $de) { $na = &mangleName($na); &dumpHeader($na, $de); if($eq) { &dumpEqual($eq); } else { @se = sort map { &mangleName($_) } split(/[,\s;]+/, $se); @re = sort map { &mangleName($_) } split(/[,\s;]+/, $re); @op = sort map { &mangleName($_) } split(/[,\s;]+/, $op); @co = sort map { &mangleName($_) } split(/[,\s;]+/, $co); &dumpHeaderEntry; &dumpBodyEntry; } &dumpFooter; } else { &log("Missing header keys 'name' or 'description' in $file"); } close IN; } } ## Dump "equal-to" command in HTML sub dumpEqual { my($eq) = &mangleName(@_); print HTML "This command is 100% compatible to ", htmlCommandRef($ref, $eq), ", please see there\n"; } ## Dump new command header sub dumpHeader { my($na, $de) = @_; &dumpTOC($na, $de); print HTML '

$na - $de

\n"; &writeCmdList(uc($na)); } sub dumpAppendix { print HTML '

Appendix

',"\n"; open(IN, "stuff") or die "Cannot open Appendix: $!\n"; $na = "_Appendix"; &dumpBodyEntry; close IN; } ## Dump Headers for normal entry sub dumpHeaderEntry { if($#se >= 0) { print HTML "See also: " , join(', ', (map { &htmlRefWord($_) } @se)) , "
\n"; } if($#re >= 0) { print HTML "Requirements: " , join(', ', (map { &htmlRefWord($_) } @re)) , "
\n"; } if($#op >= 0) { print HTML "Optional requirements: " , join(', ', (map { &htmlRefWord($_) } @op)) , "
\n"; } if($#co >= 0) { print HTML "Conflicts with: " , join(', ', (map { &htmlRefWord($_) } @co)) , "
\n"; } } sub dumpBodyEntry { &parseEBNF($ref, lc($na)); } sub dumpFooter { &htmlFooter; } sub htmlRefWord { my($cmd) = @_; return $cmd unless defined($cmdlist{uc($cmd)}); return htmlCommandRef($ref, $cmd); } ## Dump the command footer sub htmlFooter { print HTML "


\n"; } # command name sub mangleName { return uc($_[0]); } sub dumpTOC { my($na, $de) = @_; $toc{$na} = $de; } #############################3 sub htmlOpenTOC { open(TOC, ">$file_toc") or die "Cannot create TOC: $file_toc: $!\n"; } sub htmlCloseTOC { my($na, $de); foreach $na (sort keys %toc) { print TOC '
  • $na - $toc{$na}\n"; } close TOC; } sub htmlOpenHtml { open(HTML, ">$file_html") or die "Cannot create HTML: $file_html: $!\n"; print HTML ' Internal Commands of FreeCOM List of commands and features of FreeCOM:
      '; if(open(TOC, $file_toc)) { # Import the previously created TOC print HTML ; close TOC; } print HTML "
    \n



    \n"; } sub htmlCloseHtml { print HTML "\n"; close HTML; } ##################3 sub openCmdList { &readCmdList($ref); open(CMDLIST, ">$file_cmd") or die "Cannot create command list file: $!\n"; } sub closeCmdList { close CMDLIST; } sub writeCmdList { print CMDLIST $_[0] . "\n"; } ## Log an error to the console and the logfile sub log { local($logging) = 0; if(!$logging) { my($file) = "$0.LOG"; die "Cannot create logfile: $!\n" unless open(LOG, ">$file"); $logging = 1; } print LOG join("\n", @_) . "\n"; print STDERR join("\n", @_) . "\n"; } ================================================ FILE: docs/html/commands/info ================================================ File format of .DB files: Header: na)me: of object described herein; should match the filename de)scription: one line description eq)ual to: name of object 100% equal to this one, no further entries allowed se)e also: references re)quirements: which other objects this object depends on op)tional: optional requirements for certain features co)nflicts: which other objects this object conflicts with -- delimits header and body Body: The rest of the file is plain HTML text, except: + ... encloses names of options + ... encloses names of arguments + ... encloses a command line embedded into HTML text + ... encloses text to set "bright" (e.g. red colour) + ... encloses text to set "dark" (e.g. dark gray colour) + CMD: prefixes a line that solemny consits of a command line also quotes all HTML characters + EBNF: prefixes a line that solemny consists of a EBNF expression + EBNF!: prefixes a line that solemny consists of a EBNF expression, which is part of the surrounding HTML text. + Labels (aka: ) are mangeled to automatically be unique throughout the whole generated HTML files. + References to labels must be written like this: where "object" is the name of the object the label is part of; an empty label references to the object itself, an empty object references to the label within the same object. Both 'object' and 'label' must consist of letters only. The special object "!" refers to a central explanation location: !:wildcards Explains how wildcards are matched and their syntax !:options Explains how options are parsed standardly !:path Explains how path specification is formatted, abs/rel path The special object "!!" refers to the FreeCOM.html primary source. HREF's with a leading "ftp/http/about" are considered "absolute" hyperlinks and are not mangled. Hyperlinks local to a certain HTML file should beginn with a dash. And their HREF's should be complete (beginning with the hash mark '#'). + SYNOPSIS: is substituted by a "Synopsis" section header line. + ARGUMENTS: is substituted by a "Arguments" section header line. + OPTIONS: is substituted by a "Options" section header line. + STD_OPTIONS: is substituted by a standard "Options" section header line including the reference to how to format options. + EXAMPLES: is substituted by a "Examples" section header line. + EXAMPLE: <> is substituted by a "Example <>" subsection header line. EBNF (enhanced Backus-Naur-Format): + Tokens must be surrounded by at least one whitespace. + Tokens must not contain whitespaces. + Variants of tokens: ++ first character is a capitol letter: Fixed part of a command, set in tags. ++ first character is a lower-case letter: Variable part of a command, a place holder; set in tags. ++ a sequence of characters enclosed in single quotes: Characters to be written on command line; set in tags quotes not stripped. ++ else: Metacharacters for EBNF: +++ ( ) narrows other operators +++ | either left or right token list (*) +++ [ ] encloses optional tokens, which may appear exactly once or not at all. +++ { } encloses tokens, which must appear at least once. +++ { : } as { }, but the tokens placed right of the colon are to be inserted between two or more apearances of the tokens left of the colon (**) +++ ::= assignes a meaning to a placeholder. +++ << >> encloses an informal comment (expressed in natural language) (***) +++ No special metacharacter is required to form a sequence of tokens. + Spaces, which must appear on the command line, are usually not explicitly expressed within EBNF neither does the existance of a space imply that such space must be entered on command line, see (***). It is assumed that the reader knows the basic rules where to have to insert spaces. (*) A sequence of |'s form an either-or-operator. (**) E.g.: COPY { srcfile : '+' } dstfile is a short-hand form of: COPY srcfile [{ '+' srcfile }] dstfile (***) E.g.: SET varname '=' <> ================================================ FILE: docs/html/commands/parse.pl ================================================ #!perl # Parses as EBNF HTML into HTML $file_cmd = "CMDLIST"; # List of commands to be automatically linked sub parseEBNF ($;$) { my($ref, $ref_na) = @_; # reference makers & reference name of this object while() { chomp; my($own_line) = 1; if(/^CMD:/) { my $l = $'; $_ = "\n" . &htmlXLat($l) . "
    "; } elsif(/^(SYNOPSIS):/ || /^(OPTIONS):/ || /^(EXAMPLES):/ || /^(ARGUMENTS):/) { $_ = $ref->{'section'}($1); } elsif(/^STD_OPTIONS:/) { $_ = $ref->{'section'}('Options') . $htmlHowToFormatOptions; } elsif(/^EXAMPLE:\s*/) { $_ = $ref->{'subsection'}("Example: $'"); } elsif(/^DESCRIPTION:/) { $_ = "

    \n"; } elsif(/^SKAUS_EVALUATE_PERL:/) { eval $'; } # Process the EBNF tag if(/^EBNF(\!)?:/) { my($line) = $'; $own_line = !$1; $_ = ''; my $delim = ''; while($line =~ /^\s*('.*?'|<<.*?>>)/ || $line =~ /^\s*(\S+)/) { my($token) = $1; $line = $delim . $'; $delim = ''; my($tag) = ''; if($token =~ /^[A-Z']/) { # terminal characters $tag = 'CMD'; } elsif($token =~ /^[a-z]/) { # placeholder $tag = 'I'; } elsif(index(',./[]{}():;', substr($token, 0, 1)) >= 0) { $tag = 'B'; } if($token =~ /^<<(.*?)>>$/) { $token = '«' . &htmlXLat($1) . '»'; } else { $token = &htmlXLat($token); } if($token) { $_ .= ' '; $_ .= "<$tag>" if $tag; $_ .= $token; $_ .= "" if $tag; $delim = ' '; } } $_ .= "
    \n" if $own_line; } else { eval $cmdExpr; # perform the linkaging of the commands } # Basic special tags s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:::ig; s:\"\;:\":g; # Modify references s::
    :ig; my $line = ''; while(m!!i) { $line .= $`; my $post = $'; my $all = $&; my $obj = lc($1); my $label = lc($2); if($obj =~ /^ftp|http|about$/) { # This is an absolute URL $line .= $all; } else { $label = "_" . $label if $label; $obj = $ref_na unless $obj; if($obj eq '!') { ## command appendix $line .= $ref->{'appendix'}($label); } elsif($obj eq '!!') { ## FreeCOM $line .= $ref->{'main'}($label); } else { $line .= $ref->{'cmd'}($obj, $label); } } $_ = $post; } $line .= $_; print HTML $line; print HTML "\n" if $own_line; } } 2; sub htmlXLat { my($line) = @_; $line =~ s/\&/\&/g; $line =~ s/\/\>/g; return $line; } sub htmlCommandRef ($$;$) { my($ref, $cmd, $label) = @_; my $s = ''; $s = " - $label" if $label; return $ref->{'cmd'}($cmd,$label) . "$cmd$s"; } sub readCmdList ($) { my $ref = shift; if(open(CMDLIST, $file_cmd)) { # Read them $cmdExpr = ''; %cmdlist = (); while() { chomp; $cmdlist{$_} = 1; $cmdExpr .= ", s/\\b$_\\b/" . quotemeta("" . htmlCommandRef($ref, $_) . "") . "/g"; } close CMDLIST; $cmdExpr = substr($cmdExpr, 2); # Kill the leading ", " } } ================================================ FILE: docs/html/commands/parseHTML ================================================ #!perl # Parse additional *.html files useing parse.pl require 'parse.pl'; die "Cannot open TOC: $!\n" unless open(TOC, "TOC"); while() { if(/FEATURE_/) { # s/#feature/cmd.html$1/; # Decorate string as it gets HTML'ed when included later s:<.*?>::g; $features .= '

  • ' . $_; } } close TOC; $ref = { 'appendix' => sub { '"; } , 'cmd' => sub { ''; } , 'main' => sub { my $n = shift; $n =~ s/^[_-]+//g; return '"; } , 'section' => sub { "\n

    " . ucfirst(lc($_[0])) . "

    \n"; } , 'subsection' => sub { "\n

    " . $_[0] . "

    \n"; } }; readCmdList($ref); foreach $file ('FreeCOM.html') { die "Cannot open '$file': $!\n" unless open(IN, $file); die "Cannot create '../$file': $!\n" unless open(HTML, ">../$file"); &parseEBNF($ref); close HTML; close IN; } $ref = { 'appendix' => sub { '
    "; } , 'cmd' => sub { ''; } , 'main' => sub { my $n = shift; $n =~ s/^[_-]+//g; return '"; } , 'section' => sub { "\n

    " . ucfirst(lc($_[0])) . "

    \n"; } , 'subsection' => sub { "\n

    " . $_[0] . "

    \n"; } }; readCmdList($ref); foreach $file ('appendix.html') { die "Cannot open '$file': $!\n" unless open(IN, $file); die "Cannot create '../$file': $!\n" unless open(HTML, ">../$file"); &parseEBNF($ref); close HTML; close IN; } ================================================ FILE: docs/index.md ================================================ FreeCOM - FreeDOS Command Interpreter - COMMAND.COM ================================================ FILE: docs/k-swap.txt ================================================ Description of kernel-supoorted swapping of FreeCOM -- 2001/01/21 ska ===> Please also read VSPAWN.TXT. This sort of swap is incompatible with XMS-Only swap! === Preface This technique is an experimental implementation of a general purpose swap technique applyable to FreeCOM that does not require any special support of the kernel. It will therefore not support swapping in any circumstances and is intended to work as a "boot-through" shell for memory hungry programs, which normally don't require no function of a resident shell. === Supported Swappings The swapping is activated via the CALL command in this way: C> CALL /S prg [{ args }] The /S switch forces the swapping mechanism to be activated on executation of the next command. Swapping is NOT supported in: - secondary shells or other programs, - pipes, e.g. CALL /S prg1 | prg2, nor prg1 | CALL /s prg2 , - conjunction with redirections, e.g. CALL /s prg shut down computer. The argument structure is made known to the system via an interrupt call, here are the specs: DOS-4B-FD: Set Segment of Argument Structure AH = 0x4B AL = 0xFD BX = segment DX = 0x4446 == 'FD' (magic number) Return: Carry == 1 on error (see below) Carry == 0 on success BX := _previous_ segment DOS-4B-FE: Get Segment of Argument Structure AH = 0x4B AL = 0xFE DX = 0x4446 == 'FD' (magic number) Return: Carry == 1 on error (see below) if AX == 5 (Access Denied) --> BX := current segment Carry == 0 on success BX := current segment Note: If DEBUG was enabled during compilation of KSSF && Carry == 0, AX := PID of KSSF Only one process may use these functions, any other process gets the error 1 (invalid function). Therefore the primary shell MUST invoke DOS-4B-F? to lock this function for other processes. Secondary shells may use DOS-4B-FE/Carry/AX==5 to detect a context of the primary shell and re-use it's critical error handler. If segment == 0, no segment has been assigned so far. The kernel interpretes this situation as prg == NULL && shell == NULL. FreeCOM performs a swap-out request as follows: + Parse a "CALL /S prg argument" as "CALL prg arguments", but enable the flag swapOnExec. + Eventually the interpreter reaches the "exec()" function, that executes an external command. At this point all the remaining command line has been broken into the external program's name and it's command line. If at this point the flag "swapOnExec" is true, the argument structure is prepared and FreeCOM terminates with a DOS-4C API command. + Whenever FreeCOM is to read "the next input line" from whichever media is currently active, the flag is deactived, thus unless the CALL/S command is immediately followed by an external program, this switch is ignored completely. Because the shell provides two core functions, the Critical Error handler and the ^Break handler, which are not always included within every program, both handlers must be installed residently even if the primary copy of FreeCOM unloads on a swap request. That's why both handlers are installed when FreeCOM loads the first time and FreeCOM's own previous handlers are settings are tweaked in such way that when FreeCOM terminates for swapping, the addresses of the installed handlers are copied back into the system and, thus, furtherly re-used for both the external program and the re-invoked shell. FreeCOM knows two variants of the Critical Error handler: Type 1: displays the known menu Abort/Retry/Ignore/Fail. Type 2: is installed when the primary copy had been invoked with the /F switch == AutoFail. In this case the handler will automatically return "Fail" for all and any Critical Error. This variant is much smaller (about 5 bytes rather than approx. 390 bytes), but may cause unexpected and unretraceable behaviour. FreeCOM installs a ^Break handler, that will always "Abort" the program. This is required in order to make the handler independed on the context, in which it is triggered, aka if within FreeCOM or a spawned program. In most circumstances the external program spawned by a swaped-out FreeCOM will get the same PID as FreeCOM itself. ================================================ FILE: docs/language.txt ================================================ How to change the language of FreeCOM? -- 2000/07/10 ska At this time not all strings can be customized, but it will change! WAY 1 - using pre-compiled FreeCOM images There are four precompiled FreeCOMs: - Debugging - Language + COMMAND.COM - none - English (Default) + CMDDEBUG.COM - yes - English (Default) + COMMAND.CLN - none - none + CMDDEBUG.CLN - yes - none You need: + one of the *.CLN files + STRINGS\FIXSTRS.EXE + STRINGS\DEFAULT.LNG + STRINGS\.LNG What do to: 1) enter STRINGS subdirectory: cd strings 2) create the string database for your language: fixstrs Don't write the angle brackets, e.g. to create Spanish string run: fixstrs spanish 3) attach the strings to FreeCOM: copy /b ..\command.cln + strings.dat command.com If you want to include FreeCOM's debugging support run: copy /b ..\cmddebug.cln + strings.dat cmddebug.com If you want to test several languages, do this: 3) Perform steps 1) and 2) above, but NOT step 3)! 4) Copy either COMMAND.CLN or CMDDEBUG.CLN into any directory you like and rename it into COMMAND.COM, e.g.: copy ..\CMDDEBUG.CLN a:\command.com 5) Copy STRINGS.DAT (the strings database) into the same directory as you copied the clean FreeCOM image above, e.g.: copy STRINGS.DAT a: If you run A:\COMMAND.COM now, it will miss the embedded strings, but will use the external STRINGS.DAT file. To change FreeCOM's language just replace the STRINGS.DAT file. If you use the clean FreeCOM image, but do NOT supply an external STRINGS.DAT file, all strings appear as placeholders, e.g.: "Error #93" WAY 2 - Compile FreeCOM yourself Before you run dmake, create the environment variable LNG and specify the language as its contents, e.g.: SET LNG=spanish ================================================ FILE: docs/loadhigh.txt ================================================ $Id$ Implementation of the LOADHIGH (aka LH) command -- 2002/04/12 ska See below test results (tools reside in TOOLS directory). DISP_AST reveals that LH: 1) enables "High First" within the allocation strategy,& 2) Links in the UMB chain. MCB_VIEW reveals that MS COMMAND'S LH: 1) leaves the conventional memory untouched, 2) if /L switch is present, "hides" unused UMB regions (see below),& 3) when the LH'ed command terminates, all "hidden" UMB regions are restorred, regardless if the particular block was hidden by the particular instance of COMMAND. MS COMMAND locks currently unused MCB's by allocating them for the system (owner PSP == 8). The useage of system MCBs can be determined from the name field of the MCB, e.g.: SC = System Code / lock outs SD = System Data (contains subchain) HIDDEN = MCBs hidden from DOS's memory management Considerations: 1) If /L is present, all non-present UMB regions are hidden; but the ones "present" are _not_ unhidden. 2) When loading high (regardless if with or without /L) _all_ hidden UMB regions are unhidden upon return of the LH'ed command. --> Ergo: There is no record to keep, which MCB had been hidden. An implementation of LOADHIGH might look like this: cmd_loadhigh(char *cmdline) { quaff /L and /S option(s) from begin of cmdline; if(/L present) { for all UMB regions { if(UMB region listed in /L) { if(size is specified for UMB region) { hide all unused MCBs in UMB region, but the smallest one larger than or equal to size; /* keep just _one_ MCB that has the requested size at minimum */ if(/S && there is one unused MCB left therein) { shrink this MCB to size; } } /* no size --> use all MCBs therein */ } else { hide all unused MCBs in UMB region; } } } save allocation strategy and UMB link state; allocation strategy |= 0x80; /* include UMBs in mem alloc */ UMB Link state := 1; exec(cmdline); restore allocation strategy and UMB link state; unhide all MCBs; } ======== Display the allocation stratedy and UMB Link state C> ver/r MS-DOS Version 6.20 Revision A DOS ist im oberen Speicherbereich (High Memory Area) C> DISP_AST Allocation strategy: 0x0000 UMB link state: 0x0000 C> LH DISP_AST Allocation strategy: 0x0080 UMB link state: 0x0001 ======== Test the MCB chain #1 MS-DOS Version 6.20 Revision A DOS ist im oberen Speicherbereich (High Memory Area) ==== CONFIG.SYS device=himem.sys dos=high,umb device=emm386.exe noems ==== AUTOEXEC.BAT <> === >> Started: mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0006 054b >n?Zu vie< myEnv 054b 0523 054b >MCB_VIEW< itsMe 0a6f 94c9 0000 >????P.< unused 9f39 0001 0000 >???, < unused 9f3b 0004 054b >\tool;c:< mySecondaryBlocks 9f40 282e 0008 >SC < system c76f 008f 0000 > < unused c7ff 2402 0008 >SC < system ec02 02fe 0000 > < unused >> Started: LH /L:1 mcb_view mcb_view.exe UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0523 0544 >MCB_VIEW< itsMe 0a68 94d7 0000 >!=t?=< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0081 0000 > < unused c7f8 0001 0000 > < unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system Chain to next program: 'mcb_view.exe' UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0523 0544 >MCB_VIEW< isPSP 0a68 0006 0a6f >!=t?=< myEnv 0a6f 0523 0a6f >mcb_view< itsMe 0f93 8fac 0000 >Sie kann< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < env(MCB_VIEW) c776 007c 0000 > < unused c7f3 0001 0000 > < unused c7f5 0004 0a6f > < mySecondaryBlocks c7fa 0004 0544 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system >> Started: mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0006 054b >MCB_VIEW< myEnv 054b 0523 054b >MCB_VIEW< itsMe 0a6f 94c9 0000 >mcb_view< unused 9f39 0001 0000 >???, < unused 9f3b 0004 054b > < mySecondaryBlocks 9f40 282e 0008 >SC < system c76f 0006 0000 > < unused c776 007c 0000 > < unused c7f3 0001 0000 > < unused c7f5 0004 0000 > < unused c7fa 0004 0000 > < unused c7ff 2402 0008 >SC < system ec02 02fe 0000 > < unused >> Started: LH /L:1 mcb_view c:\command.com /c mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0523 0544 >MCB_VIEW< itsMe 0a68 94d7 0000 >G?|u?&< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0081 0000 > < unused c7f8 0001 0000 >< unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system Chain to next program: 'c:\command.com' UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 0523 0544 >MCB_VIEW< isPSP 0a68 0006 0a6f >G?|u?&< ownedBy(command ) 0a6f 00bc 0a6f >command < isPSP 0b2c 0010 0a6f >arameter< env(command ) 0b3d 0006 0b44 >??????< myEnv 0b44 0523 0b44 >MCB_VIEW< itsMe 1068 8ed7 0000 >! < unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < env(MCB_VIEW) c776 007c 0000 > < unused c7f3 0001 0000 > < unused c7f5 0004 0b44 > < mySecondaryBlocks c7fa 0004 0544 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system >> Started: LH /L:1 mcb_view +c:\command.com /c LH /L:2 mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 868a 0000 >h?^?&_< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0081 0000 > < unused c7f8 0001 0000 >< unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system Chain to next program: 'c:\command.com' UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< isPSP 18b5 0006 18bc >h?^?&_< ownedBy(command ) 18bc 00bc 18bc >command < isPSP 1979 0010 18bc >arameter< env(command ) 198a 0006 1991 >??????< myEnv 1991 1370 1991 >MCB_VIEW< itsMe 2d02 7236 0000 >F? < unused 9f39 0001 0000 >???, < unused 9f3b 0004 1991 > < mySecondaryBlocks 9f40 282e 0008 >SC < system c76f 0006 0544 > < env(MCB_VIEW) c776 0083 0008 >HIDDEN < system c7fa 0004 0544 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system >> This is the 2nd output of the 1st MCB_VIEW when COMMAND returned!! UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 0006 0000 >h?^?&_< unused 18bc 00bc 0000 >command < unused 1979 0010 0000 >arameter< unused 198a 85b5 0000 >??????< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0083 0000 > < unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0000 > < unused >> Started: LH /L:1 mcb_view +c:\command.com /c LH mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 868a 0000 > < unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0081 0000 > < unused c7f8 0001 0000 > < unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system Chain to next program: 'c:\command.com' UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< isPSP 18b5 0006 18bc > < ownedBy(command ) 18bc 00bc 18bc >command < isPSP 1979 0010 18bc >arameter< env(command ) 198a 1370 198a >MCB_VIEW< itsMe 2cfb 7244 0000 > < unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < env(MCB_VIEW) c776 0006 198a > < myEnv c77d 0075 0000 > < unused c7f3 0001 0000 > < unused c7f5 0004 198a > < mySecondaryBlocks c7fa 0004 0544 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 0006 0000 > < unused 18bc 00bc 0000 >command < unused 1979 0010 0000 >arameter< unused 198a 85b5 0000 >MCB_VIEW< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0083 0000 > < unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0000 > < unused >> Started: LH /L:1 mcb_view +c:\command.com /c mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 868a 0000 >h?^?&_< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0081 0000 > < unused c7f8 0001 0000 >< unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system Chain to next program: 'c:\command.com' UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< isPSP 18b5 0006 18bc >h?^?&_< ownedBy(command ) 18bc 00bc 18bc >command < isPSP 1979 0010 18bc >arameter< env(command ) 198a 0006 1991 >??????< myEnv 1991 1370 1991 >MCB_VIEW< itsMe 2d02 723d 0000 >F? < unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < env(MCB_VIEW) c776 007c 0000 > < unused c7f3 0001 0000 > < unused c7f5 0004 1991 > < mySecondaryBlocks c7fa 0004 0544 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system UMBs not linked into the MCB chain Allocation strategy: 0x00 0254 0217 0008 >SDR?< system 046c 0004 0008 >SC&???< system 0471 00bc 0471 >COMMAND < isPSP 052e 0004 0000 >arameter< unused 0533 0010 0471 >lwort? '< env(COMMAND ) 0544 1370 0544 >MCB_VIEW< itsMe 18b5 0006 0000 >h?^?&_< unused 18bc 00bc 0000 >command < unused 1979 0010 0000 >arameter< unused 198a 85b5 0000 >??????< unused 9f40 282e 0008 >SC < system c76f 0006 0544 > < myEnv c776 0083 0000 > < unused c7fa 0004 0544 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 02fe 0008 >HIDDEN < system ======== Test the MCB chain #2 Windows 98 [Version 4.10.2222] Version A DOS ist im hohen Speicherbereich (HMA) ==== CONFIG.SYS device=himem.sys /verbose dos=high,umb device=emm386.exe noems /verbose ==== AUTOEXEC.BAT <> === >> Started: LH /L:1 mcb_view +c:\command.com /c LH /L:2 mcb_view UMBs not linked into the MCB chain Allocation strategy: 0x00 0209 0189 0008 >SD < system 0393 0004 0008 >SC?v?< system 0398 0002 039b >?4?t?< ownedBy(COMMAND ) 039b 0165 039b >COMMAND < isPSP 0501 1370 0501 >MCB_VIEW< itsMe 1872 86cd 0000 >4u?T?~< unused 9f40 282e 0008 >SC < system c76f 0059 039b > < env(COMMAND ) c7c9 0008 0501 > < myEnv c7d2 0025 0000 > < unused c7f8 0001 0000 > < unused c7fa 0004 0501 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 01e0 0008 >SD < system ede3 011d 0008 >HIDDEN < system Chain to next program: 'c:\command.com' UMBs not linked into the MCB chain Allocation strategy: 0x00 0209 0189 0008 >SD < system 0393 0004 0008 >SC?v?< system 0398 0002 039b >?4?t?< ownedBy(COMMAND ) 039b 0165 039b >COMMAND < isPSP 0501 1370 0501 >MCB_VIEW< isPSP 1872 0007 187a >4u?T?~< ownedBy(command ) 187a 0159 187a >command < isPSP 19d4 0059 187a >????< env(command ) 1a2e 0005 1a34 >?؎q< myEnv 1a34 1370 1a34 >MCB_VIEW< itsMe 2da5 7193 0000 >3< unused 9f39 0001 0000 >bel ist.< unused 9f3b 0004 1a34 >kette f< mySecondaryBlocks 9f40 282e 0008 >SC < system c76f 0059 039b > < env(COMMAND ) c7c9 0008 0501 > < env(MCB_VIEW) c7d2 0027 0008 >HIDDEN < system c7fa 0004 0501 > < ownedBy(MCB_VIEW) c7ff 2402 0008 >SC < system ec02 01e0 0008 >SD < system ede3 011d 0008 >HIDDEN < system >> This is the 2nd output of the 1st MCB_VIEW when COMMAND returned UMBs not linked into the MCB chain Allocation strategy: 0x00 0209 0189 0008 >SD < system 0393 0004 0008 >SC?v?< system 0398 0002 039b >?4?t?< ownedBy(COMMAND ) 039b 0165 039b >COMMAND < isPSP 0501 1370 0501 >MCB_VIEW< itsMe 1872 0007 0000 >4u?T?~< unused 188a 0159 0000 >command < unused 19d4 0059 0000 >????< unused 1a2e 0041 0000 >?؎q< unused 1a70 84cf 0000 > < unused 9f40 282e 0008 >SC < system c76f 0059 039b > < env(COMMAND ) c7c9 0008 0501 > < myEnv c7d2 0027 0000 > < unused c7fa 0004 0501 > < mySecondaryBlocks c7ff 2402 0008 >SC < system ec02 01e0 0008 >SD < system ede3 011d 0000 > < unused ================================================ FILE: docs/localize.txt ================================================ How to localize FreeCOM -- 2000/08/16 ska Currently FreeCOM contains only one point, where it can be "localized" aka made ready for national languages other than English, --> the strings. The strings can be prepared for each language separately, prepared for FreeCOM, added to FreeCOM and at an instant FreeCOM speaks the new language to its user. Note: The Critical Error handler can be localized during compilation of the CRITER module only, currently. == The basics FreeCOM references all strings by a number (see the "Current implementation" section), however, because it's hard to remember plenty of numbers even for programmers, in FreeCOM these numbers are hidden by C-macros. The association between the numbers and their names is #include'ed from the file STRINGS.H. So when FreeCOM wants to display a certain string, it uses for instance: display_string(TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, filename); The "TEXT_ERROR_LONG_LINE_BATCHFILE" is a C-macro defined in the header file "STRINGS.H", whereas "linenr" and "filename" are some normal C variables. This particular call should display something like this: Line #%ld in batchfile '%s' too long.\n So, FreeCOM knows how to reference to a particular string by its symbolical name, FreeCOM also needs to know how to retreive the actual string. The file STRINGS.DAT contains all these strings and a little control area that allows to easily map a string's number into its data, thus in the example above, to map TEXT_ERROR_LONG_LINE_BATCHFILE into "Line #%ld in batchfile '%s' too long.\n" Once this line has been retreived and loaded into memory, it is displayed like with a printf()-style function, so above display_string() call is at the end equal to: printf("Line #%ld in batchfile '%s' too long.\n", linenr, filename); Both files STRINGS.H and STRINGS.DAT are created by the utility named FIXSTRS included in the FreeCOM distribution in subdirectory STRINGS. Because FreeCOM is a COMMAND.COM replacement it must come as a single file. Therefore the FreeCOM executable and STRINGS.DAT are merged together in such way that wherever FreeCOM is located, STRINGS.DAT is present, too, but it does not add to the size of FreeCOM, when loaded into memory. == The generation of STRINGS.H and STRINGS.DAT The following interesting files are located in the subdirectory STRINGS: FIXSTRS.C - The source of FIXSTRS.EXE FIXSTRS.EXE - The utility to create STRINGS.H and STRINGS.DAT DEFAULT.LNG - A very important source file for FIXSTRS.EXE *.LNG - Local language definition files (see below) To create both files one must invoke: C> FIXSTRS.EXE language where "language" is to be replaced by the actual language to create the files for, e.g.: FIXSTRS SPANISH will create the Spanish strings for FreeCOM. The syntax of all *.LNG files, including DEFAULT.LNG, is identical and is described in DEFAULT.LNG. These files actually define what strings FIXSTRS shall include into STRINGS.DAT associated with a particular name, e.g.i the following 4 (four) lines: :TEXT_ERROR_LONG_LINE_BATCHFILE Line #%ld in batchfile '%s' too long. . define above mentioned error message string. The single dot in line #4 specify that there is a final newline character at the string, thus, it's "Line #%ld in batchfile '%s' too long.\n" rather than just "Line #%ld in batchfile '%s' too long." as when the last line contains a single comma. Because the localization process shall NOT include to re-compile or re-link FreeCOM, the numbers (hidden by the C-macro names) FreeCOM uses internally and the numbers the strings have within a STRINGS.DAT file _must_ be the same. And here is where the "very important" part of DEFAULT.LNG comes in: FIXSTRS does not only read the local LNG file for the particular language, but first DEFAULT.LNG, too! In the first step DEFAULT.LNG is imported. Doing so all strings defined in there are associated with continueous numbers. Then in a second step the local LNG file is imported, although overwriting strings already defined within DEFAULT.LNG, but the original order of the strings is retained. Because _all_ LNG files will first read DEFAULT.LNG, all strings defined in DEFAULT.LNG will be associated with the same number independed on the order these strings have in the local LNG file or whether or not they are defined there at all. As a sideeffect, all strings not defined in the local LNG file are copied from DEFAULT.LNG. Doing so will help to keep up with the development process of FreeCOM, although it will not cleanly speak the same language. == Short description to create a local LNG file anew Copy DEFAULT.LNG to language.LNG, where "language" is the best 8-character string describing the target language, and translate. Then proceed to section "Short description to maintain a present LNG file". == Short description to maintain a present LNG file Run: C> FIXSTRS language On success _three_ files have been created: STRINGS.H - the #include file for FreeCOM STRINGS.DAT - the binary strings data file STRINGS.LOG - the error/mismatch log file The latter one STRINGS.LOG will contain mismatches found between the LNG file and DEFAULT.LNG, there are listed the string's name and if 1) the string is missing from the LNG file or 2) is no real resource (aka is not present in DEFAULT.LNG). When no STRINGS.LOG file has been created by FIXSTRS, there either was a fatal error or no mismatch was found. In case #1 copy over the string from DEFAULT.LNG into the local LNG file and translate it. In case #2 you can savely remove the string, or you might leave it in there, if you think it will be used in future, though, it will add to the overall size of FreeCOM. Once you are happy with your strings run: C> COPY /B COMMAND.CLN + STRINGS.DAT COMMAND.COM On success run FreeCOM by invoking: C> COMMAND.COM and test it. When you are completely happy with your local LNG file, mail it to the current maintainer of FreeCOM (see UPLOAD.TXT). == Current implementation There are still plenty of strings hardcoded within FreeCOM, especially the response keys. So: 1) do not translate the response keys, or 2) help to find all these hardcoded strings and replace them with dynamically loadable strings. ================================================ FILE: docs/module.txt ================================================ Description of Modules Used Within FreeCOM -- 2000/07/15 ska The information of this document is obsolte! FreeCOM uses some kind of free-standing pieces of code that perform some low-level functions and are shared among all copies of FreeCOM currently loaded into memory. These modules are plain memory images typically less than 64KB and are loaded into their own block of memory. Because their useage is no furtherly predefined and they do not necessarily hook any interrupts or such they are tagged by magic number and actively searched by any program that needs to find them. When loaded a module is just a block of memory, but owned by the system. The tag is located within their MCB, within the lower eight bytes. FreeCOM uses the tags "FCOM_###", where the "###" identifies the module, e.g. ERR is the Critical Error handler. To find such module a program must work the MCB chain and search the lower part of the MCB for the tag. To do this, the mcb_forAll() enumerator of the SUPPL library is used. When a module is removed from memory, the underscore is changed into a dash in order to leave the knowledge behind that the module existed there some time, but invalidate it for module searches. To load a module the DOS API is used in order to guarranty that really a new MCB is created and the necessary changes to the MCB are made. To unload a module the changes are reversed and the block memory removed. The communication between a module and the copies of FreeCOM sharing the module among them will be accomplished by a far pointer that points to the data required by the module, but generated by or for a particular copy of FreeCOM. This pointer is located at the very beginning of the module, thus, the four bytes at MK_FP(segment_of_module, 0) This pointer references a structure containing all necessary data fields. In FreeCOM modules are stored as resources, appended to the executable and, therefore, can be easily located and loaded into memory. ==== Example: The Critical Error handler Its resource ID is major: 0x01. The "structure" used to pass data between the module and the copy of FreeCOM just contains a flag, whether or not AutoFail is active. Because during the run of some programs new copies of FreeCOM could be spawned, they search the MCB chain for the already loaded module and overwrite the pointer with their own, then the current INT-24 handler is overwritten by the address of the module. On termination they restore the previous pointer. ==== Problems with this implementation: P1: Invalid pointers This scenario assumes that no copy of FreeCOM dies before restoring the previous pointer and that no third copy is spawned asynchroneously, which does _not_ terminate before the second copy terminates. I don't know if there is a solution for the second case in DOS at all, but the first one can seriously trash the system and may come up especially during the early implementation days quite often. One possible solution is to rely on already available mechanism of DOS, though, they might not exist for all specific modules. The algorithm DOS handles the Critical Error handler is as follows: On creation of a process the current INT-24 handler is saved into a field of the PSP of the process. On run-time the process can overwrite the INT-24 handler with its own, but is not required to restore the previous handler, because on termination of the process the saved copy of INT-24 is restored automatically. This mechanism could be used to overcome above problem by this: Each copy FreeCOM contains a stub that hooks INT-24, loads some registers with a pointer to the module and jumps into the shared code. That way the pointer that identifies which context to process is indirectly part of the actual INT-24 pointer, which, as shown above, is stabilized by DOS mechanisms. That way a valid INT-24 automatically implies a valid context pointer. ================================================ FILE: docs/notes.txt ================================================ Notes from contributors.... Notes from Hans B Pufal : Here is my package of changes to COMMAND, my coding was based on version 74B, but I downloaded version 74D and modified my files accordingly. I use BC 4.5 and had some problems with the makefile, it was generating a .COM file of 102Kb!. I have included my modified makefile for your reference. For the files I have modified, I have reformatted them to my style (sorry). Take a look and see if you can live with it. I find that procedure headers are easier to find and that putting the history in reverse order helps quickly find the latest changes. File Description batch.c A new version, implements CALL, ECHO, GOT, IF, PAUSE, SHIFT and BEEP. There is a stub for FOR but that's all. cmdtable.c New file to keep the internal command table. I plan on getting rid of the table real soon now and replacing it with a dynamic mechanism. command.c A new (improved ;) version. Conforms closely to MS-DOS specs. Cleaned up (and fixed) the redirection handler. command.h Your version D with changes. Look for the HBP tag. makefile My version of the makefile, for BC 4.5. Sorry don't use the IDE so could not make a .prj file. notes.txt This file... redir.c Modified file, now supports append redirects. where.c Modified, made it a little safer and quicker... The test subdirectory has some batch file tests. I run T.BAT which uses runs the test and sends output to a file. The tests are run twice once for a COMMAND.COM on the patch (presumably ours) and once with C:\COMMAND.COM, presumed to be the MSDOS version. Compare the outputs in MSDOS.OUT and FDOS.OUT to look for any problems. That's about it, ask if you have any questions. Regards, Hans ----------------------------------------------------------------------------- 10-Aug-1998 0.75b Steffen Kaiser + Corrected ^Break handling in batch.c Try something like this: ===== File batch1.bat @echo off echo Hi Batch1.bat echo Hi Batch1.bat ===== File batch2.bat @echo off :loop call batch1.bat goto loop ===== The press ^Break or ^C. Most of the time you are asked to terminate BATCH1.BAT (Y/N/A), if you press 'Y', you only terminate BATCH1, but BATCH2 continue. But if you press 'A' (or ^C), even BATCH2 is terminated. + added modifyable batch scripts (following the standard) + bug: nested comments in old split() + bug: DEL memory allocation + added ^Break checks to cmd_type(), cmd_dir() + added: chkCBreak(0) [aka "cbreak"] is a generic form that autodetects if currently a batchfile is active and displays the batchfile prompt, if so. The batchfile prompt now displays the name of the batchfile. + echo off on command line --> frozen computer + The initialization code init() is still broken (included in my last patch). + In init() the errorlevel of the processed command is returned. This is a nice feature, however, MS COMMAND returns '0' to indicate a successful run of COMMAND itself. It's non-standard, offer an option. + fixed DEL char **arg allocation --> allocating a dynamic memory area for each arg[] element, however, split() simply overwrites them and they are no dynamic pointers for their own. + The DEL access()/stat() stuff is still broken (included in my last buglist report) + The find_which() is still broken as it searches through PATH prior testing all extensions within one directory. + Someone removed the ^Break catcher. It makes not much sense to incorporate ^Break checks, but running without a ^C catcher. Therefore I have re-added the catcher, this time using signals (the DOS emulation of them, however). ----------------------------------------------------------------------------- COPY.TXT Rob Lake Aug-19-98 Notes: o Crashes when returning from cmd_copy. Works fine on its own (see mod_copy.zip). I can't figure out why myself. I think that there is a memory allocation problem somewhere. Hopefully someone more experienced can track it down. o I named the module version of copy `cp' to resolve possible abiguity of naming it copy. o I don't remember exactly what time I started writing, so I figured around Aug 1. o Although the program accepts the /Y or /-Y switches, it does not do anything with them, yet. o The default mode for copying is BINARY o Specify /a before or after the destination file, if one is given, will append the destination with a ^Z character. Place appropriate warning here. Ex. These commands will add the ^Z character: cp "/a cp.com cp.txt" cp "cp.com + /a cp.obj cp.txt" cp "cp.com /a cp.txt" cp "cp.com cp.txt /a" o You can define the mode for all files in the command line. Ex. cp "/b cp.com + /a copy.c + /a copy.obj /b cp.txt" works (for whatever reason someone would want to do that:-). o The following commands where tested with the module copy: cp c:\autoexec.bat cp "c:\autoexec.bat test.bat" cp "..\ temp" - Given that ..\ has files. If temp is a directory, will copy all files to it. If temp is a file or does not exist, all the files with be copied to .\temp. NOTE: Appended to temp, not over written each time. cp "cp.com test.com" cp "/a cp.com cp.txt" cp "file1+file2+file3 file4" - Will ask to overwrite file4 after file1 has been copied. This will be fixed later. cp "file5+file1+file2+file3" - This appends file1, file2 and file3 to file5. Will ask to overwrite file5 when file2 has been copied, if file5 does not exist. Will be fixed later. - MS-DOS copy doesn't create file5 if it does not exist. It concatenates all to file1, it should print an error message. This copy creates a file5 if one does not exist. This can be changed later. o This command doesn't work yet: cp "*.c+*.h *.txt" - If tried, will print "NOT IMPLEMENTED YET" message. This command may be kind of confusing. Take for example you have a directory with these files: file1.c file1.h file2.c file2.h The command above will copy file1.c and file1.h to file1.txt and file2.c and file2.h to file2.txt. If, say, file1.h does not exist, copy will produce the messages: FILE1.C FILE1.H File not found - FILE1.H Invalid handle - FILE1.TXT 0 file(s) copied ----------------------------------------------------------------------------- ================================================ FILE: docs/piping.txt ================================================ Piping -- 2000/08/16 ska Piping, e.g. "cmd1 | cmd2", is actually spawned as: 1 SET some_internal_variable=%TEMP%\non-existant-file 2 cmd1 >%some_internal_variable% 3 cmd2 <%some_internal_variable% 4 DEL %some_internal_variable% The original implementation failed because the file was left open for writing in statement 2 before the temporary file was tried to be opened for reading in statement 3. This served to deny accidential deletation of the temporary file, but could fail, esp. if SHARE is not loaded. The new implementation really behaves as shown above and closes the file during to step from statement 2 to 3. At exactly this time the file is no longer protected by the system to be removed or opened by another process, thus, blocking the operation of FreeCOM to re-open the file for statement 3. To open the temporary file in read-write mode -- which means that the file need not to be re-opened for statement #3 -- would open the Potential Problem that cmd1 or cmd2 could "work" with the temporary file, but the ">" stream is entitled to be a write-only and "<" a read-only stream. For now the possibility that the temporary file is removed seems to be less than the other, so the lesser devil was choosen to be implemented. ================================================ FILE: docs/pt_br/config.h ================================================ /* * config.h - Usado para configurar o que ser compilado para interpretador. * */ /* Defina DEBUG para adicionar cdigo de add depurao */ #ifndef DEBUG /* possivelmente j definido via linha de comando */ //#define DEBUG #endif /* Defina para ativar o comando alias, e atalhos. */ #define FEATURE_ALIASES #define ALIAS_DEFAULT_SIZE 1024 /* Defina para ativar entrada de dados avanada (pre-requisito de Histrico e complementao nome de arquivo */ #define FEATURE_ENHANCED_INPUT /* Defina ativar histrico(DOSKEY); requer: Entrada de dados avanada */ #define FEATURE_HISTORY #define HISTORY_DEFAULT_SIZE 256 /* Defina para ativar complementao de nome de arquivo; requer: Entrada de dados avanada */ #define FEATURE_FILENAME_COMPLETION /* Defina para ativar para carregar menssagens na memoria */ #define FEATURE_LOAD_MESSAGES /* Defina para ativar DOS NLS */ #define FEATURE_NLS /* Defina para ativar teste das teclas F5/F8 na inicializao se /P estiver presente na linha de comando */ /* #define FEATURE_BOOT_KEYS */ /* LOG de caractersticas da linha de comando */ /* #define FEATURE_CALL_LOGGING */ /* Preserva o ltimo diretorio (CD, CHDIR, CDD, PUSHD, POPD); "CD -" l est chdir */ #define FEATURE_LAST_DIR /* Ativa o suporte para instalao de extenes de COMANDO (MUX-AE) */ #define FEATURE_INSTALLABLE_COMMANDS /* Nome do executvel */ #define COM_NAME "COMMAND.COM" /* Nome padro do AUTOEXEC.BAT */ #define AUTO_EXEC "\\autoexec.bat" /* Arquivo de LOG para registrar algumas caracteristicas; PRECISA estar altamente-qualificado! */ #define LOG_FILE "C:\\FreeCom.log" /* Define o numero de loops quando redirecionar para o CON se o interpretados ficar em um loop - "hangForEver()" - para sempre No defina para remover esta caracterstica */ #define FEATURE_AUTO_REDIRECT_TO_CON 5 /* Quantos arquivo de lote devem ser aninhados minimamente */ #define BATCH_NESTLEVEL_MIN 5 /* Defina para adicionar suporte ao swapout do FreeCOM see DOCS\K-SWAP.TXT */ #define FEATURE_KERNEL_SWAP_SHELL /* Defina para adicionar suportr para troca XMS-only do FreeCOM Est definio incompatvel com a definio acima. */ /* #define FEATURE_XMS_SWAP */ /* Define o tamanho do buffer usado para guardar todos os caminhos antigos para o PUSHD/POPD */ #define DIRSTACK_DEFAULT_SIZE 256 /* Use isto se um programa externo foi terminado por ^C or ^Break */ #define CBREAK_ERRORLEVEL 3 /* Use este modos_de_arquivos enquanto localizando por complementao do arquivo */ #define FILE_SEARCH_MODE FA_RDONLY | FA_ARCH | FA_DIREC /* Configurao de menssagens padro: PATTERN: como a string construida pelo ID (com \n) OUTOFMEMORY: string para informar uma condio de falta-de-memria(no \n) ID_: O ID do erro quando no h modelo padro para ser criado, mas a string de falta-de-memoria for mostrada */ #define MSG_DFL_PATTERN "String #%u\n" #define MSG_DFL_OUTOFMEMORY "Falta de memoria!" #define MSG_ERR_ID_OUTOFMEMORY TEXT_ERROR_OUT_OF_MEMORY /* Prompt padro */ #define DEFAULT_PROMPT "$P$G" /* Prove o maior tamanho que o contexto pode ter */ #define CONTEXT_MAX_SIZE (65535U - 12) /* Defina este valor para selecionar o valor de FDDEBUG para a inicializao */ #define FDDEBUG_INIT_VALUE 1 #define INCLUDE_CMD_BEEP #define INCLUDE_CMD_BREAK #define INCLUDE_CMD_CHDIR #define INCLUDE_CMD_CDD #define INCLUDE_CMD_CLS #define INCLUDE_CMD_COPY #define INCLUDE_CMD_CTTY #define INCLUDE_CMD_DATE #define INCLUDE_CMD_DEL #define INCLUDE_CMD_DIR #define INCLUDE_CMD_DIRS #define INCLUDE_CMD_LOADFIX #define INCLUDE_CMD_LOADHIGH #define INCLUDE_CMD_MEMORY #define INCLUDE_CMD_MKDIR #define INCLUDE_CMD_PATH #define INCLUDE_CMD_PAUSE #define INCLUDE_CMD_PROMPT #define INCLUDE_CMD_PUSHD #define INCLUDE_CMD_POPD #define INCLUDE_CMD_REM #define INCLUDE_CMD_RENAME #define INCLUDE_CMD_RMDIR #define INCLUDE_CMD_SET #define INCLUDE_CMD_TIME #define INCLUDE_CMD_TRUENAME #define INCLUDE_CMD_TYPE #define INCLUDE_CMD_VER #define INCLUDE_CMD_VERIFY #define INCLUDE_CMD_VOL #define INCLUDE_CMD_QUESTION #define INCLUDE_CMD_WHICH #ifdef DEBUG #define INCLUDE_CMD_FDDEBUG #endif /* comando que no tem uma definio: exit call echo goto for if shift */ /******** ***** Desfazer dependencias ***** No mude a no ser que mude o fonte apropriado! ************/ #if defined(INCLUDE_CMD_PUSHD) || defined(INCLUDE_CMD_POPD) #define INCLUDE_CMD_CDD #endif /* No disponvel com TURBOC++ 1.0 ou posteriores: */ #ifdef __TURBOC__ #if __TURBOC__ > 0x297 #define _TC_LATER_ #else #define _TC_EARLY_ #endif #endif /* Define se seu compilador no tem 'dosdate_t' or 'dostime_t' */ #ifdef _TC_EARLY_ /* TC++1 */ #define _NO__DOS_DATE #define _NO__DOS_TIME #define _NO_FMEMCHR #define _NO_FMEMCMP #endif /* definido por MKDIST.BAT */ #ifdef IGNORE_ENHANCED_INPUT #undef FEATURE_ENHANCED_INPUT #endif #ifndef FEATURE_ENHANCED_INPUT #undef FEATURE_HISTORY #undef FEATURE_FILENAME_COMPLETION #endif #ifdef INCLUDE_CMD_PUSHD #define FEATURE_DIRSTACK #endif #if CONTEXT_MAX_SIZE > 65535U - 12 #error "O tamanho do contexto mximo no pode exeder 65535 - 12 bytes" #endif #if defined(FEATURE_KERNEL_SWAP_SHELL) && defined(FEATURE_XMS_SWAP) #error "FreeCOM no pode suportar ambos o Kernel- e XMS-based swapping simultaneamente #endif /* Externamente definida para compilar com suporte a XMS-Swap */ #if defined(XMS_SWAP) #undef FEATURE_KERNEL_SWAP_SHELL #define FEATURE_XMS_SWAP #endif #ifdef __TURBOC__ #if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) /* Compilando em modelo de memria larga --> deslisga AVISO: "Conveso pode perder digitos significantes" */ #pragma warn -sig #endif #endif #include "../include/debug.h" ================================================ FILE: docs/pt_br/config.mak ================================================ ## Diretrio base do Turbo C++ v1.01 CC_BASE_PATH = D:\TC101 ## Onde os arquivo SUPPL(suplementares) pre-compilados esto ## Veja DOCS\SUPPL.TXT para informaes sobre ela SUPPL_INC_PATH = .\SUPPL SUPPL_LIB_PATH = $(SUPPL_INC_PATH) ## Localizao dos programas BINPATH = $(CC_BASE_PATH)\BIN LIBPATH = $(CC_BASE_PATH)\LIB INCLUDEPATH = $(CC_BASE_PATH)\INCLUDE;$(SUPPL_INC_PATH) ## Que programas usar CC = $(BINPATH)\TCC +$(CFG) AR = $(BINPATH)\Tlib LD = $(BINPATH)\Tlink NASM = nasm.exe ## Adicione -DDEBUG=1 a seguir para ativar o suporte a depurao para arquivos assembly NASMFLAGS = ## Adicione -DDEBUG=1 a seguir para ativar o suporte a depurao para arquivos C ## Adicione -DNDEBUG=1 a seguir para desativar qualquer suporte a depurao CFLAGS = ## Modelo de memoria do FreeCOM SHELL_MMODEL=s !if $(XMS_SWAP) __XMS_SWAP = -DXMS_SWAP=1 !endif # Configurao padro # adicionado strings.h aqui por que $(CFG) j est incluido em tudo ## Adicione -D_NO__DOS_DATE se seu compilador no tem o dosdate_t (*) ## Adicione -D_NO__DOS_TIME se seu compilador no tem o dostime_t (*) ## Adicione -D_NO_FMEMCHR se seu compilador no tem o _fmemchr() (*) ## Adicione -D_NO_FMEMCMP se seu compilador no tem o _fmemcmp() (*) ## ## (*) Nota: Deve ser detectado pelo CONFIG.H automaticamente pelo Turbo C ## e compiladores Borland C. ## $(CFG): $(CFG_DEPENDENCIES) copy &&| -1- -a -f- -ff- -K -w+ -O -Z -b- -I$(INCLUDEPATH) -L$(LIBPATH) -m$(SHELL_MMODEL) -DNDEBUG -UDEBUG $(__XMS_SWAP) | $(CFG) #-k- # *Regras Implicitas* .c.exe: $(CC) $< .c.obj: $(CC) -c {$< } .asm.obj: $(NASM) $(NASMFLAGS) -f obj -DMODEL=$(SHELL_MMODEL) $< ================================================ FILE: docs/pt_br/download.txt ================================================ Voc pode fazer o download de variantes pre-compiladas do FreeCOM de: https://github.com/FDOS/freecom outros lugares para o download so mostrados em: binary.zip: o ltimo FreeCOM, apenas Binrios plainedt.zip: o ltimo FreeCOM sem os melhoramentos de edio de linha de comando (histria, arquivo de reclamaes) debug.zip: o ltimo FreeCOM com informaes de debug ativadas localize.zip: Pacote para desenvolvedores para linguagens (para criar um novo ou alterar arquivo *.LNG existentes), incluie o ltimo FreeCOM ================================================ FILE: docs/pt_br/file_id.diz ================================================ Este interpretados de comandos do FreeDOS(command.com). Para saber informaes sobre a ltima verso visite: http://wiki.freedos.org/wiki/index.php/FreeCOM Veja LICENSE para informaes sobre licensa. ================================================ FILE: docs/pt_br/readme ================================================ Cdigo fonte para distribuio do FreeCOM - um programa de interface de linha de comando, que substitue o COMMAND.COM Os fontes esto em: http://sourceforge.net/project/?group_id=5109 CHANGED Mudanas desde a ltima verso oficial DOCS\COMPILE.TXT Como compilar o FreeCOM ================================================ FILE: docs/ptchldrv.txt ================================================ Start logging feature 2000/01/05 ska This feature logs, if compiled in, the command line into a file, whenever FreeCom is started. This feature shall help to identify calling problems with by default invalid command lines, but supported (or ignored) by other COMMAND.COM's. The logfile can be used for other logging purposes later, too. The logfile is specified as an hard-coded fully-qualified filename within CONFIG.H, see the macro LOG_FILE. This is necessary that all entries are collected into the same file and at various times some log entries will be written the actual location of FreeCom.COM itself is not known. Therefore the path of the logfile cannot be derived from the location of the executable. In order to change the drive the logfile is created on without the need to re-compile FreeCom, the utility PTCHLDRV (== PaTCH Logging DRiVe) is provided. To view the current drive just run "PTCHLDRV"; to change the drive specify it on command line, e.g.: "PTCHLDRV A". ================================================ FILE: docs/resource.txt ================================================ Description of layout of COMMAND.COM image -- 2000/07/11 ska General layout: + start of file at file offset 0 + COMMAND.EXE : This is the product of the actual MAKE run or however the FreeCOM executable was generated. Usually this is in EXE format + some compiler/linker depend stuff, e.g. debug information + any number of modularized resources (see below) + end of file at topmost offset Resources: Til now only one type of resource was known to FreeCOM, though, due to the introduction of the external Critical Error handler a second one showed up. Therefore it was time to re-organize the way resources are attached to FreeCOM. Purpose of resources: Resources are information of any kind not included into the program image of FreeCOM. In order to access them they must be manually handled by FreeCOM. Examples: + Strings (already known since some releases) [data], + Critical Error handler [mixture of data and code]. Problems to cope with: + FreeCOM should come as a single physically file, that means that all information must be "archived" together one way or another, but the result must be an executable file, which invokes a new copy of the command line interface by default. + The more complex the make process is the more problems will show up and the more possible contributers will be intimidated. Therefore the resources shall be as free-standing as possible and easily archived together, but still easily accessable from with FreeCOM. Design of resources: Each resource contructs its own block of data in this format: + lowest file offset + data of resource [unlimited] + size of "data" portion [4 bytes] + major resource ID [2 bytes] + minor resource ID [2 bytes] + cookie [8 bytes] + highest file offset The latter 4 entries form the control area of the resource indicating: + how much data is included with this resource; + what type of resource it is via the resource ID, however, only the major resource ID is considered by the general resource locator, the minor ID is reserved for use by the loader specialized for the particular resource only; and + the cookie provides a validation mechanism like the magic number system. This cookie is the same for all resources throughout FreeCOM and all control areas with a valid cookies are considered valid themselves. To place the control area at the end of the resource has one fundamental disadvantage and one fundamental advantage: con: It is less efficient than placing it in front of the data, because files are read sequentially from beginning to the end most efficiently. pro: Those resources can be created individually into individual files. To create the desired "archive" the only thing to do is to append one by another to FreeCOM's executable. Now the process to locate the resource from inside FreeCOM arises: If the control area would be located at the beginning of the resource, there is no fixed way to seek to it, but because the controls are located behind the data at the end and because resources are appended to the executable, the control area of the last resources resides at the end of the file. This place is easy to seek to. And because the control area knows the length of the data of the current resource, it can seek before to the preceeding resource, if any. In opposite, to locate a control area at the beginning would require some algorithm to find the first resource located _somewhere_within_ the file. The current implementation used some fields of the EXE header describing how much code/data the executable allocates. Unfortunately .COM files do not include this information and some compilers may append own information there, e.g. debug information. One would need sort of management program that keeps track of where the first resource is located within the executable and writes this information at a well-known location, e.g. at the end of the file. The message library MSGLIB includes such program, but although it is nearly required there, it adds a remarkable step to the complexity of the process to create a final program file. Assignments: Cookie: "FREECOM " Major resource IDs (hexadecimal): 00: Strings 01: Critial Error handler Minor resource IDs (hexadecimal): 00:**: none particular, used for version control 01:00: code of the Critical Error handler 01:01: strings used by the handler 01:02: already merged code and strings of the handler as one resource 01:10: code of the "autofail" variant of the handler 01:11: strings used by the "autofail" handler 01:12: already merged code and strings of the "autofail" handler ================================================ FILE: docs/todo.txt ================================================ Things to do ~~~~~~~~~~~~ (#) is the suggested priority, the lower the more urgent. (0) Fix bugs :) (2) Ensure the documentation matches current implementation. (3) Optimize the code! For size and speed. There are numerous places where the code is hardly optimal for either. (1) Swap out when exec'ing? YES! Unless running from a floppy? (1) Add wildcard support to REN. (4) Add support for Win95 long filenames. (1) Make the permanent command.com (/p) store the messages in memory (this is already implemented) and have some way for other instances of command.com to use these same messages in memory. Maybe the Multiplexer interrupt (2Fh)? Does command.com have a MSDOS reserved mux handler number? (1) Critical Error handler: Conditions and rules must be defined in which cases what action has to be done in order to prevent accidently kill FreeCOM on INT-24. Some recover mechanism must be implemented in hopeless situations, where the normal processing can not proceed. (2) Use all information available through DOS NLS API in all places they apply to. ================================================ FILE: docs/upload.txt ================================================ (this file is now obsolete, please submit changes as patches to FreeDOS mailing list or as Pull Request via GitHub) How to contribute to the FreeCOM project -- 2000/12/10 Steffen Kaiser (ska) 0. General 1. Patches 2. Addresses === 0. General The maintainer(s) of FreeCOM can be reached by: a) E-Mail: freecom@freedos.org, b) mailling list: freedos-freecom@lists.sourceforge.net, and c) bug report form: http://www.freedos.org/bugs. Bug reports should be entered into the bug tracking database using the bug report form, though, on urgency it might be a good idea to post to the mailling list as well. Any comments regarding implementation details, questions etc. should be directed to the mailling list. Patches should NOT be send to the mailling list, but to the maintainer, see section "Patches". === 1. Patches Smaller patches, say smaller than 30KB in compressed form, may be sent to the maintainer by E-Mail. For larger patches please request a FTP access, where to upload the patch to, or put the patch onto a WWW or FTP space and mail the location to the maintainer. Most often you can make the patches remarkable smaller by using the "diff" utility; a GNU port is to be found on every SimTel(.Net) mirror out there. Just run this command **): diff -dsbBU 5 old_file new_file >patch -or- diff -dsbBNrU 5 old_freecom_dir new_freecom_dir >patch The file "patch" will contain the "patch". In the second form (diff'ing the complete file tree) if you added some new files, you don't want to submit within your patch, you could revise the patch file and delete any such entries or pass the option "-X ignore" to "diff" and create the file "ignore" with one file to be ignored per line, they may contain wildcards. Please add an info file describing the patch with a few words. Doing so will make the life easier for the maintainer, if the mail and the file gets separated. Then compress the file, e.g. using Info-Zip: zip -9 patch.zip patch info.txt Once the patch has been incorporated into FreeCOM your name and the description of the patch will be added to the DOCS\HISTORY.TXT file. **) The meaning of the options used: -d Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower). -s Report when two files are the same. -b Ignore changes in amount of white space. -B Ignore changes that just insert or delete blank lines. -N In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory. -r When comparing directories, recursively compare any subdirectories found. -U 5 Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context. === 2. Addresses Maintainer of FreeCOM: freecom@freedos.org ================================================ FILE: docs/vspawn.txt ================================================ Swap Support #2 -- 2001/04/01 ska This style of swapping is incompatible with XMS-Only swapping! This swapping is derived from KSSF (see k-swap.txt), but instead of let the user decide what shell to execute, this swap faker uses a fixed filename. Useage: VSPAWN [{ argument }] VSpawn creates the filename of the shell to execute itself by replacing its own file extension by .SWP. All the arguments are passed to the invoked shell unchanged. Most useful installation: Make COMMAND.COM and TOOLS\VPSAWN.COM by running BUILD.BAT. Rename COMMAND.COM into COMMAND.SWP. Move TOOLS\VPSAWN.COM to COMMAND.COM. Run COMMAND.COM. VSpawn automatically invokes COMMAND.SWP; COMMAND.SWP determines that it has been invoked using the VSpawn feature and will maintain %COMSPEC%==*.COM, but will use *.SWP as resource file. Because the COMSPEC variable contains the *.COM filename, which is the VSpawn wrapper, all subsequent invocations of a secondary shell will use the VSpawn wrapper as well. === If FreeCOM detects the VSpawn feature beeing used, it defaults to swap when executing external commands. This can be suppressed by invoking external commands by: CALL /N prg or passing the option /SWAP to FreeCOM. If auto-swap is not active, /SWAP enables it. ================================================ FILE: err_fcts.h ================================================ void error_env(int base, int err_no, const char * const var); void error_invalid_switch(char c); void error_invalid_lswitch(const char * const str); void error_too_many_parameters(const char * const s); void error_path_not_found(void); void error_file_not_found(void); void error_sfile_not_found(const char * const f); void error_req_param_missing(void); void error_bad_command(const char * const f); void error_no_pipe(void); void error_out_of_memory(void); void error_syntax(const char * const s); void error_nothin_to_do(void); void error_selfcopy(const char * const s); void error_long_batchline(const char * const fnam, long linenr); void error_bfile_vanished(const char * const fnam); void error_bfile_no_such_label(const char * const fnam, const char * const label); void error_invalid_time(void); void error_env_var(const char * const var); void error_env_var_not_found(const char * const var); void error_filename_too_long(const char * const fname); void error_command_too_long(void); void error_line_too_long(void); void error_tempfile(void); void error_close_quote(int quote); void error_illformed_option(const char * const s); void error_opt_arg(const char * const str); void error_opt_noarg(const char * const str); void error_leading_plus(void); void error_trailing_plus(void); void error_open_file(const char * const fnam); void error_read_file(const char * const fnam); void error_write_file(const char * const fnam); void error_write_file_disc_full(const char * const fnam, const unsigned long size); void error_copy(void); void error_nothing_to_do(void); void error_invalid_number(const char * const s); void error_init_fully_qualified(const char * const s); void error_corrupt_command_line(void); void error_quoted_c_k(void); void error_ctty_excluded(void); void error_l_notimplemented(void); void error_u_notimplemented(void); void error_restore_session(void); void error_save_session(void); void error_no_rw_device(const char * const devname); void error_ctty_dup(const char * const devname); void error_no_cwd(int drive); void error_kswap_alias_size(void); void error_kswap_allocmem(void); void error_if_exist(void); void error_if_errorlevel(void); void error_if_errorlevel_number(void); void error_if_command(void); void error_alias_out_of_memory(void); void error_alias_insert(void); void error_alias_no_such(const char * const name); void error_loading_context(void); void error_dirfct_failed(const char * const fctname, const char * const dirname); void error_no_alias_name(const char name[]); void error_history_size(const char s[]); void error_context_out_of_memory(void); void error_no_context_after_swap(void); void error_out_of_dos_memory(void); void error_context_length(unsigned long islen, unsigned maxlen); void error_context_add_status(void); void error_empty_redirection(void); void error_redirect_from_file(const char * const fnam); void error_redirect_to_file(const char * const fnam); void error_bad_mcb_chain(void); void error_unknown(int err); void error_invalid_drive(int drive); void error_no_env(void); void error_on_off(void); void error_invalid_date(void); void error_for_bad_var(void); void error_for_in(void); void error_for_parens(void); void error_for_do(void); void error_for_no_command(void); void error_goto_label(void); void error_get_codepage(void); void error_set_codepage(void); void error_copy_plus_destination(void); void error_invalid_parameter(const char * const str); void error_fcom_is_device(const char * const fnam); void error_fcom_invalid(const char * const fnam); void error_exe_corrupt(void); ================================================ FILE: include/batch.h ================================================ /* A structure to preserve the context of a batch file */ /* Added: bfnam -- name of batchfile for modifyable scripts if bfile == NULL bpos -- position within batchfile, if bfile == NULL blinecnt -- line counter bclose -- close file if it was opened temporarily brewind -- rewind file instead of positioning to bpos blabel -- to search for if != NULL */ #include #include #define __LFNFUNCS_C #include "../include/lfnfuncs.h" struct bcontext { struct bcontext *prev; int bfile; char *bfnam; /* abs filename of batchfile */ char *bfirst; /* name of batchfile as typed on cmd line */ char *forproto; /* command to execute */ char *forvar; /* current FOR variable */ char **params; /* FOR/batch parameter list */ char *blabel; /* label to search for */ #ifdef FEATURE_LONG_FILENAMES struct lfnffblk *ffind; #else struct ffblk *ffind; /* already started FOR wildcard expand loop */ #endif long bpos; /* position within file if bfile == NULL */ long blinecnt; /* line counter */ int shiftlevel; /* number of skipped arguments */ int echo; /* Preserve echo flag across batch calls */ int bclose; /* close batch file on exit */ int brewind; /* rewind batch file next time */ int numParams; /* number of parameters */ int forFlags; /* optional flags to FOR command */ }; /* The stack of current batch contexts. * NULL when no batch is active */ extern struct bcontext *bc; void exit_batch(void); void exit_all_batch(void); extern int setBatchParams(char *s); extern struct bcontext *newBatchContext(void); /* static void initBatchContext(struct bcontext *b); */ extern struct bcontext *activeBatchContext(void); char *find_arg_bc(struct bcontext const * const b, int n); #define find_arg(num) find_arg_bc(activeBatchContext(), (num)) #define getArgCur(num) find_arg_bc(bc, (num)) /* flags used by FOR */ /* #define FLAG_HACKERY_FOR 1 */ #define FLAG_OPT_DIRECTORY 2 #define FLAG_OPT_FILEPARSE 4 #define FLAG_OPT_RECURSE 8 ================================================ FILE: include/cmdline.h ================================================ /* Declaration for the command line parsing interface */ #ifndef __CMDLINE_H #define __CMDLINE_H /* What quotes COMMAND shell honor (only paired quotes) */ /* Note: at least the double quotes MUST be included */ /* #define QUOTE_STR "\"'`" others are valid filename chars */ #define QUOTE_STR "\"" /* What characters COMMAND shall delimit arguments and options, useable w/in if() */ /* Note: Do not include the option character */ /* Also note: Do not include ',' or ';' within isoptdelim() */ #define isargdelim(ch) (isspace(ch) || iscntrl(ch) || strchr(",;=", ch)) #define isoptdelim(ch) (isspace(ch) || iscntrl(ch)) /* What option character COMMAND shell honor, used within arguments too */ #ifdef FEATURE_SWITCHAR #define isoptch(ch) (ch == switchar()) #else #define isoptch(ch) (ch == '/') #endif /* Test if an argument is an option */ #define isoption(string) isoptch(*(string)) /* String ID of helpscreen of current internal command */ extern unsigned currCmdHelpScreen; /* Trimming command line (arguments) basing on isargdelim() */ char *trimcl(char *str); char *ltrimcl(const char *str); void rtrimcl(char * const str); char switchar(void); /* * Callback function invoked when an option is scanned * * optstr := long option string * ch := single character option (upcased) or 0 if none * bool := -1: '-' found; +1: '+' found; 0: neither * strarg := NULL: no argument; else: pointer to option argument * This string must be duplicated, because it will be removed as * soon as the function returns. * * Return: * 0 (E_None): OK * else: some kind of error; error message already displayed * * Note: BC5 with optimization enabled glues sequences like: * switch(ch) { * case 'A': return optScanBool(ch, bool, arg, &optA); * case 'B': return optScanBool(ch, bool, arg, &optB); * ... * together. The generated code looks like: * case 'A': push &optA * goto callFct * case 'B': push &optB * callFct: push arg * push bool * push ch * call optScanBool * add sp, 8 * One could say that no manual optimization is needed, couldn't one? */ typedef int (* const optScanner)(const char * const optstr, int ch, int bool, const char *strarg, void * const arg); /* * Define a callback function */ #define optScanFct(name) \ static int name (const char * const optstr, int ch, int bool, const char *strarg, void * const arg) /* * Print error message "Invalid option" */ #define optErr() error_invalid_lswitch(optstr) /* * Check if a longname option matches, the argument must be in * uppercase! */ #define optLong(str) (strcmpi(optstr, (str)) == 0) char *skipqword(char *str, const char * const stop); /* Use matchtok() to compare string constants */ #define match(line,word,len) match_(&(line), (word), (len)) #define matchtok(line,word) match_(&(line), word, sizeof(word) - 1) int match_(char ** const p, const char * const word, int len); char *skip_word(char *line); char *skipdm(char *line); char *unquote(const char *str, const char * const strend); char **split(char *line, int *args); void freep(char **p); /* int isoption(char *str) Return: 0: if str is no option */ int optScanString_(const char * const optstr, int bool, const char *arg, char **value); int optScanBool_(const char * const optstr, int bool, const char *arg, int *value, int flip); int optScanInteger_(const char * const optstr, int bool, const char *arg, unsigned int *value); #define optHasArg() (strarg != 0) #define optScanString(var) \ optScanString_(optstr, bool, strarg, &(var)) #define optScanBool(var) \ optScanBool_(optstr, bool, strarg, &(var), 1) #define optScanBool2(var) \ optScanBool_(optstr, bool, strarg, &(var), 0) #define optScanInteger(var) \ optScanInteger_(optstr, bool, strarg, &(var)) int scanOption(optScanner fct, void * const ag, char *rest); int leadOptions(char **line, optScanner fct, void * const arg); char **scanCmdline(char *line, optScanner fct, void * const arg, int *argc, int *opts); #endif ================================================ FILE: include/command.h ================================================ /* COMMAND.H * header file for the modules in COMMAND.COM */ #ifndef FREECOM_COMMAND_H #define FREECOM_COMMAND_H #define MAX_INTERNAL_COMMAND_SIZE 256 #ifndef MKINFRES #include #include #include #include #include "../include/misc.h" #define LONG_CMDLINE_ENV_NAME "CMDLINE" #define MAX_EXTERNAL_COMMAND_SIZE 126 /* The maximal external command line is: 128: overall space for the command line) - 1: Pascal string length byte - 1: '\r' (at the end) = 126 Note: prior versions of FreeCOM also had a '\0' after the '\r', but per RBIL & other documents, the command line is only terminated by a '\r' (0Dh value) */ enum InternalErrorCodes { E_None = 0, E_Useage = 1, E_Other = 2, E_CBreak = 3, E_NoMem, E_CorruptMemory, E_NoOption, E_Exit, E_Ignore, /* Error that can be ignored */ E_Empty, E_Syntax, E_Range, /* Numbers out of range */ E_NoItems, E_Help, /* Help screen */ E_User /* MUST be the last one */ }; #define PROMPTVAR "PROMPT" #define PATHVAR "PATH" #define EnvSeg (*(unsigned far*)MK_FP(_psp, 0x2c)) #define OwnerPSP (*(unsigned far *)MK_FP(_psp, 0x16)) extern const char shellver[]; extern const char shellname[]; #ifndef FA_NORMAL #define FA_NORMAL 0 #endif /* Useage: FALSE: no, false etc. TRUE: yes, OK, etc. ERROR: only used in tri-state flags, in binary flags same as TRUE */ enum { FALSE, TRUE, ERROR }; /* prototypes for INIT.C */ extern void ASMINTERRUPT dummy_criter_handler(); extern void ASMINTERRUPT cbreak_handler(); extern void far cdecl terminateFreeCOMHook(void); extern void far * far termAddr; extern word far myPID; extern word far origPPID; /* extern void initCBreak(void);*/ /* prototypes for COMMAND.C */ extern int interactive_command; extern int persistentMSGs; extern int far CBreakCounter; #define ctrlBreak CBreakCounter /* extern int ctrlBreak;*/ extern int exitflag; extern unsigned int echo; /* The echo flag */ extern int tracemode; /* debug script? */ extern int autofail; #ifdef FEATURE_XMS_SWAP extern byte far canexit; #else extern int canexit; #endif extern int inInit; extern int errorlevel; extern int isSwapFile; extern int forceLow; extern unsigned far *maxx; extern unsigned char far *maxy; extern char *ComPath; /* absolute filename of COMMAND shell */ extern int oldinfd, oldoutfd; void fatal_error(char *); int is_delim(int); void command(char *); void parsecommandline(char *, int); int initialize(void); void short_version(void); int process_input(int xflg, char *cmdline); /* void perform_exec_result(int rc); */ int expandEnvVars(char *ip, char * const line); /* prototypes for INTERNAL.C */ int cmd_break(char *); int cmd_chdir(char *); int cmd_chcp(char *); int cmd_cdd(char *); int cmd_cls(char *); int cmd_copy(char *); int cmd_ctty(char *); int cmd_date(char *); int cmd_del(char *); int cmd_dir(char *); int cmd_doskey(char *); int cmd_fddebug(char *); int cmd_history(char *); int cmd_lfnfor(char *); int cmd_loadfix(char *); int cmd_loadhigh(char *); int cmd_memory(char *); int cmd_mkdir(char *); int cmd_path(char *); int cmd_prompt(char *); int cmd_rem(char *); int cmd_rename(char *); int cmd_rmdir(char *); int cmd_set(char *); int cmd_time(char *); int cmd_truename(char *); int cmd_type(char *); int cmd_ver(char *); int cmd_verify(char *); int cmd_vol(char *); int internal_exit(char *); int force_exit(char *); int cmd_pushd(char *); /*DLP 06/01/2000 */ int cmd_popd(char *); /*DLP 06/01/2000 */ int cmd_dirs(char *); /*DLP 06/01/2000 */ int cmd_which(char *); void history(int, char *); /* prototype for the command-line history */ void complete_filename(char *str, unsigned charcount); int show_completion_matches(char *str, unsigned charcount); /* prototypes from PROMPT.C */ void printprompt(void); /* prototypes for ALIAS.C */ void aliasexpand(char *, int); int aliasswapout(void); int aliasswapin(void); int cmd_alias(char *); #define D_ON "on" #define D_OFF "off" /* Flags used in CMDTABLE */ /* CMD_SPECIAL_* modify the default behaviour, which delimiters are ignored and which are passed into the internal command. ALL --> everything is passed into the cmd [ECHO only] DIR --> passed: "\\/", ignored: ",;=" without --> passed: "/", ignored: ",;=" */ #define CMD_SPECIAL_ALL 1 /* pass unmodified line into cmd */ #define CMD_SPECIAL_DIR 2 /* pass directory specific chars into cmd */ #define CMD_BATCHONLY 4 #define CMD_NO_ERRORLEVEL 8 /* command should not set errorlevel */ struct CMD { char *name; int flags; int (*func) (char *); unsigned help_id; }; extern struct CMD internalCommands[]; /* New procs in BATCH.C */ char *readbatchline(int *, char *, int); /* char *find_arg(int); */ /* The MSDOS Batch Commands [MS-DOS 5.0 User's Guide and Reference p359] */ int cmd_call(char *); int cmd_echo(char *); int cmd_for(char *); int cmd_for_hackery(char *); int cmd_goto(char *); int cmd_if(char *); int cmd_pause(char *); int cmd_shift(char *); int cmd_beep(char *); int get_redirection(char *, char **, char **, int *); int batch(char *, char *, char *); #endif #endif ================================================ FILE: include/context.h ================================================ /* $id$ Context declarations */ #ifndef CONTEXT__H_ #define CONTEXT__H_ #include #define MAX_FNAME 89 /* max size of string for one filename */ typedef word ctxt_t; /* general context type <-> segment */ #define CTXT_INVALID ((ctxt_t)0) extern ctxt_t ctxt; /* currently there is just one context -> so-called dynamic context -> all data is located in there */ /* Major IDs of context tags */ typedef enum { CTXT_TAG_ERROR = 0 /* with size restriction */ #define CTXT_FIRST_TAG CTXT_TAG_HISTORY ,CTXT_TAG_HISTORY = 2 ,CTXT_TAG_DIRSTACK ,CTXT_TAG_BATCH ,CTXT_TAG_LASTDIR ,CTXT_TAG_SWAPINFO } Context_Tag; #define CTXT_LAST_TAG CTXT_TAG_SWAPINFO /* Minor IDs of CTXT_TAG_SWAPINFO */ enum { CTXT_SWAPINFO_PRGNAME = 1 , CTXT_SWAPINFO_CMDLINE , CTXT_SWAPINFO_SHELLNAME }; #define ctxtAlias ctxt #define ctxtHistory ctxt #define ctxtBatch ctxt #define ctxtDirstack ctxt #define ctxtEnvironment 0 /* the environment is the default environment segment */ #define ctxtIsValid() (ctxt != CTXT_INVALID) typedef struct { unsigned c_sizemax, c_sizecur; /* total size of tag */ unsigned c_nummax, c_nummin; /* min/max number assigned */ } ctxt_info_t; extern ctxt_info_t ctxt_info[]; #define CTXT_TAG_ALIAS (CTXT_LAST_TAG + 1) #define CTXT_join(a,b) a##b #define CTXT_INFO_STRUCT(tag) ctxt_info[(tag) - CTXT_FIRST_TAG] #define CTXT_INFO(tag,member) CTXT_INFO_STRUCT(tag).CTXT_join(c_,member) /* #define alias_maxsize CTXT_INFO(CTXT_TAG_ALIAS, sizemax) #define hist_maxsize CTXT_INFO(CTXT_TAG_HISTORY, sizemax) #define dstack_maxsize CTXT_INFO(CTXT_TAG_DIRSTACK, sizemax) */ #define ctxtFromTag(tag) ctxt /* all tags in the same context */ #define ctxtIsInfoTag(tag) \ ((tag) >= CTXT_FIRST_TAG && (tag) <= CTXT_TAG_ALIAS) #define ctxtCheckInfoTag(tag) assert(ctxtIsInfoTag(tag)) /* probe if the item tag is of the format: = because just = is not valid as _item_, but may contain status information */ #define ctxtProbeItemTag(segm,ofs,tag) \ (peekb((segm), (ofs)) == (unsigned char)(Context_Tag)(int)(tag) \ && peekb((segm), (ofs) + 1) != '=') #define CTXT_ITEMNAME_LENGTH (sizeof(unsigned) * 2 + 2) void ctxtCreate(void); /* Create the local context */ void ctxtCreateMemBlock(unsigned length); int ctxtAddStatus(const Context_Tag tag); int ctxtPop(const Context_Tag, char ** const); int ctxtPush(const Context_Tag, const char * const); int ctxtGet(const int, const Context_Tag, const unsigned, char ** const); int ctxtSet(const Context_Tag, const unsigned, const char * const); char far*ctxtAddress(const Context_Tag tag, const unsigned num); int ctxtClear(const Context_Tag); int ctxtView(const Context_Tag, const unsigned); void ctxtRenumberItems(const Context_Tag); void ctxtMkItemName(char * const, const Context_Tag, const unsigned num); int breakVarAssign(ctxt_t context, char * const s, char ** const value); int chgCtxt(const Context_Tag tag, const char * const, const char * const); unsigned realNum(const Context_Tag tag, const int num); #endif ================================================ FILE: include/crossjmp.h ================================================ /* * Allows to longjmp through FreeCOM at abort-type error states. * */ #ifndef FREECOM_CROSSJMP_H #define FREECOM_CROSSJMP_H #include extern jmp_buf jmp_beginning; #define jmp_fatal(err) longjmp(jmp_beginning, (err)) #endif ================================================ FILE: include/cswap.h ================================================ /* CSWAP.H */ #ifdef FEATURE_XMS_SWAP #ifndef __XMS_SWAP_H #define __XMS_SWAP_H #include "../include/misc.h" #include "algnbyte.h" struct ParamDosExec { unsigned short envSeg; void far *cmdtail; void far *FCB1; void far *FCB2; void far *overlPtr1; void far *overlPtr2; }; #include "algndflt.h" extern char far dosFCB1[128]; /* must be setup correctly */ extern char far dosFCB2[128]; extern struct ParamDosExec far dosParamDosExec; extern unsigned char far dosCMDNAME[128]; /*extern unsigned char far dosCMDTAIL[128];*/ #define dosCMDTAIL ((char far*)MK_FP(_psp, 0x80)) extern int cdecl XMSexec(void); #if defined(__WATCOMC__) typedef unsigned long xmsfunc(unsigned request, unsigned dx, void *si); #pragma aux xmsfunc = __parm [__ax] [__dx] [__si] __modify [__bx __cx] extern xmsfunc far *far XMSdriverAdress; #elif defined(__GNUC__) extern unsigned far *far XMSdriverAdress; static inline unsigned long XMSrequest(unsigned request, unsigned dx, void *si) { long ret; /* N.B. the XMS driver may clobber %bx even if the call is successful, so we need to mark %bx as clobbered. Also include %cx, the flags, and main memory in the clobber list, for good measure. -- tkchia 2018/08/24 */ asm volatile("lcall *%%cs:XMSdriverAdress" : "=A"(ret) : "a"(request), "d"(dx), "S"(si), "Rds"(FP_SEG(si)) : "bx", "cx", "cc", "memory"); return ret; } #else extern unsigned (far *far XMSdriverAdress)(void); extern void far XMSrequest(void); #endif extern unsigned char far SWAPresidentEnd; /* label: end of resident code */ extern unsigned short SwapResidentSize; /* paras of the swap handler */ extern unsigned short far SwapTransientSize; /* paras of total command */ struct XMScopy{ long length; short shandle; long soffset; short dhandle; long doffset; } ; extern struct XMScopy XMSsave; extern struct XMScopy far XMSrestore; /* Handlers in resident portion for external program execution */ extern void far ASMINTERRUPT lowlevel_cbreak_handler(); extern void far ASMINTERRUPT lowlevel_err_handler(); extern void far ASMINTERRUPT autofail_err_handler(); extern void far ASMINTERRUPT lowlevel_int_2e_handler(); /* functions */ word XMSswapmessagesIn(loadStatus *status); void XMSinit(void); int XMSisactive(void); void XMSexit(void); #endif #endif ================================================ FILE: include/datefunc.h ================================================ /* DateFunc -- DOS Date Functions Copyright (C) 1998 Rob Lake This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Rob Lake can be contacted at email: rlake@cs.mun.ca */ #ifndef H__DATEFUNC_ #define H__DATEFUNC_ #if defined _NO__DOS_DATE || (defined __TURBOC__ && __TURBOC__ <= 0x296) || defined(__GNUC__) /* TC/TC++ 1.01 or GCC */ struct dosdate_t { unsigned char day; /* 1--31 */ unsigned char month; /* 1--12 */ unsigned int year; /* 1980--2099 */ unsigned char dayofweek; /* 0--6; 0 = Sunday */ }; unsigned _dos_setdate(struct dosdate_t *); void _dos_getdate(struct dosdate_t *); #endif /* _NO__DOS_DATE */ #endif /* H__DATEFUNC_ */ ================================================ FILE: include/debug.h ================================================ /* Declaration & settings for debugging The following functions expand to nothing, if DEBUG is not defined, otherwise they expand to the given statement. dprintf( a ) --> print a [ printf() enable while debugging ] dbg_printmem() --> displays the memory and how it changed */ #ifndef H__DEBUG__ #define H__DEBUG__ #ifdef DEBUG /* DEBUG ENABLED */ #include extern FILE *dbg_logfile; extern int fddebug; #define dprintf(p) do { if (fddebug) dbg_print p; } while(0) void dbg_printmem (void); void dbg_print (const char fmt [], ...); void dbg_outc (int ch); void dbg_outs (const char *const s); void dbg_outsn (const char *const s); #else /* NO DEBUG */ #define dprintf(p) #define dbg_printmem() #endif /* DEBUG */ #endif /* H__DEBUG__ */ ================================================ FILE: include/infores.h ================================================ /* $Id$ Info resource Structure of the resource: ... a is of the structure: Offset Type Meaning 0 1 BYTE tag type 1 1 BYTE tag length 2..N+2 N BYTE tag value length may 0..255; tag type: Type Meaing 0 end of structure (may be absent) 1 minimum extra paragaphes required by C host environment length := 2 value := number of paragraphes that need to be additionally allocated by the program minimally 2 location of _heaplen variable length := 4 value := offset within file where the (unsigned)_heaplen variable is located 3 Aliases present in FreeCOM length := 2 value := default size of aliases buffer 4 History present in FreeCOM length := 2 value := default size of history buffer 5 Dirstack present in FreeCOM length := 2 value := default size of dirstack buffer 6 Internal command line size length := 2 value := size of internal command line */ #ifndef INFORES__H_ #define INFORES__H_ typedef enum { INFO_END = 0 ,INFO_EXTRA_SPACE ,INFO_POS_HEAPLEN ,INFO_ALIASES ,INFO_HISTORY ,INFO_DIRSTACK ,INFO_BUFSIZE } infotags; typedef struct { unsigned char type; unsigned char length; } infotag; #include struct EXE_header { unsigned short sig, lastFill, numBlocks, numReloc; unsigned short header; unsigned short extraMin, extraMax; unsigned short fSS, fSP, checksum, fIP, fCS; unsigned short offReloc, ovrlyNum; }; #include #endif ================================================ FILE: include/keys.h ================================================ /* * Defines keys without ASCII representation * * Internally a key is an (int) value, the low byte encodes the keycode * the high byte the mode the keycode has to be interpreted by. * mode meaning of keycode * 0 ASCII code * 1 scan code */ #ifndef KEYS__H #define KEYS__H #define SCANCODE(key) (key | 256) #define ASCIICODE(key) (key) #define KEY_F1 SCANCODE(59) #define KEY_F2 SCANCODE(60) #define KEY_F3 SCANCODE(61) #define KEY_F4 SCANCODE(62) #define KEY_F5 SCANCODE(63) #define KEY_F6 SCANCODE(64) #define KEY_F7 SCANCODE(65) #define KEY_F8 SCANCODE(66) #define KEY_F9 SCANCODE(67) #define KEY_F10 SCANCODE(68) #define KEY_F11 SCANCODE(133) #define KEY_F12 SCANCODE(134) #define KEY_LEFT SCANCODE(75) #define KEY_CTRL_LEFT SCANCODE(0x73) #define KEY_RIGHT SCANCODE(77) #define KEY_CTRL_RIGHT SCANCODE(0x74) #define KEY_UP SCANCODE(72) #define KEY_DOWN SCANCODE(80) #define KEY_INS SCANCODE(82) #define KEY_INSERT SCANCODE(82) #define KEY_DEL SCANCODE(83) #define KEY_DELETE SCANCODE(83) #define KEY_HOME SCANCODE(71) #define KEY_END SCANCODE(79) #define KEY_PUP SCANCODE(73) #define KEY_PDOWN SCANCODE(81) #define KEY_TAB ASCIICODE('\t') #define KEY_NL ASCIICODE('\n') #define KEY_CR ASCIICODE('\r') #define KEY_ENTER ASCIICODE('\r') #define KEY_BS ASCIICODE('\b') #define KEY_ESC ASCIICODE(27) #define KEY_CTL_A ASCIICODE(1) #define KEY_CTL_B ASCIICODE(2) #define KEY_CTL_C ASCIICODE(3) #define KEY_CTL_D ASCIICODE(4) #define KEY_CTL_E ASCIICODE(5) #define KEY_CTL_F ASCIICODE(6) #define KEY_CTL_G ASCIICODE(7) #define KEY_CTL_H ASCIICODE(8) #define KEY_CTL_I ASCIICODE(9) #define KEY_CTL_J ASCIICODE(10) #define KEY_CTL_K ASCIICODE(11) #define KEY_CTL_L ASCIICODE(12) #define KEY_CTL_M ASCIICODE(13) #define KEY_CTL_N ASCIICODE(14) #define KEY_CTL_O ASCIICODE(15) #define KEY_CTL_P ASCIICODE(16) #define KEY_CTL_Q ASCIICODE(17) #define KEY_CTL_R ASCIICODE(18) #define KEY_CTL_S ASCIICODE(19) #define KEY_CTL_T ASCIICODE(20) #define KEY_CTL_U ASCIICODE(21) #define KEY_CTL_V ASCIICODE(22) #define KEY_CTL_W ASCIICODE(23) #define KEY_CTL_X ASCIICODE(24) #define KEY_CTL_Y ASCIICODE(25) #define KEY_CTL_Z ASCIICODE(26) #endif ================================================ FILE: include/kswap.h ================================================ /* Kernel-supported swapping */ #ifndef FEATURE_XMS_SWAP #ifndef H__KSWAP__ #define H__KSWAP__ #include #include "../context.h_c" #define FREECOM_NEED_MODULES typedef kswap_t _seg *kswap_p; extern kswap_p kswapContext; /* static context */ /* Lock kswap feature within kernel and invalidate a previous external prg Return: TRUE if re-invoked */ int kswapInit(void); /* (De-)Register the static context with the kernel */ void kswapRegister(kswap_p ctxt); void kswapDeRegister(kswap_p ctxt); /* Update the kswap argument block Return: 0 on error <-> no swapping possible else: segment of structure */ unsigned kswapMkStruc(const char * const prg, const char * const cmdline); /* Restore the kswap argument block */ int kswapLoadStruc(void); #endif /* H__KSWAP__ */ #endif /* FEATURE_XMS_SWAP */ ================================================ FILE: include/large.inc ================================================ ; Large header group DGROUP _DATA _BSS segment _TEXT class=CODE segment _DATA class=DATA align=2 segment _BSS class=BSS align=2 @CodeSize EQU 1 @DataSize EQU 1 %macro ret 0-1 retf %1 %endmacro ================================================ FILE: include/lfnfuncs.h ================================================ /* * Header file for the long filename-related functions */ #ifndef H__LFNFUNCS_ #define H__LFNFUNCS_ /*#ifdef __TURBOC__*/ /* OpenWatcom has an LFN CLIB Extension available but not used yet */ #ifdef FEATURE_LONG_FILENAMES #include #include struct lfnffblk { unsigned short cr_time; /* time of file creation */ unsigned short cr_date; /* date of file creation */ unsigned short ac_time; /* time of last file access */ unsigned short ac_date; /* date of last file access */ unsigned short lfnax; /* DOS LFN search handle */ char ff_reserved[11]; /* reserved for use by DOS */ char ff_attrib; /* attribute byte for file */ unsigned short ff_ftime;/* time of last write to file */ unsigned short ff_fdate;/* date of last write to file */ unsigned long ff_fsize;/* length of file in bytes */ char ff_name[260]; /* null-terminated filename */ unsigned char lfnsup; /* DOS LFN support status */ }; #include #ifdef __LFNFUNCS_C #include struct locffblk { long attributes; long creattime; long creatdate; long accesstime; long accessdate; long wrtime; long wrdate; long hifilesize; long filesize; char reserved[8]; char lfn[260]; char sfn[14]; }; #include #endif /* __LFNFUNCS_C */ const char * getshortfilename( const char *longfilename ); int lfn_chmod( const char *filename, int func, ... ); int lfn_creat( const char *filename, int mode ); FILE * lfnfopen( const char *filename, const char *mode ); int lfnopen( const char *filename, int access, ... ); int lfnrename( const char *oldfilename, const char *newfilename ); int lfnfindfirst( const char *path, struct lfnffblk *buf, unsigned attr ); int lfnfindnext( struct lfnffblk *buf ); int lfnfindclose( struct lfnffblk *buf ); int lfnmkdir( const char *path ); int lfnrmdir( const char *path ); int lfnchdir( const char *path ); extern unsigned char __supportlfns; extern unsigned char lfncomplete; #ifndef __LFNFUNCS_C #undef remove #define access( x, y ) access( getshortfilename( x ), y ) #define chmod( x, y ) chmod( getshortfilename( x ), y ) #define creattemp( x, y ) creattemp( getshortfilename( x ), y ) #define dfnstat( x ) dfnstat( getshortfilename( x ) ) #undef dos_open #define dos_open( x, y ) sfn_open( getshortfilename( x ), y ) #define unlink( x ) unlink( getshortfilename( x ) ) #define _chmod lfn_chmod #undef dos_creat #define dos_creat lfn_creat #define fopen lfnfopen #define remove unlink #define open lfnopen #define rename lfnrename #define stat( x, y ) stat( getshortfilename( x ), y ) #undef dos_findfirst #undef dos_findnext #undef dos_findclose #define dos_findfirst lfnfindfirst #define dos_findnext lfnfindnext #define dos_findclose lfnfindclose #define dos_ffblk lfnffblk #define mkdir lfnmkdir #define rmdir lfnrmdir #define chdir lfnchdir #undef MAXFILE #undef MAXDIR #undef MAXPATH #undef MAXEXT #define MAXFILE 255 #define MAXDIR 255 #define MAXEXT 255 #define MAXPATH 260 #endif /* __LFNFUNCS_C */ #else #define dos_ffblk ffblk #endif /* FEATURE_LONG_FILENAMES */ /*#endif*/ /* __TURBOC__ */ #endif /* H__LFNFUNCS_ */ ================================================ FILE: include/medium.inc ================================================ ; Medium header group DGROUP _DATA _BSS segment _TEXT class=CODE segment _DATA class=DATA align=2 segment _BSS class=BSS align=2 @CodeSize EQU 1 @DataSize EQU 0 %macro ret 0-1 retf %1 %endmacro ================================================ FILE: include/misc.h ================================================ /* * MISC.C -- Misc. Functions declarations * * 2000/07/13 ska * started */ #ifndef MISC_H #define MISC_H #include #include #ifndef DEBUG #undef stdin #undef stdout #undef stderr extern FILE *stdin, *stdout, *stderr; #undef fileno #define fileno(f) ((int)(f)) #endif #include "../include/datefunc.h" #include "../include/timefunc.h" enum OnOff { /* ON/OFF tester */ OO_Empty = 0, /* Empty line */ OO_Null, /* NULL line */ OO_On, /* "ON" */ OO_Off, /* "OFF" */ OO_Other /* else */ }; typedef enum { STRINGS_LOADED , STRINGS_ID_MISMATCH , STRINGS_SIZE_MISMATCH , STRINGS_NOT_FOUND , STRINGS_READ_ERROR , STRINGS_OUT_OF_MEMORY } loadStatus; #define BREAK_BATCHFILE 1 #define BREAK_ENDOFBATCHFILES 2 #define BREAK_INPUT 3 #define BREAK_IGNORE 4 #define BREAK_FORCMD 5 #define cbreak chkCBreak(0) #define MAXARGS 20 #define MAXLEN 256 #define exist dfnstat /* transformed into constants unsigned far *maxx = MK_FP(0x40, 0x4a); unsigned char far *maxy = MK_FP(0x40, 0x84); */ #define MAX_X (*(unsigned int far*)MK_FP(0x40, 0x4a)) #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...) */ #define SCREEN_COLS MAX_X #define SCREEN_ROWS (MAX_Y + 1) extern FILE *errStream; #define outStream stdout extern int swapOnExec, defaultToSwap, swapContext; void display_errno_fnam_error(const char * const fnam); void displayExitcode(void); void outc( char c ); void outs( const char * const s ); int cgetchar(void); int vcgetchar(void); int vcgetcstr(const char *const legalCh); int keypressed(void); int cgetchar_timed(int secs); int chkCBreak(int mode); const char *getCurrenConDev(void); int setCurrentConDev(const char * dnam); void beep(void); void beep_low(void); char *comFile(void); char *comPathFile(const char * fnam); char *comResFile(void); #define comRespawnFile comResFile int validResFile(const char * const fnam); void dispCount(int cnt, unsigned base_id); int drvNum(int drive); char *cwd(int drive); char *abspath(const char * const fnam, const int warn); char *truepath(const char * const fnam); int changeDrive(int drive); int mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname); void cutBackslash(char * const s); int cd_dir(char *param, int cdd, const char * const fctname); enum OnOff onoffStr(char *line); #if defined(__TURBOC__) #define sfn_open _open #define dos_close _close #else int sfn_open(const char *pathname, int flags); #if defined(__GNUC__) #define stricmp strcasecmp #define strcmpi strcasecmp #define strnicmp strncasecmp #define memicmp strncasecmp int dos_close(int fd); #else #define dos_close _dos_close #endif #endif int dos_read(int fd, void *buf, unsigned int len); int dos_write(int fd, const void *buf, unsigned int len); #define sfnfindfirst(path,attrib,ffblk) findfirst(path,attrib,ffblk) #define sfnfindnext(ffblk) findnext(ffblk) #ifndef dos_open #define dos_open sfn_open #define dos_creat sfn_creat #define dos_findfirst sfnfindfirst #define dos_findnext sfnfindnext #define dos_findclose(ffblk) #endif int sfn_creat(const char *pathname, int attr); int sfn_creatnew(const char *pathname, int attr); size_t farread(int fd, void far*buf, size_t length); size_t farwrite(int fd, void far*buf, size_t length); unsigned allocPermBlk(const unsigned size, const unsigned mode); unsigned allocSysBlk(const unsigned size, const unsigned mode); unsigned allocMemBlk(const unsigned size, const unsigned mode); void freeSysBlk(const unsigned segm); void myperror(const char *msg); void myfnsplit(const char *path, char *buf, char *drv, char **dir, char **name, char **ext); void myfnmerge(char *path, const char *drive, const char *dir, const char *fname, const char *ext); char far *_fstpcpy(char far *dst, const char far *src); void partstrlower(char *str); void readcommand(char * const str, int maxlen); void readcommandDOS(char * const str, int maxlen); void readcommandEnhanced(char * const str, const int maxlen); int set_readcommandType(int enhanced); void convert(unsigned long num, unsigned int billions, char * const des); void goxy(const unsigned char x, const unsigned char y); void setErrorLevel(int rc); void execute(char *first, char *rest, int lh_lf); int exec(const char *, char *, const unsigned); void restoreSession(void); void saveSession(void); int samefile(const char * const f1, const char * const f2); void fillFnam(char *dest, const char * const pattern, const char * const fnam); int is_fnchar(const int c); int is_fnstr(const char * const s); int is_pathdelim(const int c); int is_empty(const char *s); #define is_quote(c) ((c) == '"') char *skipfnam(const char * const fnam); unsigned mywherex(void); unsigned mywherey(void); /************* Imported from LH.ASM */ int dosGetUMBLinkState(void); void dosSetUMBLinkState(int newState); int dosGetAllocStrategy(void); void dosSetAllocStrategy(int newState); word GetFirstMCB(void); char *curTime(void); char *curDateLong(void); int parsedate(const char * s, struct dosdate_t * const datep); int parsetime(const char * s, struct dostime_t * const timep); void displayPrompt(const char *pr); void printprompt(void); int showcmds(char *rest); int grabComFilename(const int warn, const char far * const fnam); void displayString(unsigned id,...); void displayError(unsigned id,...); int userprompt(unsigned id,...); int getPromptString(unsigned id, char ** const chars, char ** const fmt); #define freePromptString(chars,fmt) free(chars) int mapMetakey(const char * const chars, int ch); char *getMessage(unsigned id); char *defaultMessage(unsigned id); char *getString(unsigned id); void unloadMsgs(void); unsigned msgSegment(void); char *tmpfn(void); char *mktempfile(const char * const path, const char *ext); void killtmpfn(char * const); char *find_which(const char * const fname); int getbreak(void); void setbreak(const int OnOff); char *getEnv(char *); int chgEnv(const char[], const char[]); int chgEnvRemove(const char[], const char[]); int chgEnvCase(const int, char[], const char[]); char *trimsp(char *str); char *ltrimsp(const char *str); void rtrimsp(char * const str); char *parsenum(const char *s, int maxCnt, int *cnt, int nums[]); char *textlineEnd(const char * const buf, const size_t buflen); int truncate(int fd); /* void aliasprint(void); void aliaschange(const char * const name, const char * const value); char *alias_mangleFNam(const char * const name); word alias_find(char * const tagged_name); */ /* wrapper functions for ..\include\context.h - may disapeear in the future */ /* history wrapper: negative idx --> from end of buffer; currently no non-negative idx used */ int histGet(const int num, char * const str, const unsigned len); void histSet(const int num, const char * const str); void lastDirSet(void); void lastDirGet(char ** const buf); int appendDisable(void); void appendRestore(const int state); void registerCriterRepeatCheckAddr(word far *); char *critDriveReport(void); void critEnableRepeatCheck(void); unsigned critDisableRepeatCheck(void); void critEndRepCheck(void); #endif ================================================ FILE: include/model.inc ================================================ %ifidni MODEL,s %include "small.inc" %elifidni MODEL,m %include "medium.inc" %elifidni MODEL,l %include "large.inc" %else %error "Unsupported MODEL; assign 's', 'm' or 'l' to macro MODEL" %endif ================================================ FILE: include/module.h ================================================ /* * Special FreeCOM declaration for the module management * * 2000/07/12 ska * started */ #ifndef MODULE_H #define MODULE_H #include "../include/kswap.h" #ifdef FREECOM_NEED_MODULES /* Retruns the pointer of the context pointer of the Critical Error handler */ extern kswap_p modContext(void); #endif #endif ================================================ FILE: include/mux_ae.h ================================================ /* Declaration for Installable COMMAND extensions (MUX-AE) 2000/12/10 ska started */ #ifndef FREECOM_MUX_AE_H #define FREECOM_MUX_AE_H #include "../include/command.h" /* minimal size of buffer passed into runExtension() for both command and line. Also, command[-2] & command[-1] must be available as well as line[-2], line[-1] and line[BUFFER_SIZE_MUX_AE] */ #if MAX_INTERNAL_COMMAND_SIZE > 255 #define BUFFER_SIZE_MUX_AE 255 #else #define BUFFER_SIZE_MUX_AE MAX_INTERNAL_COMMAND_SIZE #endif /* Check for extensions and perform it, on success return != 0 */ /* Also: The contents of both buffers is monitored in order to check if they got overflowed during the MUX call. If so, the executation is aborted. */ int runExtension(char * const command, char * const line); #endif ================================================ FILE: include/nls.h ================================================ /* $Id$ Declarations to access the DOS NLS information $Log$ Revision 1.2 2003/03/05 17:43:42 skaus bugfix: cached NLS data not flushed Revision 1.1 2001/04/12 00:09:06 skaus chg: New structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #ifndef __NLS_H #define __NLS_H #include extern Country *nlsBuf; /* internally cached NLS info buffer */ void refreshNLS(void); /* make sure the nlsBuf is valid */ #define invalidateNLSbuf() nlsBuf = 0 /* The mode parameter is an OR combination of the following defines */ #define NLS_MAKE_SHORT_AMPM 1 /* AM/PM as single letters */ /* Create a correctly constructed DATE string from the given parameters, the result is located in a dynamically allocated buffer */ char *nls_makedate(int mode, int year, int month, int day); char *nls_maketime(int mode, int hour, int minute, int second, int fraction); #endif ================================================ FILE: include/openf.h ================================================ /* * Prototypes for the CP/M-style device name-aware open functions */ #ifndef __OPENF_H #define __OPENF_H #include /* * Check if the passed file descriptor is connected to a * character device rather than a block device * * Return: * 0: block device (disk file) * else: character device */ int isadev(const int fd); /* * Return the attributes of an opened handle; 0 on error */ int fdattr(const int fd); int fdsetattr(const int fd, const int attr); /* * Check for a CP/M-style device name * * Return: * 0: no, fnam[] unchanged * else: yes, fnam[] is modifed to contain a valid DOS filename */ int isDeviceName(char * const fnam); /* * IO-style CP/M aware open() function * * If it is a device name, fnam[] is modified to contain a valid * DOS filename. */ int devopen(char * const fnam, int mode); /* * FIO-style CP/M aware fopen() function * * If it is a device name, fnam[] is modified to contain a valid * DOS filename. */ FILE *fdevopen(char * const fnam, const char * const mode); #endif ================================================ FILE: include/res.h ================================================ /* * Special FreeCOM declaration for the resource management * * enumResources() enumerates all resources of the specified major ID * and invokes a callback function; if the primary resource file * is not avilable, the passe din alternate file is tried. */ #ifndef RES_H #define RES_H #include "../include/resource.h" int enumResources(res_majorid_t id, res_callbackp_t fct, void * const arg); #endif ================================================ FILE: include/resource.h ================================================ /* * Declarations of resource management of FreeCOM * * See DOCS\RESOURCE.TXT * * enumFileResources() enumerates all resources of the specified major ID * and invokes a callback function * startResource() prepares a stream that a new resources is about to * be written into it * endResource() cleans up the resource prepared by startResource() * */ #ifndef RESOURCE_H #define RESOURCE_H #include #include "algnbyte.h" typedef unsigned short res_minorid_t; /* must be exactly unsigned 16bit */ #ifdef __LP64__ typedef unsigned int res_length_t; #else typedef unsigned long res_length_t; #endif enum { RES_ID_NONE = -0x7ffe, RES_ID_ANY = -0x7fff, RES_ID_STRINGS = 0, RES_ID_CRITER, RES_ID_INFO }; typedef short res_majorid_t; typedef struct { /* type of a control area */ res_length_t res_length; res_majorid_t res_majorID; res_minorid_t res_minorID; unsigned char res_cookie[8]; /* NOT '\0' terminated! */ } resource_t; #include "algndflt.h" typedef int (*res_callbackp_t)(res_majorid_t, res_minorid_t , unsigned long, int, void * const); #define RES_COOKIE "FREECOM " /**************************** ****** Prototypes ********** ****************************/ int enumFileResources(const char * const fnam, res_majorid_t id , res_callbackp_t fct, void * const arg); void startResource(FILE *f, res_majorid_t majorID, res_minorid_t minorID); void endResource(FILE *f); #ifdef __TURBOC__ #if sizeof(res_majorid_t) != 2 #error "res_id_t must be exactly 16bit!" #endif #if sizeof(res_minorid_t) != 2 #error "res_id_t must be exactly 16bit!" #endif #endif #endif ================================================ FILE: include/small.inc ================================================ ; Small header %ifidn __OUTPUT_FORMAT__, obj group DGROUP _DATA _BSS segment _TEXT class=CODE segment _DATA class=DATA align=2 segment _BSS class=BSS align=2 %else bits 16 %define _TEXT .text %define _DATA .data %define _BSS .bss %endif @CodeSize EQU 0 @DataSize EQU 0 ================================================ FILE: include/strings.typ ================================================ /* * STRINGS.TYP - Shared types of STRINGS.DAT implementation * required to ensure FIXSTRS and FREECOM use the same * binary representation * * 2000/07/09 ska * started */ typedef unsigned short string_count_t; /* number of strings */ typedef unsigned short string_size_t; /* number of size of strings */ typedef struct { string_count_t index; string_size_t size; } string_index_t; #define STRING_NONE ((string_count_t)-1) #define STRING_RESOURCE_MINOR_ID 3 extern string_count_t strCnt; extern unsigned msgSegm; ================================================ FILE: include/stuff.inc ================================================ cpu 8086 ;; Multi-Push/Pop ;; Both take the registers in the same order, "F"==Flags ;; Push pushes left to right; pop right to left %macro pushm 2-* %rep %0 %ifidni %1,f pushf %else push %1 %endif %rotate 1 %endrep %endmacro %macro popm 2-* %rep %0 %rotate -1 %ifidni %1,f popf %else pop %1 %endif %endrep %endmacro ;; declare global and extern with underscore for OMF, without for ELF %macro cglobal 1-* %rep %0 %ifnidn __OUTPUT_FORMAT__,elf %define %1 _%1 %endif global %1 %rotate 1 %endrep %endmacro %macro cextern 1-* %rep %0 %ifnidn __OUTPUT_FORMAT__,elf %define %1 _%1 %endif extern %1 %rotate 1 %endrep %endmacro ================================================ FILE: include/timefunc.h ================================================ /* TimeFunc -- DOS Time Functions Copyright (C) 1998 Rob Lake This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Rob Lake can be contacted at email: rlake@cs.mun.ca */ #ifndef H__TIMEFUNC_ #define H__TIMEFUNC_ #if defined _NO__DOS_DATE || (defined __TURBOC__ && __TURBOC__ <= 0x296) || defined(__GNUC__) /* TC/TC++ 1.01 or GCC */ /* The time structure, compatible with dostime_t */ struct dostime_t { unsigned char hour; /* Hours */ unsigned char minute; /* Minutes */ unsigned char second; /* Seconds */ unsigned char hsecond; /* Hundredths of seconds */ }; unsigned _dos_settime(struct dostime_t *); void _dos_gettime(struct dostime_t *); #ifdef __GNUC__ void delay(unsigned ms); #endif #endif /* _NO__DOS_TIME */ #endif /* H__TIMEFUNC_ */ ================================================ FILE: lib/absfile.c ================================================ /* $Id$ * Make the given file spec an absolute path/file name. * Returns in a dynamically allocated buffer (free'ed by the caller) * on error: Displays "out of memory" (or appropriate) $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL */ #include "../config.h" #include #include #include #include "../err_fcts.h" #include "../include/command.h" #include "../include/misc.h" char *abspath(const char * const fnam, const int warn) { char *h; assert(fnam); if((h = dfnfullpath(fnam)) != 0) return h; if(warn) display_errno_fnam_error(fnam); return 0; } ================================================ FILE: lib/almemblk.c ================================================ /* $Id$ Allocate a block of memory. Remove "Use UMB" if forceLow is true. $Log$ Revision 1.1 2004/06/29 21:57:20 skaus fix: /LOW option */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/misc.h" unsigned allocMemBlk(const unsigned size, const unsigned Xmode) { unsigned mode = Xmode; assert(size); if(forceLow) mode &= ~0x80; /* Remove the "Use UMB" bit */ return allocBlk(size, mode); } ================================================ FILE: lib/alprmblk.c ================================================ /* $Id$ Allocate a permanent block of memory. These blocks are system memory blocks, if swapping is enabled; otherwise "normal" ones. $Log$ Revision 1.3 2004/06/29 21:57:20 skaus fix: /LOW option Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/kswap.h" #include "../include/misc.h" unsigned allocPermBlk(const unsigned size, const unsigned mode) { assert(size); if(swapOnExec == ERROR) return allocMemBlk(size, mode); return allocSysBlk(size, mode); } ================================================ FILE: lib/alsysblk.c ================================================ /* $Id$ Allocate system memory block. This block is not deallocated if the process dies. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.3 2004/06/29 21:57:20 skaus fix: /LOW option Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include "mcb.h" #include "suppl.h" #include "../include/misc.h" unsigned allocSysBlk(const unsigned size, const unsigned mode) { unsigned segm; struct MCB _seg *mcb; if((segm = allocMemBlk(size, mode)) != 0) { mcb = MK_SEG_PTR (struct MCB, SEG2MCB (segm)); mcb->mcb_ownerPSP = 8; dprintf(("[MEM: allocated system memory block: %04x/%u]\n" , segm, size)); } return segm; } ================================================ FILE: lib/app_get.c ================================================ /* $Id$ Enable DOS/APPEND if it was enabled before. int appendDisable() Disable DOS/APPEND and return the previous state; Return 0 if no APPEND is loaded. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/07/12 18:48:38 skaus fix: appendDisable(): should disable APPEND [Eduardo Casino] Revision 1.1 2004/06/21 17:49:25 skaus fix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao} */ #include "../config.h" #include #include #include "../include/misc.h" int appendDisable(void) { IREGS r; int state; #if 1 r.r_ax = 0xb700; /* APPEND installation check */ intrpt(0x2f, &r); #endif #if 0 r.x.ax = 0xB700; int86( 0x2F, &r, &r ); #endif if(0xFF != (r.r_ax & 0xFF)) { /* Not loaded */ #ifndef NDEBUG static int dispCnt = 1; if(r.r_ax & 0xFF) dprintf(("[INTERNAL: Unknown return value of MUX-B7-00: %u]\n", r.r_ax & 0xFF)); if(--dispCnt <= 0) { dprintf(("[MUX-B7: No APPEND loaded]\n")); dispCnt = 10; } #endif return 0; } /* APPEND is loaded */ r.r_ax = 0xb706; /* Get APPEND function state */ intrpt(0x2f, &r); dprintf(("[MUX-B7: get state 0x%04x]\n", r.r_bx)); state = r.r_bx; if(state & 1) { r.r_ax = 0xb707; /* Set APPEND function state */ r.r_bx = state & ~1; intrpt(0x2f, &r); dprintf(("MUX-B7: set state 0x%04x]\n", r.r_bx)); } return state; } ================================================ FILE: lib/app_set.c ================================================ /* $Id$ Enable DOS/APPEND if it was enabled before. void appendRestore(int state) Enable DOS/APPEND if state & 1 $Log$ Revision 1.2 2004/07/12 18:48:38 skaus fix: appendDisable(): should disable APPEND [Eduardo Casino] Revision 1.1 2004/06/21 17:49:26 skaus fix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao} */ #include "../config.h" #include #include #include "../include/misc.h" void appendRestore(const int state) { if(state & 1) { /* Re-enable DOS/APPEND */ IREGS r; r.r_ax = 0xb707; /* Set APPEND function state */ r.r_bx = state; intrpt(0x2f, &r); dprintf(("MUX-B7: set state 0x%04x]\n", state) ); } } ================================================ FILE: lib/beep_l.c ================================================ /* $Id$ issue low beep This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void beep_low(void) { sound(900); delay(200); /* 400 */ nosound(); delay(100); } ================================================ FILE: lib/beep_n.c ================================================ /* $Id$ * Internally BEEP (getting the user's attention) * Note: One should consider implementing a _visual_ beep * rather an audible beep and an option to switch between them. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void beep(void) { sound(900); delay(200); /* 400 */ nosound(); delay(100); } ================================================ FILE: lib/brk_get.c ================================================ /* $Id$ Get Break status This file bases on BREAK.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/misc.h" int getbreak(void) { USEREGS _AX = 0x3300; geninterrupt(0x21); return _DL; } ================================================ FILE: lib/brk_set.c ================================================ /* $Id$ Set Break status This file bases on BREAK.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/misc.h" void setbreak(const int OnOff) /* Off = 0, On = 1 */ { USEREGS _DX = OnOff; _AX = 0x3301; geninterrupt(0x21); } ================================================ FILE: lib/c16.mac ================================================ ; NASM macro set to make interfacing to 16-bit programs easier -*- nasm -*- %imacro proc 1 ; begin a procedure definition %push proc global %1 %1: push bp mov bp,sp %ifdef FARCODE PASCAL ; arguments may start at bp+4 or bp+6 %assign %$arg 6 %define %$firstarg 6 %else %assign %$arg 4 %define %$firstarg 4 %endif %define %$procname %1 %endmacro %imacro arg 0-1 2 ; used with the argument name as a label %00 equ %$arg ; we could possibly be adding some ; debug information at this point...? %assign %$arg %1+%$arg %endmacro %imacro endproc 0 %ifnctx proc %error Mismatched `endproc'/`proc' %else mov sp,bp pop bp %ifdef PASCAL retf %$arg - %$firstarg %elifdef FARCODE retf %else retn %endif __end_%$procname: ; useful for calculating function size %pop %endif %endmacro ================================================ FILE: lib/cbreak.c ================================================ /* $Id$ * Check if Ctrl-Break was pressed during the last calls This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.6 2006/09/04 20:14:23 blairdude Support for BC Revision 1.5 2006/06/17 06:10:31 blairdude Optimization Revision 1.4 2006/06/13 02:10:19 blairdude Cleaned up some code, moved write in outc to fwrite to make everybody happy (thanks to Arkady for the reports) Revision 1.3 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include /* strlen */ #include /* free */ #include /* O_WRONLY */ #include #include /* _open, _write, _close */ #include #include "../include/batch.h" #include "../include/misc.h" #include "../include/command.h" #include "../strings.h" static char condev[13] = "CON"; const char * getCurrentConDev(void) { return (const char *)condev; } int setCurrentConDev(const char * dnam) { const char *nam = dfnfilename(dnam); size_t len = strlen(nam); if (len == 0 || len >= sizeof(condev)) return -1; /* failed */ memcpy(condev, nam, len + 1); return 0; /* ok */ } /* This is to prevent all that Turbo C CONIO stuff from being linked in */ static void mycprintf( char *fmt, ... ) { va_list args; char buffer[ 512 ]; int consolehandle = dos_open( condev, O_WRONLY ); /* * Just as cprintf _ensures_ printing directly to the console, so will * opening the console and writing to it do the same */ va_start( args, fmt ); vsprintf( buffer, fmt, args ); dos_write( consolehandle, buffer, strlen( buffer ) ); dos_close( consolehandle ); va_end( args ); } int chkCBreak(int mode) { static int leaveAll = 0; /* leave all batch files */ switch (mode) { case BREAK_ENDOFBATCHFILES: leaveAll = 0; return 0; case 0: if (!bc) goto justCheck; case BREAK_BATCHFILE: if (leaveAll) return 1; if (!ctrlBreak) return 0; /* we need to be sure the string arrives on the screen! Therefore userprompt() is not we need. */ { char *fmt, *chars; int ch; if(!getPromptString(PROMPT_CANCEL_BATCH, &chars, &fmt)) { /* Fatal error <-> Terminate all batches */ leaveAll = 1; break; } if(bc && bc->bfnam) mycprintf(fmt, bc->bfnam); else { char *fnam = getString( TEXT_UNKNOWN_FILENAME ); mycprintf( fmt, fnam ? fnam : "<>" ); free( fnam ); } while((ch = cgetchar()) == 0 || (ch = mapMetakey(chars, ch)) == 0) beep(); mycprintf("\r\n"); freePromptString(chars, fmt); switch(ch) { /* case 1: Yes -> just fall through */ case 2: /* No */ return ctrlBreak = 0; /* ignore */ case 3: /* leave All batchfiles */ leaveAll = 1; break; } } break; justCheck: case BREAK_FORCMD: /* FOR commands are part of batch processing */ if (leaveAll) return 1; /* fall through */ case BREAK_INPUT: if (!ctrlBreak) return 0; break; } ctrlBreak = 0; /* state processed */ return 1; } ================================================ FILE: lib/cbs.c ================================================ /* $Id$ Cut trailing backslashes */ #include "../config.h" #include #include #include "../include/misc.h" void cutBackslash(char * const s) { char *p; assert(s); p = strchr(s, '\0'); /* take off trailing \ if any, but ONLY if dir is not the root dir */ while(p > &s[1] && *--p == '\\' && p[-1] != ':') *p = '\0'; } ================================================ FILE: lib/cd_dir.c ================================================ /* $Id$ * CDD & CD handler */ #include "../config.h" #include #include #include #include #include #include "../include/cmdline.h" #include "../include/misc.h" #include "../strings.h" #include "../err_fcts.h" #include "../suppl/dfn.h" #include "../include/lfnfuncs.h" int cd_dir(char *param, int cdd, const char * const fctname) { char **argv, *dir; int argc, opts; int rv, freeDir; if((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0) return 1; freeDir = 0; rv = 1; /* if doing a CD and no parameters given, print out current directory */ if(argc == 0) { if((dir = cwd(0)) != 0) { puts(dir); freeDir = 1; goto okRet; } goto errRet; } else if(argc != 1) { error_syntax(0); goto errRet; } else { assert(argv[0]); #ifdef FEATURE_CDD_FNAME /* if path refers to an existing file and not directory, ignore filename portion */ if (cdd && (dfnstat(argv[0]) & DFN_FILE)) { dir = strrchr(argv[0], '\\'); if (dir == NULL) { dir = argv[0]; if (dir[1] == ':') dir[2]='\0'; /* change drive only, no path */ else goto okRet; /* no drive, no path, so exit early */ } else /* includes a path or refers to root dir */ { *(dir+1) = '\0'; } } #endif dir = strchr(argv[0], '\0'); /* take off trailing \ if any, but ONLY if dir is not the root dir */ while(dir > &argv[0][1] && *--dir == '\\' && dir[-1] != ':') *dir = '\0'; dir = argv[0]; #ifdef FEATURE_LAST_DIR if(strcmp(dir, "-") == 0) { assert(!freeDir); /* change to last directory */ lastDirGet(&dir); freeDir = 1; } lastDirSet(); if(!dir) /* "CD -" without a CD before at all */ goto okRet; #endif if(*dir && dir[1] == ':') { if(cdd) { if(changeDrive(*dir) != 0) goto errRet; if(!dir[2]) /* only change drive */ goto okRet; } else if(!dir[2]) { /* Real CHDIR displays CWD of specified drive */ assert(freeDir == 0); if((dir = cwd(*dir)) != 0) { puts(dir); freeDir = 1; goto okRet; } goto errRet; } } dprintf(("%s: '%s'\n", fctname, dir)); if(chdir(dir) != 0) { error_dirfct_failed(fctname, dir); goto errRet; } } okRet: rv = 0; errRet: freep(argv); if(freeDir) free(dir); return rv; } ================================================ FILE: lib/cgetch.c ================================================ /* $Id$ Get a character out-of-band and honor Ctrl-Break characters Invisible. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.3 2006/06/11 06:50:49 blairdude Removed usage of Turbo C's getch to remove idle ...getch... object modules being compiled in. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/command.h" #include "../include/keys.h" #include "../include/misc.h" static int mygetch( void ) { IREGS regs; regs.r_ax = 0x0700; intrpt(0x21, ®s); return (regs.r_ax)&0xFF; } #define getch mygetch int cgetchar(void) { int c; if((c = getch()) == 0) c = SCANCODE(getch()); /* Scan code */ if(c == KEY_CTL_C) { ctrlBreak = 1; } return c; } ================================================ FILE: lib/cgettime.c ================================================ /* $Id$ Waits about N secs for a keypress. returns 0 if none else returns key pressed invisibly. This file bases on INIT.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include "../include/misc.h" int cgetchar_timed(int secs) { struct dostime_t start; struct dostime_t now; int num; static char space[1] = {' '}; static char backspaces[2] = {'\b', '\b'}; start.second = 60; /* force decrement secs first time in loop */ ++secs; while(!keypressed()) { _dos_gettime(&now); if(now.second != start.second) { if(!--secs) return 0; memcpy(&start, &now, sizeof(now)); printf("%d", secs); num = secs > 8 ? 2 : 1; if(secs == 9) dos_write(1, space, 1); dos_write(1, backspaces, num); } delay(100); } /* Because "keypressed()" returned true, getchar() does not block */ return cgetchar(); } ================================================ FILE: lib/chgctxt.c ================================================ /* $Id$ chgCtxt(): * Insert/replace/delete a case-sensitive variable into the specified * context * * If value == NULL, the variable is deleted. * If value == "", a variable with an empty body is created. * If name == "", a body with an empty name is created. * * Return: 0 on success;; !0 on failure chgCtxtRemove(): as chgEnv(), but value == "" deletes the variable, too This file bases on ENVIRON.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/context.h" #include "../err_fcts.h" /* Weight two context items which one uses more memory than acutally is allowed to do so */ static unsigned long weight(ctxt_info_t *info) { unsigned long n; n = (unsigned long)info->c_sizecur << 16; n /= (unsigned)info->c_sizemax; return n; } /* #define weight(info) \ (((unsigned)info->c_sizecur << 16) / (unsigned)info->c_sizemax) */ int chgCtxt(const Context_Tag tag, const char * const name, const char * const value) { word segm, ofs; int newlen; assert(name); ctxtCheckInfoTag(tag); segm = ctxtFromTag(tag); assert(segm); newlen = value? strlen(name) + strlen(value) + 2: 0; if((ofs = env_findVar(segm, name)) != (word)-1) newlen -= env_varlen(segm, ofs); /* Make sure the context has enough room to add the value to */ if(newlen > 0) { /* contents size will grow */ ctxt_info_t *hinfo, *dinfo; /* aliases may not exceed sizemax */ if(tag == CTXT_TAG_ALIAS) { if(CTXT_INFO(CTXT_TAG_ALIAS, sizemax) - CTXT_INFO(CTXT_TAG_ALIAS, sizecur) < newlen) { error_alias_out_of_memory(); return E_NoMem; } } /* Otherwise a removeable entry is removed; those are: oldest item of history oldest item of dirstack */ hinfo = segm == ctxtFromTag(CTXT_TAG_HISTORY) ? &CTXT_INFO_STRUCT(CTXT_TAG_HISTORY): 0; dinfo = segm == ctxtFromTag(CTXT_TAG_DIRSTACK) ? &CTXT_INFO_STRUCT(CTXT_TAG_DIRSTACK): 0; while(env_freeCount(segm) < newlen) { /* There are two structures that can shrink: history & dirstack */ if(hinfo && (hinfo->c_sizecur <= hinfo->c_sizemax /* inconsitency of redundant info */ || hinfo->c_nummin >= hinfo->c_nummax)) /* in range -> ignore */ hinfo = 0; if(dinfo && (dinfo->c_sizecur <= dinfo->c_sizemax /* inconsitency of redundant info */ || dinfo->c_nummin >= dinfo->c_nummax)) /* in range -> ignore */ dinfo = 0; if(hinfo && dinfo) { /* Choose one */ if(weight(hinfo) < weight(dinfo)) ctxtGet(1, CTXT_TAG_DIRSTACK, ++dinfo->c_nummin, 0); else ctxtGet(1, CTXT_TAG_HISTORY, ++hinfo->c_nummin, 0); } else if(dinfo) ctxtGet(1, CTXT_TAG_DIRSTACK, ++dinfo->c_nummin, 0); else if(hinfo) ctxtGet(1, CTXT_TAG_HISTORY, ++hinfo->c_nummin, 0); else { /* no space left */ error_context_out_of_memory(); return E_NoMem; } } } /* return values 1 and 3 are OK */ switch(env_change(segm, name, value)) { case 2: /* variable to delete not found <-> no problem */ case 1: case 3: /* var replaced | deleted | inserted ==> OK */ CTXT_INFO(tag, sizecur) += newlen; return 0; case 0: /* Cannot insert */ dprintf(("chgCtxt(): out-of-mem shouldn't occure here!\n")); error_context_out_of_memory(); return E_NoMem; default: return E_Syntax; } } ================================================ FILE: lib/chgdrv.c ================================================ /* $Id$ Change drive and display an appropriate message on error. Input: 0 == current drive 1..32 == A: .. 'A'.. == A: .. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../err_fcts.h" #include "../include/misc.h" #include "../strings.h" int changeDrive(int drive) { drive = drvNum(drive); setdisk(drive); if (getdisk() == drive) return 0; error_invalid_drive(drive); return 1; } ================================================ FILE: lib/chgenv.c ================================================ /* $Id$ chgCtxt(): * Insert/replace/delete a case-sensitive variable into the specified * context * * If value == NULL, the variable is deleted. * If value == "", a variable with an empty body is created. * If name == "", a body with an empty name is created. * * Return: 0 on success;; !0 on failure chgCtxtRemove(): as chgEnv(), but value == "" deletes the variable, too This file bases on ENVIRON.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../err_fcts.h" #include "../include/command.h" #include "../include/misc.h" #include "../strings.h" int chgEnv(const char name[], const char value[]) { assert(name); /* return values 1 and 3 are OK */ switch(env_change(0, name, value)) { case 2: /* variable to delete not found <-> no problem */ case 1: case 3: /* var replaced | deleted | inserted ==> OK */ return 0; case 0: /* Cannot insert */ if(!inInit) error_env_var(name); return E_NoMem; default: error_no_env(); return E_Syntax; } } ================================================ FILE: lib/chgenvc.c ================================================ /* $Id$ * Insert/replace/delete an environment variable * * If the variable already exists within the environment, * its case is retained {So one can modify "winbootdir", for * example}. If the variable shall be added to the environment, * but is not (in any case-insensitive match) contained within the * environment, the name is uppercased. * * Return: 0 on success * !0 on failure This file bases on ENVIRON.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/context.h" #include "../include/misc.h" int chgEnvCase(const int keepCase, char var[], const char value[]) { assert(var); if(!keepCase && (env_matchVar(0, var) & 7) != 0) /* no match --> upcase variable */ StrUpr(var); return chgEnv(var, value); } ================================================ FILE: lib/chgenvr.c ================================================ /* $Id$ chgEnvRemove(): * Insert/replace/delete a case-sensitive variable into the specified * context * * If value == NULL || *value == 0, the variable is deleted. * If name == "", a body with an empty name is created. * * Return: 0 on success;; !0 on failure $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/misc.h" #include "../strings.h" int chgEnvRemove(const char name[], const char value[]) { return chgEnv(name, (value && *value)? value: 0); } ================================================ FILE: lib/cmdinput.c ================================================ /* $Id$ * CMDINPUT.C - handles command input (tab completion, history, etc.) */ #include "../config.h" #include #include #include #include #include #include #include "../include/command.h" #include "../include/keys.h" #include "../include/misc.h" static unsigned orgx, orgy; /* start of current command input */ #define MK_PTR(type,seg,ofs) ((type FAR*) MK_FP (seg, ofs)) /* safer edition of MK_FP (Arkady) */ typedef struct { unsigned char col, row; } SCRPOS; #define _scr_page (* MK_PTR (volatile const unsigned char, 0, 0x462)) #define _scr_pos_array MK_PTR (volatile const SCRPOS, 0, 0x450) unsigned mywherex (void) { return _scr_pos_array [_scr_page].col + 1; } unsigned mywherey (void) { return _scr_pos_array [_scr_page].row + 1; } #undef _NOCURSOR #undef _NORMALCURSOR #undef _SOLIDCURSOR #undef _HALFCURSOR #define _NOCURSOR 3 #define _HALFCURSOR 2 #define _NORMALCURSOR 0 #define _SOLIDCURSOR 1 static void my_setcursortype( unsigned short state ) { IREGS regs; int cur_mode; regs.r_ax = 0x0F00; intrpt( 0x10, ®s ); cur_mode = regs.r_ax & 0xFF; regs.r_ax = 0x0100; /* ch == start line. cl == end line */ switch (state) { case _SOLIDCURSOR : regs.r_cx = (cur_mode == 7) ? 0x010C : 0x0107; break; case _NORMALCURSOR: regs.r_cx = (cur_mode == 7) ? 0x0B0C : 0x0607; break; #if 0 /* Unused */ case _NOCURSOR : regs.r_cx = 0x2020; break; case _HALFCURSOR : regs.r_cx = (cur_mode == 7) ? 0x070C : 0x0407; break; default : regs.r_cx = state; break; #endif } intrpt( 0x10, ®s ); } #define wherex mywherex #define wherey mywherey #define _setcursortype my_setcursortype static int isworddelimiter(unsigned c) { return c == ' ' || c == '\t'; } /* Print a character to current cursor position Updates cursor postion */ void outc(char c) { if (c == '\n') dos_write(1, "\r\n", 2); else dos_write(1, &c, 1); } /* Print a blank to current cursor postion Updates cursor position */ static void outblank(void) { outc(' '); } /* Print string to current cursor position Updates cursor position */ void outs(const char * const s) { assert(s); printf("%s", s); } /* Print string to cursor position and append one blank Updates cursor postion */ static void outsblank(const char * const s) { outs(s); outblank(); } static void clrcmdline(char * const str, const unsigned pos, const int maxlen) { size_t len = strlen(str); int x = wherex(); int y = wherey(); if(len > 0) { unsigned step; for(step = pos; step > 0; step--) { x--; if(x<0) { y--; x=SCREEN_COLS-1; } } assert(str); goxy(x, y); memset(str, ' ', len); dos_write(1, str, len); goxy(x, y); memset(str, 0, maxlen); } } /* calculates the number of lines to scroll if cursor is initially at position curx,cury and cursor is advanced numchars characters */ static unsigned numLinesToScroll(const unsigned curx, unsigned cury, const unsigned numchars) { cury += (curx + numchars - 1) / SCREEN_COLS; return (cury <= SCREEN_ROWS) ? 0 : cury - SCREEN_ROWS; } /* read in a command line */ void readcommandEnhanced(char * const str, const int maxlen) { unsigned char insert = 1; unsigned ch; #ifdef FEATURE_FILENAME_COMPLETION unsigned lastch = 0; #endif #ifdef FEATURE_HISTORY int histLevel = 0; char prvLine[MAX_INTERNAL_COMMAND_SIZE] = { '\0' }; #endif unsigned curx; unsigned cury; unsigned lines; int count; unsigned current = 0; unsigned charcount = 0; assert(str); assert(maxlen <= MAX_INTERNAL_COMMAND_SIZE); /* if echo off, don't print prompt */ if(echo) printprompt(); orgx = wherex(); orgy = wherey(); memset(str, 0, maxlen); _setcursortype(_NORMALCURSOR); #ifdef FEATURE_HISTORY histGet(histLevel - 1, prvLine, sizeof(prvLine)); #endif do { ch = cgetchar(); if(cbreak) ch = KEY_CTL_C; switch(ch) { case KEY_BS: /* delete character to left of cursor */ if(current > 0 && charcount > 0) { if(current == charcount) { /* if at end of line */ str[current - 1] = 0; if (wherex() != 1) outs("\b \b"); else { goxy(MAX_X, wherey() - 1); outblank(); goxy(MAX_X, wherey() - 1); } } else { for (count = current - 1; count < charcount; count++) str[count] = str[count + 1]; if (wherex() != 1) goxy(wherex() - 1, wherey()); else goxy(MAX_X, wherey() - 1); curx = wherex(); cury = wherey(); outsblank(&str[current - 1]); goxy(curx, cury); } charcount--; current--; } break; case KEY_INSERT: /* toggle insert/overstrike mode */ insert ^= 1; if (insert) _setcursortype(_NORMALCURSOR); else _setcursortype(_SOLIDCURSOR); break; case KEY_DELETE: /* delete character under cursor */ if (current != charcount && charcount > 0) { for (count = current; count < charcount; count++) str[count] = str[count + 1]; charcount--; curx = wherex(); cury = wherey(); outsblank(&str[current]); goxy(curx, cury); } break; case KEY_HOME: /* goto beginning of string */ if (current != 0) { goxy(orgx, orgy); current = 0; } break; case KEY_END: /* goto end of string */ if (current != charcount) { goxy(orgx, orgy); outs(str); current = charcount; } break; #ifdef FEATURE_FILENAME_COMPLETION case KEY_TAB: /* expand current file name */ if(current == charcount) { /* only works at end of line */ if(lastch != KEY_TAB) { /* if first TAB, complete filename */ complete_filename(str, charcount); charcount = strlen(str); current = charcount; goxy(orgx, orgy); outs(str); orgy -= numLinesToScroll(orgx, orgy, charcount); } else { /* if second TAB, list matches */ if (show_completion_matches(str, charcount)) { printprompt(); orgx = wherex(); orgy = wherey(); outs(str); orgy -= numLinesToScroll(orgx, orgy, charcount); } } } else beep(); break; #endif case KEY_ENTER: /* end input, return to main */ if (current != charcount) { /* make sure we locate cursor to end of command before spawning process */ goxy(orgx, orgy); outs(str); } #ifdef FEATURE_HISTORY if(str[0]) histSet(0, str); /* add to the history */ #endif outc('\n'); break; case KEY_CTL_C: /* ^C */ case KEY_ESC: /* clear str Make this callable! */ clrcmdline(str, current, maxlen); current = charcount = 0; if(ch == KEY_CTL_C && !echo) { /* enable echo to let user know that's this is the command line */ echo = 1; printprompt(); } break; case KEY_RIGHT: /* move cursor right */ if (current != charcount) { current++; if (wherex() == MAX_X) goxy(1, wherey() + 1); else goxy(wherex() + 1, wherey()); break; } /* cursor-right at end of string grabs the next character from the previous line */ /* FALL THROUGH */ #ifndef FEATURE_HISTORY break; #else case KEY_F1: /* get character from last command buffer */ if (current < strlen(prvLine)) { outc(str[current] = prvLine[current]); charcount = ++current; } break; case KEY_F3: /* get previous command from buffer */ if(charcount < strlen(prvLine)) { outs(strcpy(&str[charcount], &prvLine[charcount])); current = charcount = strlen(str); orgy -= numLinesToScroll(orgx, orgy, charcount); } break; case KEY_UP: /* get previous command from buffer */ if(!histGet(--histLevel, prvLine, sizeof(prvLine))) ++histLevel; /* failed -> keep current command line */ else { clrcmdline(str, current, maxlen); strcpy(str, prvLine); current = charcount = strlen(str); orgy -= numLinesToScroll(orgx, orgy, charcount); outs(str); histGet(histLevel - 1, prvLine, sizeof(prvLine)); } break; case KEY_DOWN: /* get next command from buffer */ if(histLevel) { clrcmdline(str, current, maxlen); strcpy(prvLine, str); histGet(++histLevel, str, maxlen); current = charcount = strlen(str); orgy -= numLinesToScroll(orgx, orgy, charcount); outs(str); } break; case KEY_F5: /* keep cmdline in F3/UP buffer and move to next line */ strcpy(prvLine, str); clrcmdline(str, current, maxlen); outc('@'); if(orgy >= MAX_Y) { outc('\n'); /* Force scroll */ orgy = MAX_Y; } else { ++orgy; } goxy(orgx, orgy); current = charcount = 0; break; #endif case KEY_LEFT: /* move cursor left */ if(current > 0) { current--; if (wherex() == 1) goxy(MAX_X, wherey() - 1); else goxy(wherex() - 1, wherey()); } break; case KEY_CTRL_LEFT: /* move cursor left to begin of word */ while(current > 0) { current--; if (wherex() == 1) goxy(MAX_X, wherey() - 1); else goxy(wherex() - 1, wherey()); if(isworddelimiter(str[current-1]) /* ignore current == 0 */ && !isworddelimiter(str[current])) break; } break; case KEY_CTRL_RIGHT: /* move cursor right to begin of word */ while(current < charcount) { current++; if (wherex() == MAX_X) goxy(1, wherey() + 1); else goxy(wherex() + 1, wherey()); if(isworddelimiter(str[current-1]) && !isworddelimiter(str[current])) break; } break; default: /* insert character into string... */ if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2))) { if (insert && current != charcount) { for (count = charcount; count > current; count--) str[count] = str[count - 1]; str[current++] = ch; charcount++; curx = wherex() + 1; cury = wherey(); if (curx > MAX_X) { curx = 1; cury++; }; outs(&str[current - 1]); lines = numLinesToScroll(orgx, orgy, charcount); cury -= lines; orgy -= lines; goxy(curx, cury); } else { if (current == charcount) charcount++; str[current++] = ch; outc(ch); lines = numLinesToScroll(orgx, orgy, charcount); orgy -= lines; } } else beep(); break; } #ifdef FEATURE_FILENAME_COMPLETION lastch = ch; #endif } while(ch != KEY_ENTER); _setcursortype(_NORMALCURSOR); } ================================================ FILE: lib/comfile.c ================================================ /* $Id$ * Return the absolute filename of the current COMMAND shell This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/misc.h" char *comFile(void) { char *fnam; if(inInit || (fnam = getEnv("COMSPEC")) == 0) { /* ComPath may be a NULL reference */ if (!ComPath) return strdup(""); return strdup(ComPath); } return fnam; } ================================================ FILE: lib/compfile.c ================================================ /* $Id$ * Construct the path of a file to be located in the same directory * as COMMAND. * Dynamically allocated. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:52 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/misc.h" char *comPathFile(const char * fnam) { char *com, *h; unsigned pathLen; assert(fnam); if((com = comFile()) == 0) return strdup(fnam); h = malloc((pathLen = dfnfilename(com) - com) + strlen(fnam) + 1); if(!h) return 0; memcpy(h, com, pathLen); strcpy(h + pathLen, fnam); free(com); return h; } ================================================ FILE: lib/critend.c ================================================ /* $Id$ Display the result of a CRITER repeat check autofail $Log$ Revision 1.1 2004/09/13 18:59:39 skaus add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} */ #include "../config.h" #include "../include/command.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" void critEndRepCheck(void) { unsigned critCount; if(0 != (critCount = critDisableRepeatCheck())) { displayString(TEXT_HIDDEN_CRITER, critCount); } } ================================================ FILE: lib/critrchk.c ================================================ /* $Id$ Criter repeat check interface $Log$ Revision 1.4 2006/07/02 08:15:10 blairdude #if 0'd out 2 unused functions. Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2005/12/10 10:09:43 perditionc based on patches from Blair Campbell, additional LFN support (slim print, add initial cd,rd,md support, make compile time optional), remove some compiler warnings, and prevent extra linebreak for compatibility Revision 1.1 2004/09/13 18:59:39 skaus add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} */ #include "../config.h" #include #include #include #include #include #include "../include/misc.h" #include "../err_fcts.h" static word far *repCheckAddr = 0; static int drives = 0; #define chkByteArea ((byte far *)(&repCheckAddr[1])) void registerCriterRepeatCheckAddr(word far *p) { if(p) { if(*p == (unsigned)-1) { byte far *q = (byte far *)(&p[1]); while(*q == (byte)-1) { ++drives; ++q; } dprintf(("[CRITER: Repeat check addr %Fp, drives = %u]\n", p, drives)); if(drives) repCheckAddr = p; } else { dprintf(("[CRITER: Invalid repeat check addr given: %Fp]\n", p)); } } } #if 0 /* Unused?? */ void critEnableRepeatCheck(void) { if(drives) { assert(repCheckAddr); _fmemset(chkByteArea, -1, drives); *repCheckAddr = 0; dprintf(("{CRITER: Enabled repeat check]\n")); } } unsigned critDisableRepeatCheck(void) { if(drives) { unsigned count = *repCheckAddr; assert(repCheckAddr); *repCheckAddr = (unsigned)-1; dprintf(("{CRITER: Disabled repeat check: count = %u]\n", count)); return count; } return 0; } #endif #if 0 char *critDriveReport(void) { if(drives) { char *rep = malloc(drives + 1); if(rep) { int i; assert(repCheckAddr); assert(drives > 0 && drives < 256); *rep = drives; _fmemcpy(&rep[1], chkByteArea, drives); for(i = 1; i <= drives; ++i) ++rep[i]; return rep; } else error_out_of_memory(); } return 0; } #endif ================================================ FILE: lib/ctxt.c ================================================ /* $Id$ Dynamic context of the FreeCOM instance */ #include "../config.h" #include "../include/context.h" ctxt_t ctxt = 0; ================================================ FILE: lib/ctxt_adr.c ================================================ /* $Id$ Returns the far address to the value of a specified tag item */ #include "../config.h" #include #include #include #include "../include/context.h" char far*ctxtAddress(const Context_Tag tag, const unsigned num) { char name[CTXT_ITEMNAME_LENGTH]; word ofs, segm; ctxtMkItemName(name, tag, num); segm = ctxtFromTag(tag); assert(segm && segm != CTXT_INVALID); if((ofs = env_findVar(segm, name)) != (word)-1) return MK_FP(segm, ofs + strlen(name) + 1); return 0; } ================================================ FILE: lib/ctxt_as.c ================================================ /* $Id$ Add status entry of a tag into context silent The status is sizemax encoded like this: sizemax | 0x8001 --> neither of the bytes can become 0 Return: E_None on success */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/context.h" #if UINT_MAX != 65535U #error "sizeof(unsigned) != 2 is not supported" #endif int ctxtAddStatus(const Context_Tag tag) { char value[3]; ctxtCheckInfoTag(tag); *(unsigned*)value = CTXT_INFO(tag, sizemax) | 0x8001; value[sizeof(unsigned)] = 0; return ctxtSet(tag, 0, value); } ================================================ FILE: lib/ctxt_chg.c ================================================ /* $Id$ Change the size of the local context. It will never shrink so that stored data is corrupted. If necessary, the context is relocated to another physical location. */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/context.h" #include "../err_fcts.h" int ctxtChgSize(unsigned tosize) { ctxt_t new_context; assert(tosize); env_resizeCtrl = ENV_USEUMB | ENV_FIRSTFIT | ENV_ALLOWMOVE; if(forceLow) env_resizeCtrl &= ~ENV_USEUMB; new_context = ctxt? env_setsize(ctxt, tosize) /* alter context */ : env_create(tosize); /* new context */ if(new_context) { ctxt = new_context; return E_None; } error_out_of_memory(); return E_NoMem; } ================================================ FILE: lib/ctxt_clr.c ================================================ /* $Id$ Clear all items of a specified context tag */ #include "../config.h" #include #include #include "../include/context.h" #include "../include/misc.h" static int clear(void *arg, word segm, word ofs) { assert(segm); assert(ofs != 0xffff); while(ctxtProbeItemTag(segm, ofs, arg)) env_subVarOffset(segm, ofs); return 0; /* proceed loop */ } int ctxtClear(const Context_Tag tag) { ctxt_info_t *info; ctxtCheckInfoTag(tag); assert(ctxtFromTag(tag) != CTXT_INVALID); /* Clear the useage information */ info = &CTXT_INFO_STRUCT(tag); info->c_sizecur = 0; info->c_nummax = info->c_nummin= 0; /* Clear the items within the context */ return env_forAll(ctxtFromTag(tag), clear, (void*)tag); } ================================================ FILE: lib/ctxt_get.c ================================================ /* $Id$ Get the n'th item of the specified context tag. It is duplicated into dynamic memory. Returns: 0: OK 1: no such item 2: out of memory */ #include "../config.h" #include #include #include "environ.h" #include "fmemory.h" #include "../include/context.h" #include "../include/misc.h" int ctxtGet (const int remove, const Context_Tag tag, const unsigned num, char ** const buf) { word ofs, segm; char name[CTXT_ITEMNAME_LENGTH]; ctxtCheckInfoTag(tag); assert(ctxtFromTag(tag) != CTXT_INVALID); segm = (word)ctxtFromTag(tag); assert(segm); ctxtMkItemName(name, tag, num); if((ofs = env_findVar(segm, name)) != (word)-1) { assert(peekb(segm, ofs + strlen(name)) == '='); if(buf) { /* Retreive the contents */ if((*buf = _fdupstr(MK_FP(segm, ofs + strlen(name) + 1))) == 0) return 2; /* out of memory */ } if(remove) { /* remove the item from context */ if(CTXT_INFO(tag, sizecur) < env_varlen(segm, ofs)) CTXT_INFO(tag, sizecur) = 0; /* inconsistent redundant information */ else CTXT_INFO(tag, sizecur) -= env_varlen(segm, ofs); env_subVarOffset(segm, ofs); } return 0; } return 1; /* No such item */ } ================================================ FILE: lib/ctxt_inf.c ================================================ /* $Id$ Context status information */ #include "../config.h" #include "../include/context.h" ctxt_info_t ctxt_info[] = { /* CTXT_TAG_HISTORY */ { HISTORY_DEFAULT_SIZE, 0, 0, 0 } /* CTXT_TAG_DIRSTACK */ ,{ DIRSTACK_DEFAULT_SIZE, 0, 0, 0 } /* CTXT_TAG_BATCH -- sizemax is just a hint */ ,{ BATCH_NESTLEVEL_MIN, 0, 0, 0 } /* CTXT_TAG_LASTDIR */ ,{ (unsigned)-1, 0, 0, 0 } /* CTXT_TAG_SWAPINFO */ ,{ (unsigned)-1, 0, 0, 0 } /* pseudo entries */ /* CTXT_TAG_ALIAS */ ,{ ALIAS_DEFAULT_SIZE, 0, 0, 0 } }; #ifdef __TURBOC__ #if sizeof(ctxt_info) / sizeof(ctxt_info_t) != CTXT_TAG_ALIAS - CTXT_FIRST_TAG + 1 #error "Not all tags have an ctxt_info entry" #endif #endif ================================================ FILE: lib/ctxt_mk.c ================================================ /* $Id$ Create local context The size is currently fixed to the default sizes of stuff located into the context: Aliases, History, Dirstack and a estimated size for batch nesting, shell and external program command line */ #include "../config.h" #include "../include/command.h" #include "../include/context.h" #include "../include/crossjmp.h" #include "../err_fcts.h" void ctxtCreate(void) { unsigned long length; length = MAX_FNAME /* filename of shell */ + MAX_FNAME /* filename of external program */ + CTXT_INFO(CTXT_TAG_BATCH, sizemax) * (MAX_FNAME + 10) #ifdef FEATURE_LAST_DIR + MAX_FNAME #endif #ifdef FEATURE_ALIASES + CTXT_INFO(CTXT_TAG_ALIAS, sizemax) #endif #ifdef FEATURE_HISTORY + CTXT_INFO(CTXT_TAG_HISTORY, sizemax) #endif #ifdef FEATURE_DIRSTACK + CTXT_INFO(CTXT_TAG_DIRSTACK, sizemax) #endif ; if(length > CONTEXT_MAX_SIZE) { error_context_length(length, CONTEXT_MAX_SIZE); length = CONTEXT_MAX_SIZE; } ctxtCreateMemBlock((unsigned)length); #if 0 env_resizeCtrl = ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT; if(forceLow) env_resizeCtrl &= ~ENV_USEUMB; if((ctxt = env_create((unsigned)length)) == 0) { error_out_of_dos_memory(); jmp_fatal(E_NoMem); } dprintf(("[MEM: create context: %u bytes @0x%04x]\n" , (unsigned)length, ctxt)); #endif if(ctxtAddStatus(CTXT_TAG_BATCH) #ifdef FEATURE_ALIASES || ctxtAddStatus(CTXT_TAG_ALIAS) #endif #ifdef FEATURE_HISTORY || ctxtAddStatus(CTXT_TAG_HISTORY) #endif #ifdef FEATURE_DIRSTACK || ctxtAddStatus(CTXT_TAG_DIRSTACK) #endif ) { error_context_add_status(); jmp_fatal(E_CorruptMemory); } } ================================================ FILE: lib/ctxt_mkb.c ================================================ /* $Id$ Creates a block of memory suiteable to hold the context. $Log$ Revision 1.2 2004/06/29 21:57:20 skaus fix: /LOW option Revision 1.1 2002/11/12 18:31:57 skaus add: save/restore session (swap context) {Tom Ehlert} */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/context.h" #include "../include/crossjmp.h" #include "../err_fcts.h" void ctxtCreateMemBlock(unsigned length) { env_resizeCtrl = ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT; if(forceLow) env_resizeCtrl &= ~ENV_USEUMB; if((ctxt = env_create((unsigned)length)) == 0) { error_out_of_dos_memory(); jmp_fatal(E_NoMem); } dprintf(("[MEM: create context: %u bytes @0x%04x]\n" , (unsigned)length, ctxt)); } ================================================ FILE: lib/ctxt_mkn.c ================================================ /* $Id$ Create an item name. */ #include "../config.h" #include #include #include "../include/context.h" void ctxtMkItemName(char * const name , const Context_Tag tag , const unsigned num) { assert(name); if(num) sprintf(name, "%c%04x", (unsigned char)tag, num); else { *name = (unsigned char)tag; name[1] = 0; } } ================================================ FILE: lib/ctxt_pop.c ================================================ /* $Id$ Pops the last added entry of the specified context tag. It is duplicated into dynamic memory. Returns: true on success else displays any appropriate error message except "empty" */ #include "../config.h" #include #include #include "../include/context.h" #include "../include/misc.h" #include "../err_fcts.h" int ctxtPop(const Context_Tag tag, char ** const Xbuf) { ctxt_info_t *info; char *buf; ctxtCheckInfoTag(tag); assert(Xbuf); info = &CTXT_INFO_STRUCT(tag); while(info->c_nummax > info->c_nummin) switch(ctxtGet(1, tag, info->c_nummax--, &buf)) { case 0: /* OK */ *Xbuf = buf; return 1; case 1: /* no such entry */ break; /* --> ifgnore silently */ case 2: /* out of memory */ error_out_of_memory(); return 0; /* will case "context empty" message */ } /* Nothing in the stack ==> make sure it's consistent */ ctxtClear(tag); return 0; } ================================================ FILE: lib/ctxt_psh.c ================================================ /* $Id$ Pushes a new item to the end of the context tag Return: E_None, E_NoMem, E_NoItems */ #include "../config.h" #include #include "../include/context.h" #include "../include/command.h" int ctxtPush(const Context_Tag tag, const char * const buf) { ctxt_info_t *info; ctxtCheckInfoTag(tag); assert(buf); info = &CTXT_INFO_STRUCT(tag); if(info->c_nummax == (unsigned)-1) { /* numbers will wrap -> recalculate them */ ctxtRenumberItems(tag); if(info->c_nummax == (unsigned)-1) return E_NoItems; } if(ctxtSet(tag, info->c_nummax + 1, buf) == E_None) return E_None; return E_NoMem; } ================================================ FILE: lib/ctxt_rnu.c ================================================ /* $Id$ Renumbers all items of the context tag */ #include "../config.h" #include #include #include #include "../include/context.h" #include "../include/command.h" static int renumber(void *arg, word segm, word ofs) { char buf[CTXT_ITEMNAME_LENGTH]; #define tag (Context_Tag)(int)arg assert(segm); assert(ofs != (word)-1); if(ctxtProbeItemTag(segm, ofs, arg)) { ctxtMkItemName(buf, tag, ++CTXT_INFO(tag, nummax)); assert(peekb(segm , ofs + strlen(buf)) == '='); _fmemcpy(MK_FP(segm, ofs), TO_FP(buf), strlen(buf)); } #undef tag return 0; } void ctxtRenumberItems(const Context_Tag tag) { ctxtCheckInfoTag(tag); assert(ctxtFromTag(tag) != CTXT_INVALID); CTXT_INFO(tag, nummin) = CTXT_INFO(tag, nummax) = 0; env_forAll(ctxtFromTag(tag), renumber, (void*)tag); } ================================================ FILE: lib/ctxt_set.c ================================================ /* $Id$ Changes a context tag item Return: E_None on success */ #include "../config.h" #include "../include/context.h" int ctxtSet(const Context_Tag tag , const unsigned num , const char * const value) { char name[CTXT_ITEMNAME_LENGTH]; int rc; ctxtMkItemName(name, tag, num); if((rc = chgCtxt(tag, name, value)) == 0) { /* Update min/max to reflect the added value */ if(CTXT_INFO(tag, nummin) > num) CTXT_INFO(tag, nummin) = num; if(CTXT_INFO(tag, nummax) < num) CTXT_INFO(tag, nummax) = num; } return rc; } ================================================ FILE: lib/ctxt_ss.c ================================================ /* $Id$ Scan status from context Assumes that the entries are in "init" state!! */ #include "../config.h" #include #include #include "environ.h" #include "../include/context.h" static int scan (void * arg, word segm, word ofs) { Context_Tag tag; ctxt_info_t *info; (void)arg; assert(segm); assert(ofs != (word)-1); redo: if((tag = peekb(segm, ofs), ctxtIsInfoTag(tag))) { info = &CTXT_INFO_STRUCT(tag); if(peekb(segm, ofs + 1) == '=' && peekb(segm, ofs + 4) == 0) { /* status entry */ info->c_sizemax = peekw(segm, ofs + 2) & ~0x8001; } else { /* normal entry */ char far *p = MK_FP(segm, ofs + 1); unsigned num; for(num = 0; isxdigit(*p); ++p) { num <<= 8; if(isdigit(*p)) num |= *p & 0xf; else { assert(islower(*p)); num |= *p - 'a' + 10; } } if(*p == '=') { info->c_sizecur += env_varlen(segm, ofs); if(num < info->c_nummin) info->c_nummin = num; if(num > info->c_nummax) info->c_nummax = num; } else { /* Invalid entry -> remove to make room for useful stuff */ env_subVarOffset(segm, ofs); goto redo; } } } else if(tag > ' ') { /* Alias */ CTXT_INFO(CTXT_TAG_ALIAS, sizecur) += env_varlen(segm ,ofs); } return 0; /* proceed */ } void ctxtScanStatus(void) { assert(ctxt); env_forAll(ctxt, scan, 0); } ================================================ FILE: lib/ctxt_vw.c ================================================ /* $Id$ View all entries of the specified type */ #include "../config.h" #include #include #include #include "../include/context.h" #include "../include/misc.h" #include "../strings.h" typedef struct { unsigned char tag; unsigned count; } view_t; /* Because new items are appended to the context, the items are automatically sorted ascending */ static int view (void * arg, word segm, word ofs) { assert(segm); if(ctxtProbeItemTag(segm, ofs, ((view_t*)arg)->tag)) { ++((view_t*)arg)->count; printf("%Fs\n", MK_FP(segm, ofs + 1)); } return 0; /* don't stop */ } int ctxtView(const Context_Tag tag, const unsigned empty) { int rc; view_t param; assert(ctxtFromTag(tag) != CTXT_INVALID); param.tag = (unsigned char)tag; param.count = 0; /* return value == 0 --> OK */ if((rc = env_forAll(ctxtFromTag(tag), view, (void*)¶m)) == 0) { if(param.count) displayString(TEXT_MSG_ITEMS_DISPLAYED, param.count); else displayString(empty); } return rc; } ================================================ FILE: lib/curdatel.c ================================================ /* $Id$ Get the current date in a long format (day_of_week date) in a dynamically allocated buffer This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../include/nls.h" #include "../strings.h" char *curDateLong(void) { struct dosdate_t d; char *date, *h, *p; _dos_getdate(&d); if((date = nls_makedate(0, d.year, d.month, d.day)) == 0) { error_out_of_memory(); return 0; } if((h = getString(TEXT_WEEKDAY_SHORT_NAME_SUNDAY + d.dayofweek)) == 0) { free(date); error_out_of_memory(); return 0; } #ifdef FEATURE_NLS p = malloc(strlen(h) + strlen(date) + 4); if (!p) { free(h); free(date); error_out_of_memory(); return 0; } if (nlsBuf->datefmt == 2) { strcpy(p, date); strcat(p, " ("); strcat(p, h); strcat(p, ")"); } else { strcpy(p, h); strcat(p, " "); strcat(p, date); } free(h); #else if((p = realloc(h, strlen(h) + strlen(date) + 2)) == 0) { free(h); free(date); error_out_of_memory(); return 0; } strcpy(stpcat(p, " "), date); #endif free(date); return p; } ================================================ FILE: lib/curtime.c ================================================ /* $Id$ Get the current time in a dynamically allocated buffer This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../include/nls.h" char *curTime(void) { char *time; struct dostime_t t; _dos_gettime(&t); time = nls_maketime(0, t.hour, t.minute, t.second, t.hsecond); if(!time) error_out_of_memory(); return time; } ================================================ FILE: lib/cwd.c ================================================ /* $Id$ * Retreive the current working directory including drive letter * Returns in a dynamically allocated buffer (free'ed by the caller) * on error: Displays "out of memory" This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" char *cwd(int drive) { char *h; if((h = dfnpath(drive)) != 0) return h; switch(errno) { case ERANGE: dprintf( ("[FATAL: dfnpath() buffer too small]\n") ); case ENOMEM: error_out_of_memory(); break; default: error_no_cwd(drive); } return 0; } ================================================ FILE: lib/dateget.c ================================================ /* $Id$ Get DOS date (for Turbo C prior v3) This file bases on DATEFUNC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef _NO__DOS_DATE /* Use this source only if the compiler does no provide this function of its own. */ #include #include #include #include #include "../include/datefunc.h" void _dos_getdate(struct dosdate_t *d) { IREGS r; assert(d); r.r_ax = 0x2A00; intrpt(0x21, &r); d->year = r.r_cx; d->month = r.r_dx >> 8; d->day = r.r_dx & 0xFF; d->dayofweek = r.r_ax & 0xFF; } #endif /* _NO_DATE */ ================================================ FILE: lib/dateset.c ================================================ /* $Id$ Set DOS date (for Turbo C prior v3) This file bases on DATEFUNC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef _NO__DOS_DATE /* Use this source only if the compiler does no provide this function of its own. */ #include #include #include #include #include "../include/datefunc.h" unsigned _dos_setdate(struct dosdate_t *d) { IREGS r; assert(d); r.r_ax = 0x2B00; r.r_cx = d->year; r.r_dx = d->month << 8; r.r_dx += d->day & 0xFF; intrpt(0x21, &r); if (r.r_ax & 0x00FF) return 1; return 0; } #endif /* _NO_DATE */ ================================================ FILE: lib/dbg_c.c ================================================ /* $Id$ * Defines the functions only necessary while debugging is active This file bases on DEBUG.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef DEBUG void dbg_outc (int ch) { putc (ch, dbg_logfile); } #endif /* DEBUG */ ================================================ FILE: lib/dbg_mem.c ================================================ /* $Id$ * Defines the functions only necessary while debugging is active This file bases on DEBUG.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.4 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.3 2001/06/11 20:45:38 skaus fix: dbg_printmem() #if must be #ifdef Revision 1.2 2001/06/11 20:33:37 skaus fix: dbg_printmem() if compiled in Large memory model, near is invalid Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef DEBUG #include /* cputs */ #ifdef __WATCOMC__ #include /* _heapchk */ #else #include /* heapcheck, coreleft, farcoreleft */ #endif #include /* abort */ #include /* _dos_allocmem */ #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #define DISP_NEAR #endif void dbg_printmem (void) { #ifdef DISP_NEAR static unsigned nearLast = 0; #endif static unsigned long farLast = 0; #ifdef DISP_NEAR unsigned nearThis; #endif unsigned long farThis; #if __TURBOC__ > 0x201 || defined(__WATCOMC__) #ifdef __WATCOMC__ switch(_heapchk()) #else switch(heapcheck()) #endif { #ifdef __WATCOMC__ case _HEAPBADBEGIN: case _HEAPBADNODE: case _HEAPEND: case _HEAPBADPTR: #else case _HEAPCORRUPT: #endif cputs("HEAP CORRUPTED. Cannot proceed!\r\n"); abort(); case _HEAPEMPTY: cputs("NO HEAP. Cannot proceed!\r\n"); abort(); default: cputs("Unknown heapcheck() error. Cannot proceed!\r\n"); abort(); case _HEAPOK: dprintf( ("HEAP: OK\r\n") ); break; } #endif #ifdef __WATCOMC__ #ifdef DISP_NEAR nearThis = _memavl(); #endif { unsigned avail; _dos_allocmem(0xffff, &avail); farThis = (unsigned long)avail << 4; } #else #ifdef DISP_NEAR nearThis = coreleft(); #endif farThis = farcoreleft(); #endif #ifdef DISP_NEAR dprintf(("[free memory: near=%6u far=%13lu]\n", nearThis, farThis)); if(nearLast) dprintf(("[changed : near=%6d far=%13ld]\n" , nearThis - nearLast , farThis - farLast)); #else dprintf(("[free memory: far=%13lu]\n", farThis)); if(farLast) dprintf(("[changed : far=%13ld]\n", farThis - farLast)); #endif #ifdef DISP_NEAR nearLast = nearThis; #endif farLast = farThis; } #endif /* DEBUG */ ================================================ FILE: lib/dbg_prnt.c ================================================ /* $Id$ * Defines the functions only necessary while debugging is active This file bases on DEBUG.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef DEBUG #include #include "../include/misc.h" FILE *dbg_logfile = stdout; char *dbg_logname /*= NULL*/; void dbg_print(const char fmt[], ...) { va_list ap; va_start(ap, fmt); vfprintf(dbg_logfile, fmt, ap); va_end(ap); fflush(dbg_logfile); } #endif /* DEBUG */ ================================================ FILE: lib/dbg_s.c ================================================ /* $Id$ * Defines the functions only necessary while debugging is active This file bases on DEBUG.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:36:10 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef DEBUG void dbg_outs (const char *const s) { if (s) { fputs (s, dbg_logfile); fflush (dbg_logfile); } } #endif /* DEBUG */ ================================================ FILE: lib/dbg_sn.c ================================================ /* $Id$ * Defines the functions only necessary while debugging is active This file bases on DEBUG.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef DEBUG void dbg_outsn (const char *const s) { if (s) fputs (s, dbg_logfile); dbg_outs ("\n"); } #endif /* DEBUG */ ================================================ FILE: lib/delay.c ================================================ /* $Id: $ delay function for ia16-elf-gcc with newlib uses _dos_gettime, only for delays < 1 minute (60000 ms) */ #include "../config.h" #ifdef __GNUC__ #include #include "../include/timefunc.h" void delay(unsigned ms) { struct dostime_t t; int diff, cnt = -1, v; while (1) { _dos_gettime(&t); v = 100 * t.second + t.hsecond; if (cnt == -1) cnt = v; diff = v - cnt; if (diff < 0) diff += 6000; if (diff >= ms/10) break; asm volatile ("int $0x28"); } } #endif ================================================ FILE: lib/depend.mk ================================================ lib .SEQUENTIAL : utils err_fcts.h strings context lib_dir lib_dir .SETDIR=lib : @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += lib_clean lib_clean .SETDIR=lib : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += lib_clobber lib_clobber .SETDIR=lib : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += lib_dist lib_dist .SETDIR=lib : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: lib/devopen.c ================================================ /* $Id$ like open() supporting device names This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/19 04:12:46 blairdude File redirection now supports long filenames, bug fixed in __creat_or_truncate Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #if defined (__TURBOC__) # include #endif #include "../include/openf.h" #include "../include/misc.h" #include "../include/lfnfuncs.h" int devopen(char *const fnam, int mode) { int fd; isDeviceName(fnam); /* modify fnam if device */ fd = -1; if((mode & (O_CREAT|O_TRUNC)) != (O_CREAT|O_TRUNC)) fd = dos_open(fnam, mode & ~(O_APPEND|O_CREAT|O_TRUNC)); if(fd == -1 && (mode & O_CREAT)) return dos_creat(fnam, 0); if (mode & O_APPEND) lseek(fd, 0, SEEK_END); return fd; } ================================================ FILE: lib/dfn_err.c ================================================ /* $Id$ Display a nice errno-depend error message for dfn*() functions. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL */ #include "../config.h" #include #include #include "../err_fcts.h" #include "../include/misc.h" void display_errno_fnam_error(const char * const fnam) { assert(fnam); switch(errno) { case ERANGE: dprintf( ("[FATAL: dfnpath() buffer too small]\n") ); case ENOMEM: error_out_of_memory(); break; default: error_sfile_not_found(fnam); } } ================================================ FILE: lib/dispcnt.c ================================================ /* $Id$ * Display the result of a count Differs between 0, 1, and more hits/counts This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void dispCount(int cnt, unsigned base_id) { switch(cnt) { case 0: displayString(base_id); break; case 1: displayString(base_id + 1); break; default: displayString(base_id + 2, cnt); break; } } ================================================ FILE: lib/dispexit.c ================================================ /* Note: this is file here to allow compilation and is not in FreeCom's cvs, as I'm sure Steffen has an implementation already. */ #include "../config.h" #ifdef DISP_EXITCODE #include "../include/misc.h" #include "../strings.h" int exitReason; /* defined in dispexit.c, set in exec1.c, reason program terminated */ extern int dispExitcode; /* defined in shell/init.c, nonzero to display (/Z) */ extern int errorlevel; /* defined ???, holds errorlevel command returned, set in exec1.c */ void displayExitcode(void) { if (dispExitcode) { /* printf("Return code (ERRORLEVEL): %i\n", errorlevel); */ /* Exit code (ERRORLEVEL): %u, reason: %u (%s) */ displayString(TEXT_DISP_EXITCODE, errorlevel, exitReason, (!exitReason)?getMessage(TEXT_EXIT_REASON_0): /* 0==normal */ (exitReason==1)?getMessage(TEXT_EXIT_REASON_1): /* Ctrl-Break */ (exitReason==2)?getMessage(TEXT_EXIT_REASON_2): /* Critical Error */ (exitReason==3)?getMessage(TEXT_EXIT_REASON_3): /* TSR ??? */ (exitReason==-1)?getMessage(TEXT_EXIT_REASON_NEG_1): /* DOS API error */ "Unknown" ); } } #endif /* DISP_EXITCODE */ ================================================ FILE: lib/drvnum.c ================================================ /* $Id$ Returns the number of a drive (0..31) 0 -> current drive 1..32 -> input - 1 else -> input - 'A' This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" int drvNum(int drive) { if(drive == 0) /* change to current drive */ return getdisk(); if(drive <= 32) return drive - 1; return toupper(drive) - 'A'; } ================================================ FILE: lib/efct_001.c ================================================ /* $Id$ Error printing function providing a wrapper for STRINGS This file bases on ERROR.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include "../include/command.h" #include "../err_fcts.h" #include "../strings.h" void error_env(int base, int err_no, const char * const var) { switch(err_no) { case -1: displayString(/*TEXT_ERROR_SET_ENV_VAR*/ base+1, var); break; case -2: displayString(/*TEXT_ERROR_ENV_VAR_NOT_FOUND*/ base+2, var); break; case -4: displayString(/*TEXT_ERROR_NO_ENVIRONMENT*/ base+3); case 0: break; default: displayString(TEXT_ERROR_SYNTAX); break; } } ================================================ FILE: lib/err1.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_switch void error_invalid_switch(char c) { displayError(TEXT_ERROR_INVALID_SWITCH, c); } ================================================ FILE: lib/err10.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_out_of_memory void error_out_of_memory(void) { displayError(TEXT_ERROR_OUT_OF_MEMORY); } ================================================ FILE: lib/err11.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_syntax void error_syntax(const char * const s) { displayError(s? TEXT_ERROR_SYNTAX_STR: TEXT_ERROR_SYNTAX, s); } ================================================ FILE: lib/err12.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_nothin_to_do void error_nothin_to_do(void) { displayError(TEXT_ERROR_NOTHING_TO_DO); } ================================================ FILE: lib/err13.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_selfcopy void error_selfcopy(const char * const s) { displayError(TEXT_ERROR_SELFCOPY, s); } ================================================ FILE: lib/err14.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_long_batchline void error_long_batchline(const char * const fnam, long linenr) { displayError(TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, fnam); } ================================================ FILE: lib/err15.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_bfile_vanished void error_bfile_vanished(const char * const fnam) { displayError(TEXT_ERROR_BFILE_VANISHED, fnam); } ================================================ FILE: lib/err16.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_bfile_no_such_label void error_bfile_no_such_label(const char * const fnam, const char * const label) { displayError(TEXT_ERROR_BFILE_LABEL, fnam, label); } ================================================ FILE: lib/err17.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_time void error_invalid_time(void) { displayError(TEXT_ERROR_INVALID_TIME); } ================================================ FILE: lib/err18.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_env_var void error_env_var(const char * const var) { displayError(TEXT_ERROR_SET_ENV_VAR, var); } ================================================ FILE: lib/err19.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_env_var_not_found void error_env_var_not_found(const char * const var) { displayError(TEXT_ERROR_ENV_VAR_NOT_FOUND, var); } ================================================ FILE: lib/err2.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_lswitch void error_invalid_lswitch(const char * const str) { displayError(TEXT_ERROR_INVALID_LSWITCH, str); } ================================================ FILE: lib/err20.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_filename_too_long void error_filename_too_long(const char * const fname) { displayError(TEXT_ERROR_FILENAME_TOO_LONG, fname); } ================================================ FILE: lib/err21.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_command_too_long void error_command_too_long(void) { displayError(TEXT_ERROR_COMMAND_TOO_LONG); } ================================================ FILE: lib/err22.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_line_too_long void error_line_too_long(void) { displayError(TEXT_ERROR_LINE_TOO_LONG); } ================================================ FILE: lib/err23.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_tempfile void error_tempfile(void) { displayError(TEXT_ERROR_TEMPFILE); } ================================================ FILE: lib/err24.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_close_quote void error_close_quote(int quote) { displayError(TEXT_ERROR_CLOSE_QUOTE, quote); } ================================================ FILE: lib/err25.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_illformed_option void error_illformed_option(const char * const s) { displayError(TEXT_ERROR_ILLFORMED_OPTION, s); } ================================================ FILE: lib/err26.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_opt_arg void error_opt_arg(const char * const str) { displayError(TEXT_ERROR_OPT_ARG, str); } ================================================ FILE: lib/err27.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_opt_noarg void error_opt_noarg(const char * const str) { displayError(TEXT_ERROR_OPT_NOARG, str); } ================================================ FILE: lib/err28.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_leading_plus void error_leading_plus(void) { displayError(TEXT_ERROR_LEADING_PLUS); } ================================================ FILE: lib/err29.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_trailing_plus void error_trailing_plus(void) { displayError(TEXT_ERROR_TRAILING_PLUS); } ================================================ FILE: lib/err3.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_too_many_parameters void error_too_many_parameters(const char * const s) { displayError(TEXT_ERROR_TOO_MANY_PARAMETERS_STR, s); } ================================================ FILE: lib/err30.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_open_file void error_open_file(const char * const fnam) { displayError(TEXT_ERROR_OPEN_FILE, fnam); } ================================================ FILE: lib/err31.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_read_file void error_read_file(const char * const fnam) { displayError(TEXT_ERROR_READ_FILE, fnam); } ================================================ FILE: lib/err32.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_write_file void error_write_file(const char * const fnam) { displayError(TEXT_ERROR_WRITE_FILE, fnam); } ================================================ FILE: lib/err33.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_write_file_disc_full void error_write_file_disc_full(const char * const fnam, const unsigned long size) { displayError(TEXT_ERROR_WRITE_FILE_DISC_FULL, fnam, size); } ================================================ FILE: lib/err34.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_copy void error_copy(void) { displayError(TEXT_ERROR_COPY); } ================================================ FILE: lib/err35.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_nothing_to_do void error_nothing_to_do(void) { displayError(TEXT_ERROR_NOTHING_TO_DO); } ================================================ FILE: lib/err36.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_number void error_invalid_number(const char * const s) { displayError(TEXT_INVALID_NUMBER, s); } ================================================ FILE: lib/err37.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_init_fully_qualified void error_init_fully_qualified(const char * const s) { displayError(TEXT_INIT_FULLY_QUALIFIED, s); } ================================================ FILE: lib/err38.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_corrupt_command_line void error_corrupt_command_line(void) { displayError(TEXT_CORRUPT_COMMAND_LINE); } ================================================ FILE: lib/err39.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_quoted_c_k void error_quoted_c_k(void) { displayError(TEXT_QUOTED_C_OR_K); } ================================================ FILE: lib/err4.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_path_not_found void error_path_not_found(void) { displayError(TEXT_ERROR_PATH_NOT_FOUND); } ================================================ FILE: lib/err40.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_ctty_excluded void error_ctty_excluded(void) { displayError(TEXT_CTTY_NOTIMPLEMENTED); } ================================================ FILE: lib/err41.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_l_notimplemented void error_l_notimplemented(void) { displayError(TEXT_ERROR_L_NOTIMPLEMENTED); } ================================================ FILE: lib/err42.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_u_notimplemented void error_u_notimplemented(void) { displayError(TEXT_ERROR_U_NOTIMPLEMENTED); } ================================================ FILE: lib/err43.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_restore_session void error_restore_session(void) { displayError(TEXT_ERROR_RESTORE_SESSION); } ================================================ FILE: lib/err44.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_save_session void error_save_session(void) { displayError(TEXT_ERROR_SAVE_SESSION); } ================================================ FILE: lib/err45.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_rw_device void error_no_rw_device(const char * const devname) { displayError(TEXT_ERROR_NORW_DEVICE, devname); } ================================================ FILE: lib/err46.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_ctty_dup void error_ctty_dup(const char * const devname) { displayError(TEXT_ERROR_CTTY_DUP, devname); } ================================================ FILE: lib/err47.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_cwd void error_no_cwd(int drive) { displayError(TEXT_ERROR_CWD_FAILED, drvNum(drive) + 'A'); } ================================================ FILE: lib/err48.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_kswap_alias_size void error_kswap_alias_size(void) { displayError(TEXT_ERROR_KSWAP_ALIAS_SIZE); } ================================================ FILE: lib/err49.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_kswap_allocmem void error_kswap_allocmem(void) { displayError(TEXT_ERROR_KSWAP_ALLOCMEM); } ================================================ FILE: lib/err5.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_file_not_found void error_file_not_found(void) { displayError(TEXT_ERROR_FILE_NOT_FOUND); } ================================================ FILE: lib/err50.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_if_exist void error_if_exist(void) { displayError(TEXT_ERROR_IF_EXIST_NO_FILENAME); } ================================================ FILE: lib/err51.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_if_errorlevel void error_if_errorlevel(void) { displayError(TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER); } ================================================ FILE: lib/err52.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_if_errorlevel_number void error_if_errorlevel_number(void) { displayError(TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER); } ================================================ FILE: lib/err53.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_if_command void error_if_command(void) { displayError(TEXT_ERROR_IF_MISSING_COMMAND); } ================================================ FILE: lib/err54.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_alias_out_of_memory void error_alias_out_of_memory(void) { displayError(TEXT_ERROR_ALIAS_OUT_OF_MEM); } ================================================ FILE: lib/err55.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_alias_insert void error_alias_insert(void) { displayError(TEXT_ERROR_ALIAS_INSERT); } ================================================ FILE: lib/err56.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_alias_no_such void error_alias_no_such(const char * const name) { displayError(TEXT_ERROR_ALIAS_NO_SUCH, name); } ================================================ FILE: lib/err57.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_loading_context void error_loading_context(void) { displayError(TEXT_ERROR_LOADING_CONTEXT); } ================================================ FILE: lib/err58.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_dirfct_failed void error_dirfct_failed(const char * const fctname, const char * const dirname) { displayError(TEXT_ERROR_DIRFCT_FAILED, fctname, dirname); } ================================================ FILE: lib/err59.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_alias_name void error_no_alias_name(const char name[]) { displayError(TEXT_ALIAS_INVALID_NAME, name); } ================================================ FILE: lib/err6.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_sfile_not_found void error_sfile_not_found(const char * const f) { displayError(TEXT_ERROR_SFILE_NOT_FOUND, f); } ================================================ FILE: lib/err60.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_history_size void error_history_size(const char s[]) { displayError(TEXT_ERROR_HISTORY_SIZE, s); } ================================================ FILE: lib/err61.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_context_out_of_memory void error_context_out_of_memory(void) { #ifndef NO_CONTEXT_ERROR displayError(TEXT_ERROR_CONTEXT_OUT_OF_MEMORY); #endif } ================================================ FILE: lib/err62.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_context_after_swap void error_no_context_after_swap(void) { displayError(TEXT_ERROR_CONTEXT_AFTER_SWAP); } ================================================ FILE: lib/err63.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_out_of_dos_memory void error_out_of_dos_memory(void) { displayError(TEXT_ERROR_OUT_OF_DOS_MEMORY); } ================================================ FILE: lib/err64.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_context_length void error_context_length(unsigned long islen, unsigned maxlen) { displayError(TEXT_ERROR_CONTEXT_LENGTH, islen, maxlen); } ================================================ FILE: lib/err65.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_context_add_status void error_context_add_status(void) { displayError(TEXT_ERROR_CONTEXT_ADD_STATUS); } ================================================ FILE: lib/err66.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_empty_redirection void error_empty_redirection(void) { displayError(TEXT_ERROR_EMPTY_REDIRECTION); } ================================================ FILE: lib/err67.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_redirect_from_file void error_redirect_from_file(const char * const fnam) { displayError(TEXT_ERROR_REDIRECT_FROM_FILE, fnam); } ================================================ FILE: lib/err68.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_redirect_to_file void error_redirect_to_file(const char * const fnam) { displayError(TEXT_ERROR_REDIRECT_TO_FILE, fnam); } ================================================ FILE: lib/err69.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_bad_mcb_chain void error_bad_mcb_chain(void) { displayError(TEXT_ERROR_BAD_MCB_CHAIN); } ================================================ FILE: lib/err7.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_req_param_missing void error_req_param_missing(void) { displayError(TEXT_ERROR_REQ_PARAM_MISSING); } ================================================ FILE: lib/err70.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_unknown void error_unknown(int err) { displayError(TEXT_ERROR_UNDEFINED_ERROR, err); } ================================================ FILE: lib/err71.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_drive void error_invalid_drive(int drive) { displayError(TEXT_ERROR_INVALID_DRIVE, drive + 'A'); } ================================================ FILE: lib/err72.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_env void error_no_env(void) { displayError(TEXT_ERROR_NO_ENVIRONMENT); } ================================================ FILE: lib/err73.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_on_off void error_on_off(void) { displayError(TEXT_ERROR_ON_OR_OFF); } ================================================ FILE: lib/err74.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_date void error_invalid_date(void) { displayError(TEXT_ERROR_INVALID_DATE); } ================================================ FILE: lib/err75.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_for_bad_var void error_for_bad_var(void) { displayError(TEXT_ERROR_BAD_VARIABLE); } ================================================ FILE: lib/err76.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_for_in void error_for_in(void) { displayError(TEXT_ERROR_IN_MISSING); } ================================================ FILE: lib/err77.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_for_parens void error_for_parens(void) { displayError(TEXT_ERROR_MISSING_PARENTHESES); } ================================================ FILE: lib/err78.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_for_do void error_for_do(void) { displayError(TEXT_ERROR_DO_MISSING); } ================================================ FILE: lib/err79.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_for_no_command void error_for_no_command(void) { displayError(TEXT_ERROR_NO_COMMAND_AFTER_DO); } ================================================ FILE: lib/err8.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_bad_command void error_bad_command(const char * const f) { displayError(TEXT_ERROR_BADCOMMAND, f); } ================================================ FILE: lib/err80.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_goto_label void error_goto_label(void) { displayError(TEXT_ERROR_NO_GOTO_LABEL); } ================================================ FILE: lib/err81.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_get_codepage void error_get_codepage(void) { displayError(TEXT_ERROR_GET_CODEPAGE); } ================================================ FILE: lib/err82.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_set_codepage void error_set_codepage(void) { displayError(TEXT_ERROR_SET_CODEPAGE); } ================================================ FILE: lib/err83.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_copy_plus_destination void error_copy_plus_destination(void) { displayError(TEXT_ERROR_COPY_PLUS_DESTINATION); } ================================================ FILE: lib/err84.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_invalid_parameter void error_invalid_parameter(const char * const str) { displayError(TEXT_ERROR_INVALID_PARAMETER, str); } ================================================ FILE: lib/err85.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_fcom_is_device void error_fcom_is_device(const char * const fnam) { displayError(TEXT_ERROR_FCOM_IS_DEVICE, fnam); } ================================================ FILE: lib/err86.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_fcom_invalid void error_fcom_invalid(const char * const fnam) { displayError(TEXT_ERROR_FCOM_INVALID, fnam); } ================================================ FILE: lib/err87.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_exe_corrupt void error_exe_corrupt(void) { displayError(TEXT_ERROR_EXE_CORRUPT); } ================================================ FILE: lib/err9.c ================================================ /* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include "../config.h" #include "../include/misc.h" #include "../err_fcts.h" #include "../strings.h" #undef error_no_pipe void error_no_pipe(void) { displayError(TEXT_ERROR_CANNOTPIPE); } ================================================ FILE: lib/err_fcts.mk ================================================ SRC_ERR = \ err1.c \ err2.c \ err3.c \ err4.c \ err5.c \ err6.c \ err7.c \ err8.c \ err9.c \ err10.c \ err11.c \ err12.c \ err13.c \ err14.c \ err15.c \ err16.c \ err17.c \ err18.c \ err19.c \ err20.c \ err21.c \ err22.c \ err23.c \ err24.c \ err25.c \ err26.c \ err27.c \ err28.c \ err29.c \ err30.c \ err31.c \ err32.c \ err33.c \ err34.c \ err35.c \ err36.c \ err37.c \ err38.c \ err39.c \ err40.c \ err41.c \ err42.c \ err43.c \ err44.c \ err45.c \ err46.c \ err47.c \ err48.c \ err49.c \ err50.c \ err51.c \ err52.c \ err53.c \ err54.c \ err55.c \ err56.c \ err57.c \ err58.c \ err59.c \ err60.c \ err61.c \ err62.c \ err63.c \ err64.c \ err65.c \ err66.c \ err67.c \ err68.c \ err69.c \ err70.c \ err71.c \ err72.c \ err73.c \ err74.c \ err75.c \ err76.c \ err77.c \ err78.c \ err79.c \ err80.c \ err81.c \ err82.c \ err83.c \ err84.c \ err85.c \ err86.c \ err87.c OBJ_ERR = \ err1.obj \ err2.obj \ err3.obj \ err4.obj \ err5.obj \ err6.obj \ err7.obj \ err8.obj \ err9.obj \ err10.obj \ err11.obj \ err12.obj \ err13.obj \ err14.obj \ err15.obj \ err16.obj \ err17.obj \ err18.obj \ err19.obj \ err20.obj \ err21.obj \ err22.obj \ err23.obj \ err24.obj \ err25.obj \ err26.obj \ err27.obj \ err28.obj \ err29.obj \ err30.obj \ err31.obj \ err32.obj \ err33.obj \ err34.obj \ err35.obj \ err36.obj \ err37.obj \ err38.obj \ err39.obj \ err40.obj \ err41.obj \ err42.obj \ err43.obj \ err44.obj \ err45.obj \ err46.obj \ err47.obj \ err48.obj \ err49.obj \ err50.obj \ err51.obj \ err52.obj \ err53.obj \ err54.obj \ err55.obj \ err56.obj \ err57.obj \ err58.obj \ err59.obj \ err60.obj \ err61.obj \ err62.obj \ err63.obj \ err64.obj \ err65.obj \ err66.obj \ err67.obj \ err68.obj \ err69.obj \ err70.obj \ err71.obj \ err72.obj \ err73.obj \ err74.obj \ err75.obj \ err76.obj \ err77.obj \ err78.obj \ err79.obj \ err80.obj \ err81.obj \ err82.obj \ err83.obj \ err84.obj \ err85.obj \ err86.obj \ err87.obj err1.obj : err1.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err2.obj : err2.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err3.obj : err3.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err4.obj : err4.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err5.obj : err5.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err6.obj : err6.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err7.obj : err7.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err8.obj : err8.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err9.obj : err9.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err10.obj : err10.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err11.obj : err11.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err12.obj : err12.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err13.obj : err13.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err14.obj : err14.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err15.obj : err15.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err16.obj : err16.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err17.obj : err17.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err18.obj : err18.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err19.obj : err19.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err20.obj : err20.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err21.obj : err21.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err22.obj : err22.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err23.obj : err23.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err24.obj : err24.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err25.obj : err25.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err26.obj : err26.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err27.obj : err27.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err28.obj : err28.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err29.obj : err29.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err30.obj : err30.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err31.obj : err31.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err32.obj : err32.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err33.obj : err33.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err34.obj : err34.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err35.obj : err35.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err36.obj : err36.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err37.obj : err37.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err38.obj : err38.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err39.obj : err39.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err40.obj : err40.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err41.obj : err41.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err42.obj : err42.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err43.obj : err43.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err44.obj : err44.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err45.obj : err45.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err46.obj : err46.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err47.obj : err47.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err48.obj : err48.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err49.obj : err49.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err50.obj : err50.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err51.obj : err51.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err52.obj : err52.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err53.obj : err53.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err54.obj : err54.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err55.obj : err55.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err56.obj : err56.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err57.obj : err57.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err58.obj : err58.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err59.obj : err59.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err60.obj : err60.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err61.obj : err61.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err62.obj : err62.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err63.obj : err63.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err64.obj : err64.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err65.obj : err65.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err66.obj : err66.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err67.obj : err67.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err68.obj : err68.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err69.obj : err69.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err70.obj : err70.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err71.obj : err71.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err72.obj : err72.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err73.obj : err73.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err74.obj : err74.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err75.obj : err75.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err76.obj : err76.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err77.obj : err77.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err78.obj : err78.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err79.obj : err79.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err80.obj : err80.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err81.obj : err81.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err82.obj : err82.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err83.obj : err83.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err84.obj : err84.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err85.obj : err85.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err86.obj : err86.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h err87.obj : err87.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h ================================================ FILE: lib/err_fcts.src ================================================ error_invalid_switch(char c):=TEXT_ERROR_INVALID_SWITCH, c error_invalid_lswitch(const char * const str):=TEXT_ERROR_INVALID_LSWITCH, str error_too_many_parameters(const char * const s):=TEXT_ERROR_TOO_MANY_PARAMETERS_STR, s error_path_not_found:=TEXT_ERROR_PATH_NOT_FOUND error_file_not_found:=TEXT_ERROR_FILE_NOT_FOUND error_sfile_not_found(const char * const f):=TEXT_ERROR_SFILE_NOT_FOUND, f error_req_param_missing:=TEXT_ERROR_REQ_PARAM_MISSING error_bad_command(const char * const f):=TEXT_ERROR_BADCOMMAND, f error_no_pipe:=TEXT_ERROR_CANNOTPIPE error_out_of_memory:=TEXT_ERROR_OUT_OF_MEMORY error_syntax(const char * const s):=s? TEXT_ERROR_SYNTAX_STR: TEXT_ERROR_SYNTAX, s error_nothin_to_do:=TEXT_ERROR_NOTHING_TO_DO error_selfcopy(const char * const s):=TEXT_ERROR_SELFCOPY, s error_long_batchline(const char * const fnam, long linenr):=TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, fnam error_bfile_vanished(const char * const fnam):=TEXT_ERROR_BFILE_VANISHED, fnam error_bfile_no_such_label(const char * const fnam, const char * const label):=TEXT_ERROR_BFILE_LABEL, fnam, label error_invalid_time:=TEXT_ERROR_INVALID_TIME error_env_var(const char * const var):=TEXT_ERROR_SET_ENV_VAR, var error_env_var_not_found(const char * const var):=TEXT_ERROR_ENV_VAR_NOT_FOUND, var error_filename_too_long(const char * const fname):=TEXT_ERROR_FILENAME_TOO_LONG, fname error_command_too_long:=TEXT_ERROR_COMMAND_TOO_LONG error_line_too_long:=TEXT_ERROR_LINE_TOO_LONG error_tempfile:=TEXT_ERROR_TEMPFILE error_close_quote(int quote):=TEXT_ERROR_CLOSE_QUOTE, quote error_illformed_option(const char * const s):=TEXT_ERROR_ILLFORMED_OPTION, s error_opt_arg(const char * const str):=TEXT_ERROR_OPT_ARG, str error_opt_noarg(const char * const str):=TEXT_ERROR_OPT_NOARG, str error_leading_plus:=TEXT_ERROR_LEADING_PLUS error_trailing_plus:=TEXT_ERROR_TRAILING_PLUS error_open_file(const char * const fnam):=TEXT_ERROR_OPEN_FILE, fnam error_read_file(const char * const fnam):=TEXT_ERROR_READ_FILE, fnam error_write_file(const char * const fnam):=TEXT_ERROR_WRITE_FILE, fnam error_write_file_disc_full(const char * const fnam, const unsigned long size):=TEXT_ERROR_WRITE_FILE_DISC_FULL, fnam, size error_copy:=TEXT_ERROR_COPY error_nothing_to_do:=TEXT_ERROR_NOTHING_TO_DO error_invalid_number(const char * const s):=TEXT_INVALID_NUMBER, s error_init_fully_qualified(const char * const s):=TEXT_INIT_FULLY_QUALIFIED, s error_corrupt_command_line:=TEXT_CORRUPT_COMMAND_LINE error_quoted_c_k:=TEXT_QUOTED_C_OR_K error_ctty_excluded:=TEXT_CTTY_NOTIMPLEMENTED error_l_notimplemented:=TEXT_ERROR_L_NOTIMPLEMENTED error_u_notimplemented:=TEXT_ERROR_U_NOTIMPLEMENTED error_restore_session:=TEXT_ERROR_RESTORE_SESSION error_save_session:=TEXT_ERROR_SAVE_SESSION error_no_rw_device(const char * const devname):=TEXT_ERROR_NORW_DEVICE, devname error_ctty_dup(const char * const devname):=TEXT_ERROR_CTTY_DUP, devname error_no_cwd(int drive):=TEXT_ERROR_CWD_FAILED, drvNum(drive) + 'A' error_kswap_alias_size:=TEXT_ERROR_KSWAP_ALIAS_SIZE error_kswap_allocmem:=TEXT_ERROR_KSWAP_ALLOCMEM error_if_exist:=TEXT_ERROR_IF_EXIST_NO_FILENAME error_if_errorlevel:=TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER error_if_errorlevel_number:=TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER error_if_command:=TEXT_ERROR_IF_MISSING_COMMAND error_alias_out_of_memory:=TEXT_ERROR_ALIAS_OUT_OF_MEM error_alias_insert:=TEXT_ERROR_ALIAS_INSERT error_alias_no_such(const char * const name):=TEXT_ERROR_ALIAS_NO_SUCH, name error_loading_context:=TEXT_ERROR_LOADING_CONTEXT error_dirfct_failed(const char * const fctname, const char * const dirname):=TEXT_ERROR_DIRFCT_FAILED, fctname, dirname error_no_alias_name(const char name[]):=TEXT_ALIAS_INVALID_NAME, name error_history_size(const char s[]):=TEXT_ERROR_HISTORY_SIZE, s error_context_out_of_memory:=TEXT_ERROR_CONTEXT_OUT_OF_MEMORY error_no_context_after_swap:=TEXT_ERROR_CONTEXT_AFTER_SWAP error_out_of_dos_memory:=TEXT_ERROR_OUT_OF_DOS_MEMORY error_context_length(unsigned long islen, unsigned maxlen):=TEXT_ERROR_CONTEXT_LENGTH, islen, maxlen error_context_add_status:=TEXT_ERROR_CONTEXT_ADD_STATUS error_empty_redirection:=TEXT_ERROR_EMPTY_REDIRECTION error_redirect_from_file(const char * const fnam):=TEXT_ERROR_REDIRECT_FROM_FILE, fnam error_redirect_to_file(const char * const fnam):=TEXT_ERROR_REDIRECT_TO_FILE, fnam error_bad_mcb_chain:=TEXT_ERROR_BAD_MCB_CHAIN error_unknown(int err):=TEXT_ERROR_UNDEFINED_ERROR, err error_invalid_drive(int drive):=TEXT_ERROR_INVALID_DRIVE, drive + 'A' error_no_env:=TEXT_ERROR_NO_ENVIRONMENT error_on_off:=TEXT_ERROR_ON_OR_OFF error_invalid_date:=TEXT_ERROR_INVALID_DATE error_for_bad_var:=TEXT_ERROR_BAD_VARIABLE error_for_in:=TEXT_ERROR_IN_MISSING error_for_parens:=TEXT_ERROR_MISSING_PARENTHESES error_for_do:=TEXT_ERROR_DO_MISSING error_for_no_command:=TEXT_ERROR_NO_COMMAND_AFTER_DO error_goto_label:=TEXT_ERROR_NO_GOTO_LABEL error_get_codepage:=TEXT_ERROR_GET_CODEPAGE error_set_codepage:=TEXT_ERROR_SET_CODEPAGE error_copy_plus_destination:=TEXT_ERROR_COPY_PLUS_DESTINATION error_invalid_parameter(const char * const str):=TEXT_ERROR_INVALID_PARAMETER, str error_fcom_is_device(const char * const fnam):=TEXT_ERROR_FCOM_IS_DEVICE, fnam error_fcom_invalid(const char * const fnam):=TEXT_ERROR_FCOM_INVALID, fnam error_exe_corrupt:=TEXT_ERROR_EXE_CORRUPT ================================================ FILE: lib/exec.c ================================================ /* $Id$ Execute an external program using DOS-4B-00 This file bases on EXEC.C of FreeCOM v0.81 beta 1. Returns: DOS error code of DOS-4B $Log$ Revision 1.7 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.6 2004/10/25 19:37:34 skaus fix: LH: Errorlevel of program effects LH's error reporting {Eric Auer} Revision 1.5 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.4 2003/03/05 17:43:52 skaus bugfix: cached NLS data not flushed Revision 1.3 2002/11/12 18:31:57 skaus add: save/restore session (swap context) {Tom Ehlert} Revision 1.2 2002/04/02 18:09:31 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../include/cswap.h" #include "../include/nls.h" #include "algnbyte.h" #if defined(__WATCOMC__) || defined(__GNUC__) struct fcb { char bytes[0x25]; }; #ifdef __WATCOMC__ char *parsfnm(const char *cmdline, struct fcb far *fcbptr, int option); #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #pragma aux parsfnm = \ "mov ah, 29h" \ "int 21h" \ "inc al" \ "jnz ok" \ "xor si, si" \ "ok:" \ __parm [__si] [__es __di] [__ax] __value [__si] __modify [__ax __es] #else #pragma aux parsfnm = \ "mov ah, 29h" \ "int 21h" \ "inc al" \ "jnz ok" \ "xor si, si" \ "ok:" \ __parm [__ds __si] [__es __di] [__ax] __value [__ds __si] __modify [__ax __es] #endif #else /* __GNUC__ */ static char *parsfnm(const char *cmdline, struct fcb far *fcbptr, int option) { char *ret; unsigned char opt = option; asm volatile("int $0x21" : "=S"(ret), "+Ral"(opt) : "Rah"((unsigned char)0x29), "e"(FP_SEG(fcbptr)), "D"(FP_OFF(fcbptr)), "Rds"(FP_SEG(cmdline)), "0"(cmdline) : "cc", "memory"); return opt == 0xff ? NULL : ret; } #endif #endif struct ExecBlock { word segOfEnv; char far *cmdLine; struct fcb far *fcb1; struct fcb far *fcb2; }; #include "algndflt.h" int cdecl lowLevelExec(char far * cmd, struct ExecBlock far * bl); int exec(const char *cmd, char *cmdLine, const unsigned segOfEnv) { #ifdef FEATURE_XMS_SWAP # define buf dosCMDTAIL # define memcpy _fmemcpy #else unsigned char buf[MAX_EXTERNAL_COMMAND_SIZE+2]; /* 128 bytes is max size in PSP, 2 bytes for size and terminator */ #endif struct fcb fcb1, fcb2; struct ExecBlock execBlock; int retval; int cmdLen; assert(cmd); assert(cmdLine); invalidateNLSbuf(); /* generate Pascal string from the command line */ /* we assume passed in c string (ASCIIZ) */ cmdLen = strlen(cmdLine); if (cmdLen > MAX_EXTERNAL_COMMAND_SIZE) { /* we assume CMDLINE environment variable already set with full cmdLine */ /* so we simply truncate passed command line to max size, terminated by \r, no \0 for callee */ /* for maximum compatibility set size to 127 (0x7f) */ buf[0] = (unsigned char)(MAX_EXTERNAL_COMMAND_SIZE+1); memcpy(&buf[1], cmdLine, MAX_EXTERNAL_COMMAND_SIZE); /* terminate with just carriage return \r */ buf[MAX_EXTERNAL_COMMAND_SIZE+1] = '\x0d'; } else { /* set size of actual command line and copy to buffer */ buf[0] = (unsigned char)cmdLen; memcpy(&buf[1], cmdLine, cmdLen); /* ensure terminated with \r\0, if less then 126 characters or \r, if exactly 126 characters */ memcpy(&buf[1] + cmdLen, "\x0d", (cmdLen < MAX_EXTERNAL_COMMAND_SIZE) ? 2 : 1); } /* fill FCBs */ if ((cmdLine = parsfnm(cmdLine, &fcb1, 1)) != 0) { parsfnm(cmdLine, &fcb2, 1); } saveSession(); #ifdef FEATURE_XMS_SWAP if(XMSisactive() && swapOnExec == TRUE) { /* Copy the prepared values into the buffers in CSWAP.ASM module */ _fmemcpy(dosFCB1, &fcb1, sizeof(fcb1)); _fmemcpy(dosFCB2, &fcb2, sizeof(fcb1)); assert(strlen(cmd) < 128); _fstrcpy((char far *)dosCMDNAME, cmd); dosParamDosExec.envSeg = segOfEnv; retval = XMSexec(); } else #endif { /* fill execute structure */ execBlock.segOfEnv = segOfEnv; execBlock.cmdLine = (char far *)buf; execBlock.fcb1 = (struct fcb far *)&fcb1; execBlock.fcb2 = (struct fcb far *)&fcb2; retval = lowLevelExec((char far*)cmd, (struct ExecBlock far*)&execBlock); } restoreSession(); return retval; } ================================================ FILE: lib/exec1.c ================================================ /* $Id$ Decode the return code of the execution of an external program: errorlevel := input? input : normal exit? errorlevel : ^CBreak errorlevel This file bases on EXEC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2005/07/10 04:46:39 perditionc build fixes and minor enhancements Revision 1.4 2004/12/01 21:15:48 skaus add: /Z: Display exit code after external command {Bernd Blaauw} Revision 1.3 2004/10/25 19:37:34 skaus fix: LH: Errorlevel of program effects LH's error reporting {Eric Auer} Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../err_fcts.h" #ifdef DISP_EXITCODE extern int exitReason; /* global variable, defined in dispexit.c, set in exec1.c */ void displayExitcode(void); /* also in include/misc.h */ #endif void setErrorLevel(int rc) { IREGS rp; dprintf(("[exec: DOS error code of exec(): %d]\n", rc)); if(!rc) { #ifndef DISP_EXITCODE int exitReason; /* else we use the global variable */ #endif rp.r_ax = 0x4d00; /* get return code */ intrpt(0x21, &rp); rc = rp.r_ax & 0xFF; exitReason = (rp.r_ax >> 8) & 0xFF; /* 0 -> normal 1 -> ^Break / ^C 2 -> Critical Error 3 -> TSR */ dprintf(("[exec: exit code: %u:%u]\n", exitReason, rc)); if(exitReason == 0x1) ctrlBreak = 1; if(exitReason == 0x2) /* Shallt change in the future */ ctrlBreak = 1; if(ctrlBreak && !rc) /* Make sure this condition is reflected */ rc = CBREAK_ERRORLEVEL; } else { #ifdef DISP_EXITCODE exitReason = -1; #endif switch (rc) { case 7: /* DE_MCBDESTRY */ error_bad_mcb_chain(); break; case 8: /* DE_NOMEM */ error_out_of_dos_memory(); break; case 13: /* DE_INVLDDATA */ error_exe_corrupt(); break; default: error_unknown(rc); break; } } errorlevel = rc; /* assign DOS error code, if the call failed itself */ #ifdef DISP_EXITCODE displayExitcode(); #endif } ================================================ FILE: lib/farread.c ================================================ /* $Id$ * Read a block of data from a FILE* into far memory * Return 0 on failure, otherwise the number of read bytes This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include "../include/misc.h" #if defined(__TURBOC__) || defined(__GNUC__) static unsigned DOSreadwrite(int fd, void far *buffer, unsigned size, unsigned short func ) { IREGS r; r.r_ax = func; r.r_bx = fd; r.r_cx = size; r.r_dx = FP_OFF(buffer); r.r_ds = FP_SEG(buffer); intrpt(0x21, &r); return( ( r.r_flags & 1 ) ? 0xFFFF : r.r_ax ); } size_t farread(int fd, void far*buf, size_t length) { /* Use DOS API in order to read the strings directly to the far address */ return( DOSreadwrite( fd, buf, length, 0x3F00 ) ); } size_t farwrite(int fd, void far*buf, size_t length) { return( DOSreadwrite( fd, buf, length, 0x4000 ) ); } #else size_t farread(int fd, void far*buf, size_t length) { /* Use DOS API in order to read the strings directly to the far address */ size_t bytes; if( _dos_read(fd, buf, length, &bytes) ) return 0xffff; return bytes; } size_t farwrite(int fd, void far*buf, size_t length) { size_t bytes; if( _dos_write(fd, buf, length, &bytes) ) return 0xffff; return bytes; } #endif #if !defined(__TURBOC__) int sfn_open(const char *pathname, int flags) { #if defined(__GNUC__) IREGS r; r.r_ax = 0x3d00 | flags; r.r_dx = FP_OFF(pathname); r.r_ds = FP_SEG(pathname); intrpt(0x21, &r); return (r.r_flags & 1) ? -1 : (int)r.r_ax; #else int handle; int result = _dos_open(pathname, flags, &handle); return (result == 0 ? handle : -1); #endif } #endif #if defined(__GNUC__) int dos_close(int fd) { IREGS r; r.r_ax = 0x3e00; r.r_bx = fd; intrpt(0x21, &r); return (r.r_flags & 1) ? -1 : 0; } #endif int dos_read(int fd, void *buf, unsigned int len) { return farread(fd, buf, len); } int dos_write(int fd, const void *buf, unsigned int len) { return farwrite(fd, (void far *)buf, len); } static int sfn_creat_common(const char *pathname, int attr, int new) { #ifdef __WATCOMC__ int handle; int result = (new ? _dos_creatnew : _dos_creat)(pathname, attr, &handle); return (result == 0 ? handle : -1); #else IREGS r; r.r_ds = FP_SEG( pathname ); r.r_dx = FP_OFF( pathname ); r.r_cx = attr; r.r_ax = new ? 0x5B00 : 0x3C00; intrpt( 0x21, &r ); if( ( r.r_flags & 1 ) ) r.r_ax = 0xFFFF; return( r.r_ax ); #endif } int sfn_creat(const char *pathname, int attr) { return sfn_creat_common(pathname, attr, 0); } int sfn_creatnew(const char *pathname, int attr) { return sfn_creat_common(pathname, attr, 1); } ================================================ FILE: lib/fdattr.c ================================================ /* $Id$ * Return attributes of an opened handle * * Return: * 0: on failure (means: modified regular file on fixed drv A:) * else: attributes This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include #include #include "../config.h" int fdattr(const int fd) { IREGS r; r.r_ax = 0x4400; /* Get handle information */ r.r_bx = fd; intrpt(0x21, &r); return (!( r.r_flags & 1 ) ) /* call OK */ ? r.r_dx /* attributes */ : 0; /* error */ } ================================================ FILE: lib/fdevopen.c ================================================ /* $Id$ like open() supporting device names This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/19 01:37:06 blairdude Fixed some bugs in LFN support, copy now fully supports long filenames Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/openf.h" #include "../include/lfnfuncs.h" FILE *fdevopen(char *const fnam, const char *const mode) { isDeviceName(fnam); /* modify fnam if device */ return fopen(fnam, mode); } ================================================ FILE: lib/fdsattr.c ================================================ /* $Id$ * Set attributes of an opened handle * * Return: * 0: on succes * else: DOS error code $Log$ Revision 1.4 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.3 2005/12/16 12:03:39 perditionc use proper subfunction to set attributes (from Eric) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2002/04/08 16:02:22 skaus bugfix: CTTY: added to try to set the device flags */ #include #include #include "../config.h" int fdsetattr(const int fd, const int attr) { IREGS r; r.r_ax = 0x4401; /* Get handle information */ r.r_bx = fd; r.r_dx = attr; intrpt(0x21, &r); return ( r.r_flags & 1 ) /* call failed */ ? r.r_ax /* error code */ : 0; /* OK */ } ================================================ FILE: lib/filecomp.c ================================================ /* $Id$ Complete a given filename This file bases on FILECOMP.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/09/04 21:22:32 blairdude Got rid of all '//' comments Revision 1.3 2006/06/26 19:54:12 blairdude Long filename filename completion can be enabled with LFNFOR COMPLETE ON Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #ifdef __TURBOC__ #include #endif #include "../include/lfnfuncs.h" #include #include "../include/command.h" #include "../strings.h" static int do_complete(char *str, unsigned charcount, int show) { /* variables found within code */ struct dos_ffblk file; int found_dot = 0; int curplace = 0; int start; int count; int perfectmatch = 1; int makelower; char path[128]; char fname[14]; char maxmatch[13] = ""; char directory[128]; assert(str); /* expand current file name */ count = charcount - 1; if (count < 0) makelower = count = 0; else { /* if last character is lower case, then make lookup lower case. */ makelower = islower(str[count]); } while (count > 0 && str[count] != ' ') /* find front of word */ count--; if (str[count] == ' ') /* if not at beginning, go forward 1 */ count++; start = count; /* extract directory from word */ strcpy(directory, &str[start]); curplace = strlen(directory) - 1; while (curplace >= 0 && directory[curplace] != '\\' && directory[curplace] != ':') { directory[curplace] = 0; curplace--; } strcpy(path, &str[start]); /* look for a . in the filename */ for (count = strlen(directory); path[count] != 0; count++) if (path[count] == '.') { found_dot = 1; break; } if (found_dot) strcat(path, "*"); else strcat(path, "*.*"); curplace = 0; /* current fname */ if( #ifdef FEATURE_LONG_FILENAMES lfncomplete ? lfnfindfirst( path, &file, FILE_SEARCH_MODE ) == 0 : #endif sfnfindfirst( path, ( struct ffblk * )&file, FILE_SEARCH_MODE ) != 0 ) /* no match found */ return 0; /* find anything */ if (show) { outc('\n'); count = found_dot = 0; /* Use found_dot as waslfn */ } do { if (file.ff_name[0] == '.' && (!file.ff_name[1] || (file.ff_name[1] == '.' && !file.ff_name[2]))) /* ignore . and .. */ continue; if (show) { if (file.ff_attrib == FA_DIREC) sprintf(fname, "[%s]", file.ff_name); else strcpy(fname, file.ff_name); /* displayString(TEXT_FILE_COMPLATION_DISPLAY, fname); */ #ifdef FEATURE_LONG_FILENAMES if( ( found_dot = strlen( fname ) ) > 13 && count > 1 ) { outc( '\n' ); count = 0; } #endif printf("%-14s", fname); if( #ifdef FEATURE_LONG_FILENAMES found_dot > 13 || #endif ++count == 5) { outc('\n'); count = 0; } } else { strcpy(fname, file.ff_name); if (makelower) strlwr(fname); strcat(fname, file.ff_attrib == FA_DIREC ? "\\" : " "); if (!maxmatch[0] && perfectmatch) strcpy(maxmatch, fname); else { for (count = 0; maxmatch[count] && fname[count]; count++) if (maxmatch[count] != fname[count]) { perfectmatch = 0; maxmatch[count] = 0; break; } } } } while( #ifdef FEATURE_LONG_FILENAMES lfncomplete ? lfnfindnext( &file ) == 0 : #endif sfnfindnext( ( struct ffblk * )&file ) == 0 ); dos_findclose(&file); if (show) { if (mywherex() > 1) outc('\n'); } else { strcpy(&str[start], directory); strcat(&str[start], maxmatch); } if (!show && !perfectmatch) return 0; return 1; } void complete_filename(char *str, unsigned charcount) { if (!do_complete(str, charcount, 0)) beep(); } int show_completion_matches(char *str, unsigned charcount) { int ret = do_complete(str, charcount, 1); if (!ret) beep_low(); return ret; } ================================================ FILE: lib/files.txt ================================================ These source files provide a library of functions used by all parts of FreeCOM. They have been broken into smallest pieces in order to use the linker ability to choose only those portions (one portion is exactly one source file) needed to successfully bind the whole executable. ================================================ FILE: lib/fillcomp.c ================================================ /* $Id$ Substitute wildcards in filenames fillFnam(): Substitutes the wildcards of the last filename component. fillComp(): replaces the wildcards ? and * of a filename pattern with characters from a source filename (useful in COPY a*.* b?1.*). If a question mark appears bejond the end of the file name, it is silently ignored, e.g. in above example if copy'ing A.TXT) This file bases on COPY.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2006/09/04 19:34:08 blairdude Use static-sized buffers for safety Revision 1.4 2006/06/19 01:37:06 blairdude Fixed some bugs in LFN support, copy now fully supports long filenames Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2003/04/08 13:37:57 skaus chg: wilcard matching: COPY/REN *.TXT ???b.*: If length of source filename is less than 3, the superflous question marks are ignored, as in MS COMMAND v6.22 COPY, but INCOMPATIBLE to same version's REN, which embeds spaces Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include "../include/command.h" #include "../include/misc.h" #include "../include/lfnfuncs.h" static void fillComp(char * const dst , const char *pattern , const char *src , int len) { char *s; assert(len); assert(dst); if(!pattern) pattern = ""; if(!src) src = ""; s = dst; while(--len) { switch(*s = *pattern++) { case '\0': goto ende; case '?': if(!*src) continue; /* if(*src) do not keep ? bejond end-of-filename */ *s = *src; default: ++s; break; case '*': memcpy(s, src, len); s[len] = '\0'; return; } if(*src) ++src; } ende: #if 0 /* don't keep ? bejond end-of-filename */ /* The pattern may have less characters than the source, because trailing '?'s do match "nothing" in DOS. */ while(--s >= dst && *s == '?'); s[1] = '\0'; #else *s = '\0'; assert(strchr(dst, '?') == 0); #endif } void fillFnam(char *dest, const char * const pattern , const char * const fnam) { #if 0 char *dr; #else char buf[MAXPATH], dr[MAXDRIVE]; #endif char *pa, *fn, *ex; char *pfn, *pex; char dfn[MAXFILE], dex[MAXEXT]; assert(fnam); assert(pattern); if(strchr(pattern, '?') == 0 && strchr(pattern, '*') == 0) #if 0 return strdup(pattern); #else strcpy(dest, pattern); #endif #if 0 if(!dfnsplit(pattern, &dr, &pa, &fn, &ex)) return 0; if(!dfnsplit(fnam, 0, 0, &pfn, &pex)) { free(fn); free(ex); free(dr); free(pa); return 0; } #else myfnsplit(pattern, buf, dr, &pa, &fn, &ex); myfnsplit(fnam, dest, 0, 0, &pfn, &pex); #endif fillComp(dfn, fn, pfn, MAXFILE); fillComp(dex, ex, pex, MAXEXT); #if 0 p = dfnmerge(0, dr, pa, dfn, dex); #else myfnmerge(dest, dr, pa, dfn, dex); #endif #if 0 free(pfn); free(pex); free(dr); free(pa); free(fn); free(ex); return p; #endif } ================================================ FILE: lib/find.c ================================================ /* $Id$ * skip_word - skip a word / find next word delimiter * word delimiters are whitespaces and non-leading option characters * skipdm - skip all word delimiters / find next non-word delimiter * word delimiters are whitespaces only This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/cmdline.h" /* * Find the next delimiter/non-delimiter within p * Honor quotes and leading option characters */ static char *find(char *p, int delim) { int ch, quote; int isopt; assert(p); #define isdelim(ch) (isopt? isoptdelim(ch): isargdelim(ch)) if((isopt = isoption(p)) != 0 && delim) { /* Assume the following example: p == "arg/opt" first find("arg/opt", 1) == find next delimiter returns pointer to "/opt" Now the process would call skip delimiters to reach the next argument --> find("/opt", 0) == find next non-delimiter will return "/opt", because '/' is delimiter only when searching for delimiters. Now the process would call skip non-delimiters to reach the end of the arg --> find("/opt", 1) == find next delimiter This time the leading optch's are part of the argument. ===> This is performed in this branch. If the string would be "/opt1/opt2", the call of find("/opt1/opt2", 1) == find next delimiter must stop at the second '/'. */ while((ch = *++p) != 0 && isoptch(ch)); } quote = 0; while((ch = *p++) != '\0' && (quote || (delim && !(isdelim(ch) || isoptch(ch))) || (!delim && isdelim(ch)))) if(quote == ch) quote = 0; else if(strchr(QUOTE_STR, ch)) quote = ch; return p - 1; #undef isdelim } char *skip_word(char *p) { return find(p, 1); } char *skipdm(char *p) { return find(p, 0); } /* * Find the next delimiter/non-delimiter within p * Honor quotes and leading option characters */ static char *find_batch(char *p, int delim) { int ch, quote; assert(p); dprintf(("find_batch(%s, %i) -- ", p, delim)); quote = 0; while((ch = *p++) != '\0' && (quote || (delim && !(isargdelim(ch))) || (!delim && isargdelim(ch)))) { if(quote == ch) quote = 0; else if(strchr(QUOTE_STR, ch)) quote = ch; } dprintf(("returning %s\n", (p-1))); return p - 1; } char *skipnonoptdm(char *p) { return find_batch(p, 0); } char *skipnonopt_word(char *p) { return find_batch(p, 1); } ================================================ FILE: lib/freep.c ================================================ /* $Id$ * freep -- frees a dynamically allocated array of dynamically allocated strings This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/cmdline.h" void freep(char **p) { char **q; if((q = p) != 0) { while (*q) free(*q++); free(p); } } ================================================ FILE: lib/frsysblk.c ================================================ /* $Id$ Deallocate a system memory block. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "mcb.h" #include "suppl.h" #include "../include/misc.h" void freeSysBlk (const unsigned segm) { struct MCB _seg *mcb; assert(segm); mcb = MK_SEG_PTR(struct MCB, SEG2MCB(segm)); mcb->mcb_ownerPSP = _psp; freeBlk(segm); dprintf(("[MEM: deallocated system memory block: %04x]\n", segm)); } ================================================ FILE: lib/fstpcpy.c ================================================ /* $Id$ far stpcpy() This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/misc.h" char far *_fstpcpy(char far *dst, const char far *src) { while((*dst++ = *src++) != 0); return dst - 1; } ================================================ FILE: lib/gallstr.c ================================================ /* $Id$ Get allocation strategy This file bases on MISC.C of FreeCOM v0.81 beta 1. This function had been imported from LH.ASM. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" int dosGetAllocStrategy(void) { USEREGS _AX = 0x5800; /* get allocation strategy */ geninterrupt(0x21); return _CFLAG & 1 ? 0 : _AX; } ================================================ FILE: lib/get1mcb.c ================================================ /* $Id$ Get start of MCB chain, from word ptr SYSVARS[-2] This file bases on MISC.C of FreeCOM v0.81 beta 1. This function had been imported from LH.ASM. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" word GetFirstMCB(void) { USEREGS _AH = 0x52; geninterrupt(0x21); return peekw(_ES, _BX - 2); } ================================================ FILE: lib/getenv.c ================================================ /* $Id$ * Return the value of the variable * * The returned pointer needs to be freed by the caller. * * If the case-insensitive match is used, the var[] array is updated with * the variable name that was retrieved. * * Return: NULL, on failure This file bases on ENVIRON.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 12:24:36 skaus bugfix: >>PATH<< with empty %PATH% --> PATH=(null) fix: BREAK/VERIFY ignore trailing spaces fix: >>PATH ;<< remove PATH environment variable fix: cache 3 environment variables to overcome nested useage (e.g. when loading message segment to print environment variable) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/misc.h" char *getEnv(char var[]) { assert(var); /* To have case-sensitive variable names, just delete the env_matchVar() call and the if() */ /* To let var[] unaltered, use env_findAnyVar() instead of the combination of matchVar() & dupvar(). However, the caller will know the correct variable name, if you don't. */ if (env_matchVar(0, var) & 7) /* found? */ return 0; /* no match found */ /* var now contains the correct variable name and we can be sure that's there */ return dupvar(var); } ================================================ FILE: lib/goxy.c ================================================ /* $Id$ * goxy * * move the cursor on the screen This file bases on CMDINPUT.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/14 05:25:06 blairdude goxy now uses the current video page for setting the cursor position Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/misc.h" void goxy(const unsigned char x, const unsigned char y) { USEREGS _AH = 0x0F; geninterrupt( 0x10 ); _AH = 0x02; _DH = ( y - 1 ); _DL = ( x - 1 ); geninterrupt( 0x10 ); } ================================================ FILE: lib/grabfcom.c ================================================ /* $Id$ * Grab the filename of COMMAND.COM * * If warn != 0, warnings can be issued; otherwise this functions * is silent. This file bases on INIT.C of FreeCOM v0.81 beta 1. 0 -> is valid 1 -> no such file 2 -> is a device 3 -> not valid 4 -> out of memory / syntax error ... . $Log$ Revision 1.6 2004/06/29 14:14:55 skaus fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} Revision 1.5 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.4 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL Revision 1.3 2003/12/09 20:25:34 skaus bugfix: INIT: FreeCOM-path and TTY can be in any order Revision 1.2 2002/11/05 19:29:21 skaus bugfix: FreeCOM should accept relative path as argv[0] Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" int grabComFilename(const int warn, const char far * const fnam) { char *buf; size_t len; int rc; dprintf( ("[INIT: grabComFilename(%s)]\n", fnam) ); if(!fnam) return 4; /* Copy the filename into the local heap */ len = _fstrlen(fnam); if(len >= INT_MAX || len < 1) { /* no filename specified */ if(warn) error_syntax(0); return 4; } if((buf = malloc(len + 1)) == 0) { if(warn) error_out_of_memory(); return 4; } _fmemcpy((char far*)buf, fnam, len); buf[len] = '\0'; if (buf[1] != ':' || buf[2] != '\\') { char *p; /* expand the string for the user */ p = abspath(buf, warn); free(buf); if((buf = p) == 0) return 4; if(warn) error_init_fully_qualified(buf); len = strlen(buf); } while(buf[len - 1] == '\\') --len; buf[len] = 0; if(dfnstat(buf) & DFN_DIRECTORY) { /* The user specified a directory, try if we can find the COMMAND.COM with the standard name in there */ char *p; if((p = realloc(buf, len + sizeof(COM_NAME) + 1)) == 0) { if(warn) error_out_of_memory(); free(buf); return 4; } buf = p; strcpy(&buf[len], "\\" COM_NAME); } if(0 != (rc = validResFile(buf))) { if(warn) switch(rc) { default: #ifdef NDEBUG assert(0); #endif case 1: error_open_file(buf); break; case 2: error_fcom_is_device(buf); break; case 3: error_fcom_invalid(buf); break; } free(buf); return rc; } free(ComPath); /* Save the found file */ ComPath = buf; dprintf(("[INIT: new resource file name: %s]\n", ComPath)); isSwapFile = 0; buf = dfnfilename(ComPath); assert(buf); if((buf = strchr(buf, '.')) != 0 && stricmp(buf, ".swp") == 0) { dprintf(("[INIT: VSpawn file found: %s]\n", ComPath)); memcpy(++buf, "COM", 3); isSwapFile = buf - ComPath; } return 0; } ================================================ FILE: lib/gumblink.c ================================================ /* $Id$ Get UMB Link state This file bases on MISC.C of FreeCOM v0.81 beta 1. This function had been imported from LH.ASM. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" int dosGetUMBLinkState(void) { USEREGS _AX = 0x5802; /* get UMB link */ geninterrupt(0x21); return _CFLAG ? 0 : _AL; } ================================================ FILE: lib/hdlrctxt.c ================================================ /* $Id$ Breaks up var=value like strings and displays the set if no argument Using the environment subsystem of SUPPL */ #include "../config.h" #include #include #include "environ.h" #include "../err_fcts.h" #include "../include/context.h" #include "../include/misc.h" static int view (void *arg, word segm, word ofs) { (void)arg; if (peekb (segm, ofs) > ' ') /* control characters tag hidden features */ printf ("%Fs\n", MK_FP (segm, ofs)); return 0; /* don't stop */ } int breakVarAssign(ctxt_t context, char * const s, char ** const value) { char *p; assert(value); assert(s); /* if no parameters, show the environment */ if(!*s) { env_forAll(context, view, 0); return 0; } /* make sure there is an = in the command */ if((p = strchr(s, '=')) == 0 || p == s) /* Should this print the value for the environment variable? */ return 1; *p = 0; /* separate name and value */ *value = p + 1; return 2; } ================================================ FILE: lib/hist_get.c ================================================ /* $Id$ Set a specific item of the history Useage: histGet(num, buflen, string) num == 0 -> add a "newest" entry to the history num < 0 -> change the num'th newest entry of the history num > 0 -> change the num'th oldest entry of the history positive num's correspond to item ID (not relative to nummin!) negative ones are added to nummax */ #include "../config.h" #include #include #include #include "../include/context.h" #include "../include/misc.h" int histGet(const int num, char * const str, const unsigned len) { char *p; assert(str); assert(len); if(ctxtIsValid() && ctxtGet(0, CTXT_TAG_HISTORY, realNum(CTXT_TAG_HISTORY, num), &p) == 0) { assert(p); strncpy(str, p, len); str[len - 1] = 0; /* Make sure the string is terminated */ free(p); return 1; } return 0; } ================================================ FILE: lib/hist_set.c ================================================ /* $Id$ Set a specific item of the history Useage: histSet(num, string) num == 0 -> add a "newest" entry to the history num < 0 -> change the num'th newest entry of the history num > 0 -> change the num'th oldest entry of the history positive num's correspond to item ID (not relative to nummin!) negative ones are added to nummax */ #include "../config.h" #include "../include/context.h" #include "../include/misc.h" void histSet(const int num, const char * const str) { if(ctxtIsValid()) ctxtSet(CTXT_TAG_HISTORY, realNum(CTXT_TAG_HISTORY, num), str); } ================================================ FILE: lib/inputdos.c ================================================ /* $Id$ Input a line via DOS-0A This file bases on CMDINPUT.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.4 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2003/12/09 21:29:24 skaus bugfix: Ask for FreeCOM location when STRINGS are missing [#687] Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/command.h" #if MAX_INTERNAL_COMMAND_SIZE > 253 #define CMD_SIZE 253 #else #define CMD_SIZE MAX_INTERNAL_COMMAND_SIZE #endif static unsigned char iobuf[CMD_SIZE + 2] = { CMD_SIZE, '\0'}; void readcommandDOS(char * const str, int maxlen) { IREGS r; assert(str); assert(maxlen); iobuf[0] = (maxlen < CMD_SIZE)? maxlen: CMD_SIZE; if(iobuf[1] > iobuf[0]) iobuf[1] = iobuf[0]; dprintf(("[CMDINPUT characters max:%u in:%u]\n", iobuf[0], iobuf[1])); if(echo) printprompt(); r.r_ax = 0xa00; r.r_ds = FP_SEG(iobuf); r.r_dx = FP_OFF(iobuf); intrpt(0x21, &r); dprintf(("[CMDINPUT characters max:%u out:%u]\n", iobuf[0], iobuf[1])); if(iobuf[1]) /* could bug if == 0 */ memcpy(str, &iobuf[2], iobuf[1]); str[iobuf[1]] = 0; outc('\n'); } ================================================ FILE: lib/is_empty.c ================================================ /* $Id$ Returns true if the strings is NULL, "" or consists of whitespaces only. */ #include "../config.h" #include #include "../include/misc.h" int is_empty(const char *s) { if(s) { --s; while(*++s) if(!isspace(*s)) return 0; } return 1; } ================================================ FILE: lib/is_fnamc.c ================================================ /* $Id$ int is_fnchar() is filename character? Note: These are none: ."/\\[]:|<>+=;, This file bases on COMMAND.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/nls.h" int is_fnchar(const int c) { #ifdef FEATURE_NLS refreshNLS(); /* refresh the NLS information */ #define uc unsigned char return !(c < (uc)nlsBuf->inclFirst || c > (uc)nlsBuf->inclLast || (c >= (uc)nlsBuf->exclFirst && c <= (uc)nlsBuf->exclLast) || _fmemchr(nlsBuf->illegalChars, c, nlsBuf->illegalLen)); #undef uc #else return !(c <= ' ' || c == 0x7f || strchr(".\"/\\[]:|<>+=;,", c)); #endif } ================================================ FILE: lib/is_fnstr.c ================================================ /* $Id$ Tests if the string is constructed out of is_fnchar() characters only */ #include "../config.h" #include #include "../include/misc.h" int is_fnstr(const char * const s) { const char *p; assert(s); for(p = s; *p; ++p) if(!is_fnchar(*p)) return 0; return 1; } ================================================ FILE: lib/is_pchr.c ================================================ /* $Id$ int is_pathdelim() is path delimiter character? Note: These are \\ : $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ int is_pathdelim(const int c) { return c == '\\' || c == ':'; } ================================================ FILE: lib/isadev.c ================================================ /* $Id$ * Check if the passed file descriptor is connected to a * character device rather than a block device * * Return: * 0: block device (disk file) * else: character device This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../include/openf.h" int isadev(const int fd) { return (fdattr(fd) & 0x80) != 0; /* is character device */ } ================================================ FILE: lib/keyprsd.c ================================================ /* $Id$ Check if a key is pressed currently This file bases on INIT.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" int keypressed(void) { IREGS r; r.r_ax = 0x0100; intrpt(0x16, &r); /* Check the zero flag. Z=0 means a key was pressed; Z=1 means no key */ if (r.r_flags & 0x40) return 0; else return 1; } ================================================ FILE: lib/kswap_c.c ================================================ /* $Id$ Defines the central pointer to the KSWAP primary data structure. */ #include "../config.h" #include "../include/kswap.h" #ifndef FEATURE_XMS_SWAP kswap_p kswapContext = 0; #endif ================================================ FILE: lib/lastdget.c ================================================ /* $Id$ Get Last Directory */ #include "../config.h" #include #include "../include/context.h" #include "../include/misc.h" #include "../err_fcts.h" void lastDirGet(char ** const buf) { assert(buf); switch(ctxtGet(0, CTXT_TAG_LASTDIR, 1, buf)) { case 2: error_out_of_memory(); default: *buf = 0; case 0: break; } } ================================================ FILE: lib/lastdset.c ================================================ /* $Id$ Set Last Directory with current directory */ #include "../config.h" #include #include "../include/context.h" #include "../include/misc.h" #include "../err_fcts.h" void lastDirSet(void) { char *dir; if((dir = cwd(0)) != 0) { ctxtSet(CTXT_TAG_LASTDIR, 1, dir); free(dir); } else error_out_of_memory(); } ================================================ FILE: lib/leadopt.c ================================================ /* $Id$ * Scan all leading options This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/12/03 20:10:52 skaus bugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure. Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/cmdline.h" int leadOptions (char **Xline, optScanner fct, void *const arg){ int ec = E_None; char *p, *q, *line; assert(Xline); p = *Xline; if(!p) p = ""; while(*(line = skipdm(p))) { q = unquote(line, p = skip_word(line)); if(!q) { error_out_of_memory(); return E_NoMem; } if(!isoption(q) || ((ec = scanOption(fct, arg, q)) != E_None && ec != E_Ignore)) { free(q); break; } free(q); } *Xline = line; return ec; } ================================================ FILE: lib/lfnfuncs.c ================================================ /* * Gets the short filename equivalent */ #include "../config.h" #include #include #include #include #include #include #include #include #include #include #include #include #define __LFNFUNCS_C #include "suppl.h" #include "../include/misc.h" #include "../include/lfnfuncs.h" #ifdef FEATURE_LONG_FILENAMES /*#ifdef __TURBOC__*/ /* OpenWatcom has an LFN CLIB Extension available but not used yet */ #define _STC __emit__(0xF9) #define _PUSH_DS __emit__(0x1E) #define _PUSH_ES __emit__(0x06) #define _POP_DS __emit__(0x1F) #define _POP_ES __emit__(0x07) /* * The following function copies a short filename equivalent of a long * filename into a local static buffer, which will be overwritten on * subsequent calls */ const char * getshortfilename( const char *longfilename ) { static char shortfilename[ 128 ]; IREGS r; if (!__supportlfns) return( longfilename ); r.r_ds = FP_SEG( longfilename ); r.r_si = FP_OFF( longfilename ); r.r_es = FP_SEG( shortfilename ); r.r_di = FP_OFF( shortfilename ); shortfilename[0] = '\0'; r.r_cx = 0x8001; /* Get short filename */ r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7160;/* LFN truename function */ intrpt( 0x21, &r ); return( ( ( r.r_flags & 1 ) || r.r_ax == 0x7100 || !shortfilename[0] ) ? longfilename : shortfilename ); } /* creates or keeps/truncates the LFN in filename if the LFN already exists and code == 0x12, then truncate it if the LFN already exists and code == 0x10, then do nothing returns 1 if the LFN already exists or has been created, else 0 LFN handles are avoided for compatibility with buggy LFN implementations, most notably NTVDM in Windows 2000 and XP. */ static int __creat_or_truncate( const char * filename, int mode, int code ) { int handle; IREGS r; if( !__supportlfns ) { return 0; } r.r_ds = FP_SEG( filename ); r.r_si = FP_OFF( filename ); r.r_bx = O_WRONLY; r.r_cx = mode; r.r_dx = code; r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x716C; intrpt( 0x21, &r ); if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) return r.r_ax == 0x50; /* file already exists for error 0x50 */ handle = r.r_ax; /* * Win2k always returns handle == 2, which is a bug. * File handle 2 is already used for stderr * Fortunately, FreeCOM never actually expects to get file handle 2 * ( as it does for '1' and '0', when redirecting stdin and stdout ) */ if( handle != 2 )dos_close( handle ); return 1; } #if defined(DEBUG) || defined(FEATURE_CALL_LOGGING) FILE * lfnfopen( const char *filename, const char *mode ) { /* only used with "at" in debugging code */ if( strpbrk( mode, "aw" ) ) __creat_or_truncate( filename, 0, 0x10 ); return( fopen( getshortfilename( filename ), mode ) ); } #endif int lfn_creat( const char *filename, int attr ) { if ( __creat_or_truncate( filename, attr, 0x12 ) ) return sfn_open( getshortfilename( filename ), O_WRONLY ); return sfn_creat( filename, attr ); } int lfnrename( const char *oldfilename, const char *newfilename ) { /* Must use the actual interrupt for this */ IREGS r; if(dfnstat(newfilename) != 0) { errno = EACCES; return( -1 ); } r.r_ds = FP_SEG( oldfilename ); r.r_dx = FP_OFF( oldfilename ); r.r_es = FP_SEG( newfilename ); r.r_di = FP_OFF( newfilename ); r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7156; intrpt( 0x21, &r ); if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) { r.r_ax = 0x5600; intrpt( 0x21, &r ); if( ( r.r_flags & 1 ) ) { errno = r.r_ax; return( -1 ); } } return( 0 ); } static void convert_to_ffblk( struct lfnffblk *dosblock, struct locffblk *lfnblock ) { dosblock->ff_attrib = lfnblock->attributes; dosblock->cr_time = lfnblock->creattime; dosblock->cr_date = lfnblock->creatdate; dosblock->ac_time = lfnblock->accesstime; dosblock->ac_date = lfnblock->accessdate; dosblock->ff_ftime = lfnblock->wrtime; dosblock->ff_fdate = lfnblock->wrdate; dosblock->ff_fsize = lfnblock->filesize; if( lfnblock->lfn ) { memcpy( dosblock->ff_name, lfnblock->lfn, sizeof( lfnblock->lfn ) ); } else { memcpy( dosblock->ff_name, lfnblock->sfn, sizeof( lfnblock->sfn ) ); } } int lfnfindfirst( const char *path, struct lfnffblk *buf, unsigned attr ) { struct locffblk lfnblock; IREGS r; buf->lfnax = buf->lfnsup = 0; /* Zero find handle and LFN-supported flag */ if( !__supportlfns ) return( sfnfindfirst( path, ( struct ffblk * )buf, attr ) ); r.r_ds = FP_SEG( path ); r.r_dx = FP_OFF( path ); /* path goes in DS:DX */ r.r_es = FP_SEG( &lfnblock ); r.r_di = FP_OFF( &lfnblock ); /* LFN find block goes in ES:DI */ r.r_si = 1; /* Use DOS date/time format */ r.r_cx = attr; r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x714E; /* LFN Findfirst */ intrpt( 0x21, &r ); /* * If ax = 7100, there is probably an LFN TSR but no LFN support for * whatever drive or directory is being searched. In that case, fall back on * the old findfirst. Also if the function fails, it could be because of * no LFN TSR so fall back to the old findfirst. */ if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) return( sfnfindfirst( path, ( struct ffblk * )buf, attr ) ); /* * If there was no failure, the next step is to move the values from the * LFN block into the non-lfn block */ buf->lfnax = r.r_ax; buf->lfnsup = 1; convert_to_ffblk( buf, &lfnblock ); /* * 0 is always returned because we've already checked cflag; the * old_dos_findfirst will handle any errors */ return( 0 ); } int lfnfindnext( struct lfnffblk *buf ) { struct locffblk lfnblock; IREGS r; /* * Before going through the possibly unnecessary steps of calling the LFN * function first, buf->lfnsup will tell us if LFN was supported with the * previous call to findfirst. */ if( !buf->lfnsup || !__supportlfns ) { return( sfnfindnext( ( struct ffblk * )buf ) ); } r.r_es = FP_SEG( &lfnblock ); r.r_di = FP_OFF( &lfnblock ); /* The LFN find block */ r.r_bx = buf->lfnax; /* The lfn handle set by findfirst */ r.r_si = 1; /* Use DOS times */ r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x714F; intrpt( 0x21, &r ); /* Check for errors */ if( ( r.r_flags & 1 ) ) { errno = r.r_ax; return( -1 ); } convert_to_ffblk( buf, &lfnblock ); return( 0 ); } int lfnfindclose( struct lfnffblk *buf ) { IREGS r; /* Let's check if LFN was used; if not, there is no need for findclose */ if( !buf->lfnsup || !__supportlfns ) return( 0 ); r.r_bx = buf->lfnax; /* Findfirst handle */ r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x71A1; /* LFN findclose */ intrpt( 0x21, &r ); /* * Check for errors (which really shouldn't be a problem anyways * except for bad code) */ if( ( r.r_flags & 1 ) ) { errno = r.r_ax; return( -1 ); } return( 0 ); } int lfnmkdir( const char *path ) { IREGS r; r.r_dx = FP_OFF( path ); r.r_ds = FP_SEG( path ); r.r_flags = 1; if (__supportlfns) { r.r_ax = 0x7139; intrpt( 0x21, &r ); } if ( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) { r.r_ax = 0x3900; intrpt( 0x21, &r ); } return( -( r.r_flags & 1 ) ); } static int lfn_rc_dir( const char *path, int func ) { IREGS r; path = getshortfilename( path ); r.r_ax = func; r.r_dx = FP_OFF( path ); r.r_ds = FP_SEG( path ); intrpt( 0x21, &r ); return( -( r.r_flags & 1 ) ); } int lfnrmdir( const char *path ) { return lfn_rc_dir( path, 0x3a00 ); } int lfnchdir( const char *path ) { return lfn_rc_dir( path, 0x3b00 ); } /* #endif */ #endif ================================================ FILE: lib/lib.m1 ================================================ .AUTODEPEND CFG_DEPENDENCIES = makefile.mak !include "..\config.mak" all: $(CFG) freecom.lib ================================================ FILE: lib/lib.m2 ================================================ ================================================ FILE: lib/lowexec.asm ================================================ ; $Id$ ; LOWEXEC.ASM ; ; ; Comments: ; ; ??/??/95 (Steffen Kaiser) ; started. ; ; 12/??/95 (Svante Frey) ; reorganized the code ; ; 01/06/96 (Tim Norman) ; added this history ; ; 08/07/96 (Steffen Kaiser) ; made argument handling independent of memory model ; $Log$ ; Revision 1.1 2001/04/12 00:33:53 skaus ; chg: new structure ; chg: If DEBUG enabled, no available commands are displayed on startup ; fix: PTCHSIZE also patches min extra size to force to have this amount ; of memory available on start ; bugfix: CALL doesn't reset options ; add: PTCHSIZE to patch heap size ; add: VSPAWN, /SWAP switch, .SWP resource handling ; bugfix: COMMAND.COM A:\ ; bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed ; add: command MEMORY ; bugfix: runExtension(): destroys command[-2] ; add: clean.bat ; add: localized CRITER strings ; chg: use LNG files for hard-coded strings (hangForEver(), init.c) ; via STRINGS.LIB ; add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts ; add: fixstrs.c: prompts & symbolic keys ; add: fixstrs.c: backslash escape sequences ; add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C ; chg: splitted code apart into LIB\*.c and CMD\*.c ; bugfix: IF is now using error system & STRINGS to report errors ; add: CALL: /N ; ; Revision 1.1.1.1.4.1 2001/02/18 17:59:36 skaus ; bugfix: KSSF: restore parentPSP on exit ; chg: Using STRINGS resource for all non-interactive messages ; chg: moving all assembly files to NASM ; %include "model.inc" %include "stuff.inc" segment _TEXT cglobal lowLevelExec lowLevelExec: push bp mov bp, sp pushm si, di, ds %ifidn __OUTPUT_FORMAT__, elf push es %endif lds dx, [bp+4+2*@CodeSize] ; load file name les bx, [bp+8+2*@CodeSize] ; load parameter block mov ax, 4b00h mov Word [cs:saveSP], sp mov Word [cs:saveSS], ss int 21h cli ;; Can be removed for post-8086 CPUs mov ss, [cs:saveSS] mov sp, [cs:saveSP] sti jc exec_error ; if there was an error, the error code is in AX xor ax, ax ; otherwise, clear AX exec_error: %ifidn __OUTPUT_FORMAT__, elf pop es %endif popm si, di, ds pop bp ret ; retf/retn model specific, see model.inc saveSP dw 0 saveSS dw 0 ================================================ FILE: lib/ltrimcl.c ================================================ /* $Id$ * Name: ltrimcl() - left trims a string by removing leading spaces The string itself is not changed. * Input: str - a pointer to a string * Output: returns a trimmed copy of str $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands */ #include "../config.h" #include #include #include #include "../include/cmdline.h" char *ltrimcl(const char *str) { char c; assert(str); while ((c = *str++) != '\0' && isargdelim(c)) ; return (char *)str - 1; /* strip const */ } ================================================ FILE: lib/ltrimsp.c ================================================ /* $Id$ * Name: ltrimsp() - left trims a string by removing leading spaces The string itself is not changed. * Input: str - a pointer to a string * Output: returns a trimmed copy of str This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" char *ltrimsp(const char *str) { char c; assert(str); while ((c = *str++) != '\0' && isspace(c)) ; return (char *)str - 1; /* strip const */ } ================================================ FILE: lib/lwr1wd.c ================================================ /* $Id$ strlwr() only for the first word in string This file bases on ALIAS.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" void partstrlower(char *str) { int c; assert(str); while ((c = *str) != '\0' && !isspace(c)) *str++ = tolower(c); } ================================================ FILE: lib/makefile ================================================ # $Id$ # # Makefile for the FreeCOM library # # $Log$ # Revision 1.17 2004/12/01 21:15:31 skaus # add: /Z: Display exit code after external command {Bernd Blaauw} # # Revision 1.16 2004/09/13 18:59:39 skaus # add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} # # Revision 1.15 2004/06/21 17:49:25 skaus # fix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao} # # Revision 1.14 2004/02/01 13:24:22 skaus # bugfix: misidentifying unspecific failures from within SUPPL # # Revision 1.13 2003/12/09 21:29:24 skaus # bugfix: Ask for FreeCOM location when STRINGS are missing [#687] # # Revision 1.12 2003/12/09 20:25:34 skaus # bugfix: INIT: FreeCOM-path and TTY can be in any order # # Revision 1.11 2003/09/01 14:14:30 skaus # bugfix: typo: bad varable specification [#1678] # # Revision 1.10 2002/11/12 19:48:47 skaus # bugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313] # # Revision 1.9 2002/04/25 18:50:40 skaus # v0.83 Beta 38: # # Revision 1.8 2002/04/23 16:40:41 skaus # bugfix: CTTY: added to try to set the device flags # # Revision 1.7 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.6 2002/04/02 20:58:13 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.5 2002/04/02 18:09:31 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.3 2001/06/10 17:17:24 skaus # bugfix: Single point of configuration CONFIG.MAK/.H # # Revision 1.2 2001/04/29 11:33:51 skaus # chg: default heap size (tools\ptchsize) set to 6KB # chg: error displaying functions centralized into lib\err_fcts.src # add: displayError() # chg: all errors are displayed through functions void error_*() # bugfix: somtimes error messages are not displayed (see displayError()) # bugfix: docommand(): type:file must pass ":file" to TYPE # bugfix: error_sfile(): string _SFILE_ # bugfix: error message on empty redirection # bugfix: comma and semicolon ';' are recognized as argument seperators # of internal commands # # Revision 1.1 2001/04/12 00:33:53 skaus # chg: new structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # # MAXLINELENGTH !:= 4096 .INCLUDE : ../_config.mk # Sources of this make target SRC = absfile.c almemblk.c alprmblk.c alsysblk.c app_get.c app_set.c \ beep_l.c beep_n.c brk_get.c brk_set.c cbreak.c cbs.c cd_dir.c cgetch.c \ cgettime.c chgctxt.c chgdrv.c chgenv.c chgenvc.c chgenvr.c \ cmdinput.c comfile.c compfile.c critend.c critrchk.c ctxt.c ctxt_adr.c \ ctxt_as.c ctxt_chg.c ctxt_clr.c ctxt_get.c ctxt_inf.c ctxt_mk.c \ ctxt_mkb.c ctxt_mkn.c ctxt_pop.c ctxt_psh.c ctxt_rnu.c ctxt_set.c \ ctxt_ss.c ctxt_vw.c curdatel.c curtime.c cwd.c dateget.c dateset.c \ dbg_c.c dbg_mem.c dbg_prnt.c dbg_s.c dbg_sn.c devopen.c dfn_err.c \ dispcnt.c dispexit.c drvnum.c efct_001.c exec.c exec1.c farread.c \ fcompl1.c fcompl2.c fdattr.c fdevopen.c fdsattr.c fillcomp.c find.c \ freep.c frsysblk.c fstpcpy.c gallstr.c get1mcb.c getenv.c goxy.c \ grabfcom.c gumblink.c hdlrctxt.c hist_get.c hist_set.c inputdos.c \ is_empty.c is_fnamc.c is_fnstr.c is_pchr.c isadev.c keyprsd.c kswap_c.c \ lastdget.c lastdset.c leadopt.c lowexec.asm ltrimcl.c ltrimsp.c lwr1wd.c \ match.c messages.c mk_rddir.c mktmpfil.c msg_dflt.c msg_dps.c msg_fstr.c \ msg_get.c msg_gpt.c msg_mkey.c msg_prmp.c mux_ae.c nls.c nls_date.c \ nls_time.c num_fmt.c onoff.c openf.c optsb.c optsi.c optss.c parsenum.c \ pr_date.c pr_prmpt.c pr_time.c prprompt.c readcmd.c realnum.c res.c \ res_r.c res_vald.c res_w.c resfile.c rmtmpfil.c rtrimcl.c rtrimsp.c \ salloc.c samefile.c scancmd.c scanopt.c session.c showcmds.c skqwd.c \ spfnam.c split.c sumblink.c timeget.c timeset.c tmpnam.c \ trimcl.c trimsp.c truepath.c truncate.c txtlend.c unquote.c vcgetch.c \ vcgetstr.c where.c OBJ = absfile.obj almemblk.obj alprmblk.obj alsysblk.obj app_get.obj \ app_set.obj beep_l.obj beep_n.obj brk_get.obj brk_set.obj cbreak.obj \ cbs.obj cd_dir.obj cgetch.obj cgettime.obj chgctxt.obj chgdrv.obj \ chgenv.obj chgenvc.obj chgenvr.obj cmdinput.obj comfile.obj \ compfile.obj critend.obj critrchk.obj ctxt.obj ctxt_adr.obj ctxt_as.obj \ ctxt_chg.obj ctxt_clr.obj ctxt_get.obj ctxt_inf.obj ctxt_mk.obj \ ctxt_mkb.obj ctxt_mkn.obj ctxt_pop.obj ctxt_psh.obj ctxt_rnu.obj \ ctxt_set.obj ctxt_ss.obj ctxt_vw.obj curdatel.obj curtime.obj cwd.obj \ dateget.obj dateset.obj dbg_c.obj dbg_mem.obj dbg_prnt.obj dbg_s.obj \ dbg_sn.obj devopen.obj dfn_err.obj dispcnt.obj dispexit.obj drvnum.obj \ efct_001.obj exec.obj exec1.obj farread.obj fcompl1.obj fcompl2.obj \ fdattr.obj fdevopen.obj fdsattr.obj fillcomp.obj find.obj freep.obj \ frsysblk.obj fstpcpy.obj gallstr.obj get1mcb.obj getenv.obj goxy.obj \ grabfcom.obj gumblink.obj hdlrctxt.obj hist_get.obj hist_set.obj \ inputdos.obj is_empty.obj is_fnamc.obj is_fnstr.obj is_pchr.obj \ isadev.obj keyprsd.obj kswap_c.obj lastdget.obj lastdset.obj leadopt.obj \ lowexec.obj ltrimcl.obj ltrimsp.obj lwr1wd.obj match.obj messages.obj \ mk_rddir.obj mktmpfil.obj msg_dflt.obj msg_dps.obj msg_fstr.obj \ msg_get.obj msg_gpt.obj msg_mkey.obj msg_prmp.obj mux_ae.obj nls.obj \ nls_date.obj nls_time.obj num_fmt.obj onoff.obj openf.obj optsb.obj \ optsi.obj optss.obj parsenum.obj pr_date.obj pr_prmpt.obj pr_time.obj \ prprompt.obj readcmd.obj realnum.obj res.obj res_r.obj res_vald.obj \ res_w.obj resfile.obj rmtmpfil.obj rtrimcl.obj rtrimsp.obj salloc.obj \ samefile.obj scancmd.obj scanopt.obj session.obj showcmds.obj skqwd.obj \ spfnam.obj split.obj sumblink.obj timeget.obj timeset.obj \ tmpnam.obj trimcl.obj trimsp.obj truepath.obj truncate.obj txtlend.obj \ unquote.obj vcgetch.obj vcgetstr.obj where.obj HDR = ..\config.h ..\context.h_c ..\err_fcts.h ..\include/batch.h \ ..\include/cmdline.h ..\include/command.h ..\include/context.h \ ..\include/crossjmp.h ..\include/cswap.h ..\include/datefunc.h \ ..\include/debug.h ..\include/keys.h ..\include/kswap.h \ ..\include/misc.h ..\include/mux_ae.h ..\include/nls.h \ ..\include/openf.h ..\include/res.h ..\include/resource.h \ ..\include/strings.typ ..\include/timefunc.h ..\include\command.h \ ..\include\context.h ..\include\crossjmp.h ..\include\large.inc \ ..\include\misc.h ..\include\model.inc ..\include\small.inc \ ..\include\stuff.inc # Default target all: freecom.lib # Error functions generated by scanerr.pl .INCLUDE : err_fcts.mk SRC += $(SRC_ERR) OBJ += $(OBJ_ERR) dist : makefile.mak %.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist ### Utils are required by build process .INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl .IF $(THISMAKE) == $(LASTMAKE) verscheck :; .ELSE verscheck : @+-echo Changed Make parameters, already made files invalid! +-echo LASTMAKE = $(THISMAKE) >lastmake.mk $(RUNMAKE) clobber .IF $(CFG) $(RUNMAKE) $(CFG) .ENDIF .ENDIF __errl: @+-if exist errlist del errlist >nul -ctags *.c ..\cmd\*.c ..\shell\*.c $(FREEDOS)\SRC\LIB\SUPPL\*.c freecom.lib .LIBRARY : $(OBJ) #MAKEDEP START absfile.obj : absfile.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h almemblk.obj : almemblk.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h alprmblk.obj : alprmblk.c \ ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/kswap.h ../include/misc.h \ ../include/timefunc.h alsysblk.obj : alsysblk.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h app_get.obj : app_get.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h app_set.obj : app_set.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h beep_l.obj : beep_l.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h beep_n.obj : beep_n.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h brk_get.obj : brk_get.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h brk_set.obj : brk_set.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h cbreak.obj : cbreak.c \ ../config.h ../include/batch.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h cbs.obj : cbs.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h cd_dir.obj : cd_dir.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h cgetch.obj : cgetch.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/keys.h ../include/misc.h \ ../include/timefunc.h cgettime.obj : cgettime.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h chgctxt.obj : chgctxt.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h chgdrv.obj : chgdrv.c \ ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h chgenv.obj : chgenv.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h chgenvc.obj : chgenvc.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h chgenvr.obj : chgenvr.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h cmdinput.obj : cmdinput.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/keys.h ../include/misc.h \ ../include/timefunc.h comfile.obj : comfile.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h compfile.obj : compfile.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h critend.obj : critend.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h critrchk.obj : critrchk.c \ ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ctxt.obj : ctxt.c \ ../config.h ../include/context.h ../include/debug.h ctxt_adr.obj : ctxt_adr.c \ ../config.h ../include/context.h ../include/debug.h ctxt_as.obj : ctxt_as.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ctxt_chg.obj : ctxt_chg.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ctxt_clr.obj : ctxt_clr.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ctxt_get.obj : ctxt_get.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ctxt_inf.obj : ctxt_inf.c \ ../config.h ../include/context.h ../include/debug.h ctxt_mk.obj : ctxt_mk.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/crossjmp.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ctxt_mkb.obj : ctxt_mkb.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/crossjmp.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ctxt_mkn.obj : ctxt_mkn.c \ ../config.h ../include/context.h ../include/debug.h ctxt_pop.obj : ctxt_pop.c \ ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ctxt_psh.obj : ctxt_psh.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ctxt_rnu.obj : ctxt_rnu.c \ ../config.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ctxt_set.obj : ctxt_set.c \ ../config.h ../include/context.h ../include/debug.h ctxt_ss.obj : ctxt_ss.c \ ../config.h ../include/context.h ../include/debug.h ctxt_vw.obj : ctxt_vw.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h curdatel.obj : curdatel.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/nls.h \ ../include/timefunc.h ../strings.h curtime.obj : curtime.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/nls.h \ ../include/timefunc.h cwd.obj : cwd.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h dateget.obj : dateget.c \ ../config.h ../include/datefunc.h ../include/debug.h dateset.obj : dateset.c \ ../config.h ../include/datefunc.h ../include/debug.h dbg_c.obj : dbg_c.c \ ../config.h ../include/debug.h dbg_mem.obj : dbg_mem.c \ ../config.h ../include/debug.h dbg_prnt.obj : dbg_prnt.c \ ../config.h ../include/debug.h dbg_s.obj : dbg_s.c \ ../config.h ../include/debug.h dbg_sn.obj : dbg_sn.c \ ../config.h ../include/debug.h devopen.obj : devopen.c \ ../include/openf.h dfn_err.obj : dfn_err.c \ ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h dispcnt.obj : dispcnt.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h dispexit.obj : dispexit.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h drvnum.obj : drvnum.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h efct_001.obj : efct_001.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h exec.obj : exec.c \ ../config.h ../include/command.h ../include/cswap.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/nls.h ../include/timefunc.h exec1.obj : exec1.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h farread.obj : farread.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h fcompl1.obj : fcompl1.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h fcompl2.obj : fcompl2.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h fdattr.obj : fdattr.c fdevopen.obj : fdevopen.c \ ../include/openf.h fdsattr.obj : fdsattr.c fillcomp.obj : fillcomp.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h find.obj : find.c \ ../config.h ../include/cmdline.h ../include/debug.h freep.obj : freep.c \ ../config.h ../include/cmdline.h ../include/debug.h frsysblk.obj : frsysblk.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h fstpcpy.obj : fstpcpy.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h gallstr.obj : gallstr.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h get1mcb.obj : get1mcb.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h getenv.obj : getenv.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h goxy.obj : goxy.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h grabfcom.obj : grabfcom.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h gumblink.obj : gumblink.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h hdlrctxt.obj : hdlrctxt.c \ ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h hist_get.obj : hist_get.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h hist_set.obj : hist_set.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h inputdos.obj : inputdos.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h is_empty.obj : is_empty.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h is_fnamc.obj : is_fnamc.c \ ../config.h ../include/debug.h ../include/nls.h is_fnstr.obj : is_fnstr.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h is_pchr.obj : is_pchr.c isadev.obj : isadev.c \ ../include/openf.h keyprsd.obj : keyprsd.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h kswap_c.obj : kswap_c.c \ ../config.h ../context.h_c ../include/debug.h ../include/kswap.h lastdget.obj : lastdget.c \ ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h lastdset.obj : lastdset.c \ ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h leadopt.obj : leadopt.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h lowexec.obj : lowexec.asm \ .\..\include\large.inc .\..\include\model.inc .\..\include\small.inc \ .\..\include\stuff.inc ltrimcl.obj : ltrimcl.c \ ../config.h ../include/cmdline.h ../include/debug.h ltrimsp.obj : ltrimsp.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h lwr1wd.obj : lwr1wd.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h match.obj : match.c \ ../config.h ../include/cmdline.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h messages.obj : messages.c \ ../config.h ../include/command.h ../include/cswap.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/res.h ../include/resource.h ../include/strings.typ \ ../include/timefunc.h ../strings.h mk_rddir.obj : mk_rddir.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h mktmpfil.obj : mktmpfil.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h msg_dflt.obj : msg_dflt.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h ../strings.h msg_dps.obj : msg_dps.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h msg_fstr.obj : msg_fstr.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/strings.typ ../include/timefunc.h \ ../strings.h msg_get.obj : msg_get.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h msg_gpt.obj : msg_gpt.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h msg_mkey.obj : msg_mkey.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h msg_prmp.obj : msg_prmp.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h mux_ae.obj : mux_ae.c \ ../config.h ../include/command.h ../include/crossjmp.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/mux_ae.h ../include/nls.h ../include/timefunc.h nls.obj : nls.c \ ../config.h ../include/debug.h ../include/nls.h nls_date.obj : nls_date.c \ ../config.h ../include/debug.h ../include/nls.h nls_time.obj : nls_time.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/nls.h ../include/timefunc.h ../strings.h num_fmt.obj : num_fmt.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/nls.h ../include/timefunc.h onoff.obj : onoff.c \ ../config.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h openf.obj : openf.c \ ../config.h ../include/debug.h ../include/openf.h optsb.obj : optsb.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h optsi.obj : optsi.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h optss.obj : optss.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h parsenum.obj : parsenum.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h pr_date.obj : pr_date.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/nls.h \ ../include/timefunc.h pr_prmpt.obj : pr_prmpt.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h pr_time.obj : pr_time.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/nls.h \ ../include/timefunc.h prprompt.obj : prprompt.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h readcmd.obj : readcmd.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h realnum.obj : realnum.c \ ../config.h ../include/context.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h res.obj : res.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/resource.h \ ../include/timefunc.h res_r.obj : res_r.c \ ../config.h ../include/debug.h ../include/resource.h res_vald.obj : res_vald.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/openf.h \ ../include/resource.h ../include/strings.typ ../include/timefunc.h res_w.obj : res_w.c \ ../include/resource.h resfile.obj : resfile.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h rmtmpfil.obj : rmtmpfil.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h rtrimcl.obj : rtrimcl.c \ ../config.h ../include/cmdline.h ../include/debug.h rtrimsp.obj : rtrimsp.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h salloc.obj : salloc.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h samefile.obj : samefile.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h scancmd.obj : scancmd.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h scanopt.obj : scanopt.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h session.obj : session.c \ ../config.h ../err_fcts.h ../include/command.h ../include/context.h \ ../include/crossjmp.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h showcmds.obj : showcmds.c \ ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/kswap.h ../include/misc.h \ ../include/timefunc.h ../strings.h skqwd.obj : skqwd.c \ ../config.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h spfnam.obj : spfnam.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h split.obj : split.c \ ../config.h ../include/cmdline.h ../include/debug.h sumblink.obj : sumblink.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h timeget.obj : timeget.c \ ../config.h ../include/debug.h ../include/timefunc.h timeset.obj : timeset.c \ ../config.h ../include/debug.h ../include/timefunc.h tmpnam.obj : tmpnam.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h trimcl.obj : trimcl.c \ ../config.h ../include/cmdline.h ../include/debug.h trimsp.obj : trimsp.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h truepath.obj : truepath.c \ ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h truncate.obj : truncate.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h txtlend.obj : txtlend.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h unquote.obj : unquote.c \ ../config.h ../include/cmdline.h ../include/debug.h vcgetch.obj : vcgetch.c \ ../config.h ../include/datefunc.h ../include/debug.h \ ../include/keys.h ../include/misc.h ../include/timefunc.h vcgetstr.obj : vcgetstr.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h where.obj : where.c \ ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h DYNSOURCES = #MAKEDEP STOP clobber : clean $(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist lib.m3 makefile.mak : makefile lib.m1 lib.m2 ..\utils\chunk freecom_deps <$(mktmp $(OBJ:t"\n")\n) >lib.m3 +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 $@ # +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 $@ ================================================ FILE: lib/makefile.mak ================================================ #.AUTODEPEND CFG_DEPENDENCIES = makefile.mak TOP = .. !include "$(TOP)/config.mak" all: freecom.lib OBJS1 = absfile.obj almemblk.obj alprmblk.obj alsysblk.obj app_get.obj app_set.obj beep_l.obj OBJS2 = beep_n.obj brk_get.obj brk_set.obj cbreak.obj cbs.obj cd_dir.obj cgetch.obj OBJS3 = cgettime.obj chgctxt.obj chgdrv.obj chgenv.obj chgenvc.obj chgenvr.obj cmdinput.obj OBJS4 = comfile.obj compfile.obj critend.obj critrchk.obj ctxt.obj ctxt_adr.obj ctxt_as.obj OBJS5 = ctxt_chg.obj ctxt_clr.obj ctxt_get.obj ctxt_inf.obj ctxt_mk.obj ctxt_mkb.obj ctxt_mkn.obj OBJS6 = ctxt_pop.obj ctxt_psh.obj ctxt_rnu.obj ctxt_set.obj ctxt_ss.obj ctxt_vw.obj curdatel.obj OBJS7 = curtime.obj cwd.obj dateget.obj dateset.obj dbg_c.obj dbg_mem.obj dbg_prnt.obj OBJS8 = dbg_s.obj dbg_sn.obj devopen.obj dfn_err.obj dispcnt.obj dispexit.obj drvnum.obj OBJS9 = efct_001.obj exec.obj exec1.obj farread.obj filecomp.obj fdattr.obj fdevopen.obj OBJS10 = fdsattr.obj fillcomp.obj find.obj freep.obj frsysblk.obj fstpcpy.obj gallstr.obj OBJS11 = get1mcb.obj getenv.obj goxy.obj grabfcom.obj gumblink.obj hdlrctxt.obj hist_get.obj OBJS12 = hist_set.obj inputdos.obj is_empty.obj is_fnamc.obj is_fnstr.obj is_pchr.obj isadev.obj OBJS13 = keyprsd.obj kswap_c.obj lastdget.obj lastdset.obj leadopt.obj lfnfuncs.obj lowexec.obj OBJS14 = ltrimcl.obj ltrimsp.obj lwr1wd.obj match.obj messages.obj mk_rddir.obj mktmpfil.obj OBJS15 = msg_dflt.obj msg_dps.obj msg_fstr.obj msg_get.obj msg_gpt.obj msg_mkey.obj msg_prmp.obj OBJS16 = mux_ae.obj myperror.obj nls.obj nls_date.obj nls_time.obj num_fmt.obj onoff.obj OBJS17 = openf.obj optsb.obj optsi.obj optss.obj parsenum.obj pr_date.obj pr_prmpt.obj OBJS18 = pr_time.obj prf.obj prprompt.obj readcmd.obj realnum.obj res.obj res_r.obj OBJS19 = res_vald.obj res_w.obj resfile.obj rmtmpfil.obj rtrimcl.obj rtrimsp.obj salloc.obj OBJS20 = samefile.obj scancmd.obj scanopt.obj session.obj showcmds.obj skqwd.obj spfnam.obj OBJS21 = split.obj sumblink.obj timeget.obj timeset.obj tmpnam.obj trimcl.obj trimsp.obj OBJS22 = truepath.obj truncate.obj txtlend.obj unquote.obj vcgetch.obj vcgetstr.obj where.obj OBJS23 = delay.obj OBJS24 = err1.obj err2.obj err3.obj err4.obj err5.obj err6.obj err7.obj OBJS25 = err8.obj err9.obj err10.obj err11.obj err12.obj err13.obj err14.obj OBJS26 = err15.obj err16.obj err17.obj err18.obj err19.obj err20.obj err21.obj OBJS27 = err22.obj err23.obj err24.obj err25.obj err26.obj err27.obj err28.obj OBJS28 = err29.obj err30.obj err31.obj err32.obj err33.obj err34.obj err35.obj OBJS29 = err36.obj err37.obj err38.obj err39.obj err40.obj err41.obj err42.obj OBJS30 = err43.obj err44.obj err45.obj err46.obj err47.obj err48.obj err49.obj OBJS31 = err50.obj err51.obj err52.obj err53.obj err54.obj err55.obj err56.obj OBJS32 = err57.obj err58.obj err59.obj err60.obj err61.obj err62.obj err63.obj OBJS33 = err64.obj err65.obj err66.obj err67.obj err68.obj err69.obj err70.obj OBJS34 = err71.obj err72.obj err73.obj err74.obj err75.obj err76.obj err77.obj OBJS35 = err78.obj err79.obj err80.obj err81.obj err82.obj err83.obj err84.obj OBJS36 = err85.obj err86.obj err87.obj freecom.rsp : $(ECHOLIBDEP) makefile.mak $(RMFILES) freecom.rsp $(ECHOLIB) freecom.rsp $(OBJS1) $(ECHOLIB) freecom.rsp $(OBJS2) $(ECHOLIB) freecom.rsp $(OBJS3) $(ECHOLIB) freecom.rsp $(OBJS4) $(ECHOLIB) freecom.rsp $(OBJS5) $(ECHOLIB) freecom.rsp $(OBJS6) $(ECHOLIB) freecom.rsp $(OBJS7) $(ECHOLIB) freecom.rsp $(OBJS8) $(ECHOLIB) freecom.rsp $(OBJS9) $(ECHOLIB) freecom.rsp $(OBJS10) $(ECHOLIB) freecom.rsp $(OBJS11) $(ECHOLIB) freecom.rsp $(OBJS12) $(ECHOLIB) freecom.rsp $(OBJS13) $(ECHOLIB) freecom.rsp $(OBJS14) $(ECHOLIB) freecom.rsp $(OBJS15) $(ECHOLIB) freecom.rsp $(OBJS16) $(ECHOLIB) freecom.rsp $(OBJS17) $(ECHOLIB) freecom.rsp $(OBJS18) $(ECHOLIB) freecom.rsp $(OBJS19) $(ECHOLIB) freecom.rsp $(OBJS20) $(ECHOLIB) freecom.rsp $(OBJS21) $(ECHOLIB) freecom.rsp $(OBJS22) $(ECHOLIB) freecom.rsp $(OBJS23) $(ECHOLIB) freecom.rsp $(OBJS24) $(ECHOLIB) freecom.rsp $(OBJS25) $(ECHOLIB) freecom.rsp $(OBJS26) $(ECHOLIB) freecom.rsp $(OBJS27) $(ECHOLIB) freecom.rsp $(OBJS28) $(ECHOLIB) freecom.rsp $(OBJS29) $(ECHOLIB) freecom.rsp $(OBJS30) $(ECHOLIB) freecom.rsp $(OBJS31) $(ECHOLIB) freecom.rsp $(OBJS32) $(ECHOLIB) freecom.rsp $(OBJS33) $(ECHOLIB) freecom.rsp $(OBJS34) $(ECHOLIB) freecom.rsp $(OBJS35) $(ECHOLIB) freecom.rsp $(OBJS36) freecom_deps1 : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) \ $(OBJS8) $(OBJS9) $(OBJS10) $(OBJS11) $(OBJS12) $(OBJS13) $(OBJS14) $(OBJS15) \ $(OBJS16) $(OBJS17) $(OBJS18) freecom_deps2 : $(OBJS19) $(OBJS20) $(OBJS21) $(OBJS22) $(OBJS23) $(OBJS24) \ $(OBJS25) $(OBJS26) $(OBJS27) $(OBJS28) $(OBJS29) $(OBJS30) $(OBJS31) $(OBJS32) \ $(OBJS33) $(OBJS34) $(OBJS35) $(OBJS36) freecom.lib : $(CFG) freecom_deps1 freecom_deps2 freecom.rsp $(RMFILES) freecom.lib $(AR) freecom.lib @freecom.rsp $(LIBLIST) freecom.lst ================================================ FILE: lib/match.c ================================================ /* $Id$ * Check if the passed line begins with a specified word * The word is matched case-insensitively. * 'len' is the length of the word. * On success, the pointer is placed onto the next word. * Return: 0: on failure This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/cmdline.h" #include "../include/misc.h" int match_(char ** const Xp, const char * const word, int len) { char *p; assert(Xp && *Xp); assert(word && *word); assert(len > 0); if(strnicmp(p = *Xp, word, len) == 0) { /* line begins with string, now test if it is a word */ p += len; if(*p) { char *q = ltrimcl(p); /* skip to next token */ if(q == p) /* no word boundary */ return 0; p = q; } *Xp = p; return 1; /* found */ } return 0; } ================================================ FILE: lib/messages.c ================================================ /* $Id$ msgSegment() - return the segment of memory the STRINGS have been loaded to; if they are not present in memory, they are loaded from the resources unloadMsgs() - deallocate the loaded STRINGS segment This file bases on MESSAGES.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.8 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.7 2004/06/29 21:57:20 skaus fix: /LOW option Revision 1.6 2004/06/29 14:14:56 skaus fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} Revision 1.5 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.4 2003/12/09 21:29:24 skaus bugfix: Ask for FreeCOM location when STRINGS are missing [#687] Revision 1.3 2002/04/02 23:36:37 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.2 2002/04/02 18:09:31 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include #include "../include/command.h" #include "../include/misc.h" #include "../include/res.h" #include "../strings.h" #include "../include/strings.typ" #include "../include/cswap.h" unsigned msgSegm = 0; /* strings segment if loaded */ string_count_t strCnt = 0; /* number of strings */ /* Remove the string segment from memory */ void unloadMsgs(void) { if(msgSegm) { freeBlk(msgSegm); dprintf( ("[Message segment 0x%04x deallocated.]\n", msgSegm) ); } msgSegm = 0; } /* Number of bytes of preceeding the index array: ID string + trailer (\r\n\x1a\0) + count of entries + size of data portion */ #define STRINGS_HEADER_SIZE sizeof(STRINGS_ID) + STRINGS_ID_TRAILER \ + sizeof(string_size_t) + sizeof(string_count_t) - 1 /* Callback function for enumResources() */ /* Called if the resource locator found a resource with a matching major ID --> we ignore all the rest of IDs and probe for the validation string at the beginning of the resource data */ static int loadStrings (res_majorid_t major, res_minorid_t minor, unsigned long length, int fd, void *const arg) { loadStatus *ls = arg; char fdid[sizeof(STRINGS_ID)]; string_size_t len, firstStr; string_index_t far*idx; int i, error; (void)major, (void)minor; if((unsigned long)length >= 0x10000ul || (unsigned)length < STRINGS_HEADER_SIZE) { *ls = STRINGS_SIZE_MISMATCH; return 0; } error = 0; if(dos_read(fd, fdid, sizeof(STRINGS_ID) - 1) != sizeof(STRINGS_ID) - 1) error = 1; if (memcmp(fdid, STRINGS_ID, sizeof(STRINGS_ID) - 1)) { *ls = STRINGS_ID_MISMATCH; return 0; /* Continue searching */ } /* immediately after the ID a trailer follows */ if(lseek(fd, (long)STRINGS_ID_TRAILER, 1) < 0) error = 1; /* Read the strings dimensionating parameters */ if(error || dos_read(fd, &strCnt, sizeof(strCnt)) != sizeof(strCnt) || dos_read(fd, &len, sizeof(len)) != sizeof(len)) { /* Read error */ *ls = STRINGS_READ_ERROR; return 0; /* Continue searching */ } /* At this point f is positioned at the very first string index the data area is NUMBER_OF_STRINGS * sizeof(index) + SIZE_OF_STRINGS */ len += firstStr = strCnt * sizeof(string_index_t); if((unsigned)length - STRINGS_HEADER_SIZE < len) { *ls = STRINGS_SIZE_MISMATCH; return 0; } /* allocation mode: last fit, high first */ if ((msgSegm = allocMemBlk(len, 0x82)) == 0) { *ls = STRINGS_OUT_OF_MEMORY; return 0; } if(farread(fd, MK_FP(msgSegm, 0), len) != len) { unloadMsgs(); /* Remove the message segment */ *ls = STRINGS_READ_ERROR; return 0; } /* Now the offset of the index array are updated to point to the real offset instead of the displacement based on the first byte of the string data area */ idx = MK_FP(msgSegm, 0); for(i = 0; i < strCnt; ++i) idx[i].index += firstStr; *ls = STRINGS_LOADED; return 1; /* Stop searching */ } /* * If the messages are NOT loaded and if there is an error during * the load, the automatic load process might hang here infinitely. */ unsigned msgSegment(void) /* load messages into memory */ { static int recurs = 1; loadStatus status; if(msgSegm) return msgSegm; /* prevent reentrance */ if(--recurs == 0) { /* OK */ for(;;) { status = STRINGS_NOT_FOUND; #ifdef FEATURE_XMS_SWAP msgSegm = XMSswapmessagesIn(&status); if(status == STRINGS_NOT_FOUND) #endif enumResources(RES_ID_STRINGS, loadStrings, &status); switch(status) { case STRINGS_LOADED: assert(msgSegm); dprintf(("[Messages successfully loaded to segment 0x%04x]\n" , msgSegm)); break; #ifdef DEBUG /* Don't use dprintf() to ensure the message is issued, even if fddebug is OFF */ case STRINGS_NOT_FOUND: assert(msgSegm == 0); dbg_outsn("[No STRINGS resource found!]"); break; case STRINGS_ID_MISMATCH: assert(msgSegm == 0); dbg_outsn("[STRINGS ID string mismatch.]"); break; case STRINGS_READ_ERROR: assert(msgSegm == 0); dbg_outsn("[Read error while loading STRINGS.]"); break; case STRINGS_SIZE_MISMATCH: assert(msgSegm == 0); dbg_outsn("[STRINGS resource has invalid size.]"); break; case STRINGS_OUT_OF_MEMORY: assert(msgSegm == 0); dbg_outsn("[Out of memory loading STRINGS.]"); break; default: assert(msgSegm == 0); dbg_outsn("[Unknown error loading STRINGS.]"); break; #else /* Even in non-debugging, an error should be displayed */ case STRINGS_NOT_FOUND: case STRINGS_ID_MISMATCH: case STRINGS_READ_ERROR: case STRINGS_SIZE_MISMATCH: break; case STRINGS_OUT_OF_MEMORY: assert(msgSegm == 0); puts("[Out of memory loading STRINGS.]"); break; #endif } if(msgSegm) break; if(inInit > 1) /* Don't fetch the name interactively too early */ break; #undef TEXT_ERROR_OUT_OF_MEMORY #undef TEXT_ERROR_LOADING_STRINGS puts(TEXT_ERROR_LOADING_STRINGS); { char *buf = malloc(128 + 1); if(!buf) { dos_write(2, (void *)TEXT_ERROR_OUT_OF_MEMORY, strlen(TEXT_ERROR_OUT_OF_MEMORY)); break; } else { int orgEcho = echo; echo = 0; readcommand(buf, 128); echo = orgEcho; if(!*buf) { free(buf); break; } if(0 == grabComFilename(1, (char far*)buf)) { /* Try to set the valid %COMSPEC% */ if(!inInit && chgEnv("COMSPEC", ComPath)) chgEnv("COMSPEC", 0); /* Zap the old one */ } free(buf); } } } ++recurs; } return msgSegm; } ================================================ FILE: lib/mk_rddir.c ================================================ /* $Id$ * MD & RD handler */ #include "../config.h" #include #include #include "../include/misc.h" #include "../strings.h" #include "../err_fcts.h" #include "../include/command.h" #include "../include/cmdline.h" #include "../include/lfnfuncs.h" static int optRecursiveMode, optQuiet; #define COMMAND_EXTENSIONS #ifdef COMMAND_EXTENSIONS optScanFct(opt_md_rd) { (void)arg; switch(ch) { case 'S': return optScanBool(optRecursiveMode); /* rmdir */ case 'P': return optScanBool(optRecursiveMode); /* mkdir */ case 'Q': return optScanBool(optQuiet); /* don't display error and don't prompt to remove files/directories */ } optErr(); return E_Useage; } #define SCANNER_FCT opt_md_rd #else #define SCANNER_FCT 0 #endif int mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname) { char **argv; int argc, opts; int rv; assert(func); /* initialize options */ optRecursiveMode = optQuiet = 0; if((argv = scanCmdline(param, SCANNER_FCT, 0, &argc, &opts)) == 0) return E_Useage; if(argc != 1) { error_syntax(0); rv = 1; } else { cutBackslash(argv[0]); dprintf(("%s: '%s'\n", fctname, argv[0])); if((rv = func(argv[0], optRecursiveMode, optQuiet)) != 0) { if (!optQuiet) error_dirfct_failed(fctname, argv[0]); } } freep(argv); return rv; } ================================================ FILE: lib/mktmpfil.c ================================================ /* $Id$ Try to create a temporary file in a specified directory with a given extension. On success the name of the temporary file is returned in a dynamically allocated buffer. The extension is simply appended to the randomized filename and must contain the leading dot. * * Comments: * Creates unique filenames and creates the files, too. * The filenames do not contain an extension, but my * consume up to eight (8) characters as filename. * * The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%, * %TMPDIR%, "\\TEMP", "\\TMP", fullpath_of("."), ":\\", * "."; in that order, whichever returns a writeable location first * * The filenames are created within dymamic memory and must be * free()'ed by the caller himself. * The files are touched, meaning they are created with zero * length and no special attributes, but closed; the caller must * remove the file himself. * This file bases on TMPNAM.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #define nomem error_out_of_memory /* * Try to create a temporary file with the supplied path, also * fully-qualify it * * If ext != NULL, its contents is appended to a randomized prefix, * most useful, if 'ext' begins with a dot, to give the file to be * created an extension. */ char *mktempfile(const char * const path, const char *ext) { char *fn, *newpath; int cnt, fd; if (!path) /* to simplify the caller function */ return 0; if((fn = abspath(path, 0)) == 0) /* out-of-mem */ return 0; if (!ext) /* make sure it's a legal string */ ext = ""; /* The completed name consits of: + the absolute path name, + the '\\' path component delimited path vs. filename + eight (8) characters randomized filename + the user-supplied extension + the '\0' terminator byte */ if ((newpath = realloc(fn, strlen(fn) + strlen(ext) + 10)) == 0) { /* out of mem */ free(fn); nomem(); return 0; } fn = strchr(newpath, '\0'); /* where the '\\' is to be */ if (fn[-1] != '\\') /* maybe 1 byte is wasted here */ *fn++ = '\\'; cnt = 0; do { /* randomize filename and probe if it can be created */ /* OK, this is not that efficient, but easy to implement right now -- 1998/10/27 ska */ sprintf(fn, "CMD%x%s", cnt, ext); if (!++cnt) /* overflow */ goto errRet; /* loop until either the open succeeded or failed with something different then "file already exists" However, this failed in Win98 DOSbox on root of CD-Rom drive: (fd = open(path, O_CREAT | O_EXCL | O_WRONLY , S_IREAD | S_IWRITE)) == -1 && errno == EACCES); Because DOS returned: EACCES Let's assume access() does not fail on directories: */ } while(dfnstat(newpath)); /* such entry already exists */ /* Make semaphore test */ fd = sfn_creatnew(newpath, 0); if (fd != -1) { /* success */ dos_close(fd); return newpath; } errRet: free(newpath); return 0; } ================================================ FILE: lib/msg_dflt.c ================================================ /* $Id$ Create default message or display Out-of-memory error onto screen This file bases on MESSAGES.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/06/29 14:14:56 skaus fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/misc.h" #include "../strings.h" static struct { unsigned id; const char *string; } cached_ids[] = { { TEXT_ERROR_OUT_OF_MEMORY, #undef TEXT_ERROR_OUT_OF_MEMORY TEXT_ERROR_OUT_OF_MEMORY } , { TEXT_ERROR_OPEN_FILE, #undef TEXT_ERROR_OPEN_FILE TEXT_ERROR_OPEN_FILE } , { TEXT_ERROR_FCOM_INVALID, #undef TEXT_ERROR_FCOM_INVALID TEXT_ERROR_FCOM_INVALID } , { TEXT_ERROR_SET_ENV_VAR, #undef TEXT_ERROR_SET_ENV_VAR TEXT_ERROR_SET_ENV_VAR } , { ~0, 0 } }; char *defaultMessage(unsigned id) { char *h; int i; for(i = 0; cached_ids[i].id != (unsigned)~0; ++i) { if(id == cached_ids[i].id) { h = strdup(cached_ids[i].string); if(h) return h; break; } } /* Allocate 5 bytes for the numerical ID itself */ if(id != cached_ids[0].id && (h = malloc(sizeof(MSG_DFL_PATTERN) + 5)) != 0) { /* Got enough memory to allocate the stuff */ sprintf(h, MSG_DFL_PATTERN, id); return h; } puts(cached_ids[0].string); return 0; } ================================================ FILE: lib/msg_dps.c ================================================ /* $Id$ Display a STRING This file bases on MESSAGES.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/misc.h" #ifdef DEBUG FILE *errStream = 0; #else /* static FILE *errStream = 0; */ #endif static void displayXString(FILE *stream, unsigned id, va_list args) { char *str; if((str = getString(id)) != 0) { vfprintf(stream, str, args); free(str); } } void displayString(unsigned id,...) { va_list ap; va_start(ap, id); displayXString(outStream, id, ap); va_end(ap); } void displayError(unsigned id,...) { va_list ap; va_start(ap, id); #ifdef DEBUG displayXString(errStream? errStream: stderr, id, ap); #else displayXString( stderr, id, ap ); #endif va_end(ap); } ================================================ FILE: lib/msg_fstr.c ================================================ /* $Id$ read the string from the resource and return a dummy entry on failure This file bases on MESSAGES.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.3 2002/04/02 23:36:37 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.2 2002/04/02 18:09:31 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include "../include/misc.h" #include "../strings.h" #include "../include/strings.typ" char *getString(unsigned id) { char *thisstr; unsigned segm; string_index_t far *idx; /* Issue the default message, if: + strings could not be loaded into memory, + requested string ID is not included with resource (too high, or not defined). */ if((segm = msgSegment()) == 0 || id >= strCnt || (idx = MK_FP(segm, id * sizeof(*idx)))->size == 0) return defaultMessage(id); /* pointer to id's control data */ if((thisstr = malloc(idx->size)) == 0) return defaultMessage(MSG_ERR_ID_OUTOFMEMORY); _fmemcpy((char far*)thisstr, MK_FP(segm, idx->index), idx->size); return thisstr; } ================================================ FILE: lib/msg_get.c ================================================ /* $Id$ * As getString(), but removes the last character. * * This is necessary, because there is always a newline character * at the end of the last line. This file bases on MESSAGES.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" char *getMessage(unsigned id) { char *h, *q; if((h = getString(id)) != 0 && *h) { q = strchr(h, '\0'); assert(q); if(*--q == '\n') *q = '\0'; } return h; } ================================================ FILE: lib/msg_gpt.c ================================================ /* $Id$ Get a prompt string $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/misc.h" int getPromptString(unsigned id , char ** const promptChars , char ** const fmtString) { char *fmt, *str; if((str = getString(id)) == 0) return 0; fmt = str + 2 * *(unsigned char*)str + 1; assert(strlen(str) >= fmt - str); assert(fmtString); assert(promptChars); *fmtString = fmt; *promptChars = str; return 1; } ================================================ FILE: lib/msg_mkey.c ================================================ /* $Id$ Map an input key into its associated metakey Return: 0: on error 1..26: metakey $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" int mapMetakey(const char * const str, int ch) { const char *q; if((q = memchr(str + 1, ch, *(const unsigned char*)str)) == 0) return 0; /* hit erroreous character */ return str[(q - str) + *(unsigned char*)str]; /* metakey */ } ================================================ FILE: lib/msg_prmp.c ================================================ /* $Id$ Performs an user prompt Display prompt (if any), get user input via vcgetchar(), map key to metakey, return metakey if valid. $Log$ Revision 1.4 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include "../include/misc.h" int userprompt(unsigned id,...) { char *fmt, *str; int ch; if(!getPromptString(id, &str, &fmt)) return 0; /* Issue message */ if(*fmt) { va_list ap; va_start(ap, id); vprintf(fmt, ap); va_end(ap); } while((ch = vcgetchar()) == 0 || (ch = mapMetakey(str, ch)) == 0) beep(); /* hit erroreous character */ outc('\n'); /* advance to next line */ freePromptString(str, fmt); return ch; } ================================================ FILE: lib/mux_ae.c ================================================ /* $Id$ Implementation for Installable COMMAND extensions (MUX-AE) Return: 0 - No extension 1 - Extension performed 2 - rewrote command line/name This file bases on MUX_AE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.6 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.5 2004/06/14 18:38:08 skaus bugfix: MUX-AE: useage of DS:[SI] {Eduardo Almao} Revision 1.4 2004/06/07 19:32:14 skaus bugfix: MUX-AE: useage of DS:[SI] {Eduardo Almao} Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2003/03/05 17:53:01 skaus bugfix: cached NLS data not flushed Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../include/crossjmp.h" #include "../include/mux_ae.h" #include "../include/nls.h" #if BUFFER_SIZE_MUX_AE > 255 #error "BUFFER_SIZE_MUX_AE must not exceed 255" #endif /* Check for extensions and perform it, on success return != 0 */ /* Also: The contents of both buffers is monitored in order to check if they got overflowed during the MUX call. If so, the executation is aborted. */ int runExtension(char * const command, char * const line) { int clen, llen; IREGS r; char *p; int rc = 0; /* Default: is no extension */ assert(command); assert(line); assert(strlen(command) < BUFFER_SIZE_MUX_AE); assert(strlen(line) <= BUFFER_SIZE_MUX_AE); assert(FP_SEG(command) == FP_SEG(line)); /* Fill the length bytes */ command[-1] = (char)(clen = strlen(command)); line[-1] = (char)(llen = strlen(line)); command[-2] = line[-2] = (char)BUFFER_SIZE_MUX_AE; /* 4dos v4 compatible space padding */ memset(command + clen, ' ', BUFFER_SIZE_MUX_AE - clen); /* The command line is \xd terminated, for savety reasons an \0 is added too */ strcat(line + llen, "\xd"); line[BUFFER_SIZE_MUX_AE] = '\0'; /* Both strings have been prepared now; the MUX call is going to happen */ r.r_ax = 0xae00; /* Installable Commands check for extension */ r.r_dx = 0xffff; /* Magic value */ r.r_cx = -llen; /* length of command line tail (4dos v4) */ r.r_ds = r.r_es = FP_SEG(command); r.r_bx = FP_OFF(line) - 2; r.r_si = FP_OFF(command) - 1; r.r_di = 0; /* Magic value 4dos v4 */ intrpt(0x2F, &r); switch(r.r_ax & 0xFF) { case 0x00: /* No appropriate extension found */ break; default: /* Invalid response */ dprintf( ("[Invalid response from Installable Commands handler: 0x%02x]\n", r.r_ax & 0xFF) ); break; case 0xFF: /* Is an extension -> execute the Installable Command */ r.r_ax = 0xae01; intrpt(0x2F, &r); invalidateNLSbuf(); if(command[-1] == 0) /* The command had been processed */ rc = 1; /* Stop interpreting the command */ else rc = 2; /* buffers rewritten */ break; } /* Cleanup: Adjust buffers and check for overflow */ if((unsigned char)line[-2] != BUFFER_SIZE_MUX_AE #if BUFFER_SIZE_MUX_AE < 255 || (unsigned char)line[-1] > BUFFER_SIZE_MUX_AE #endif || line[BUFFER_SIZE_MUX_AE]) { /* Yiek! That looks very much like an overflow!! */ dprintf( ("[Memory corrupted during Installable Commands handler]\n") ); longjmp(jmp_beginning, E_CorruptMemory); } /* Check command and transform it back into C-style string */ p = command + command[-1]; while(--p >= command && isspace(*p)); p[1] = 0; /* Check the command line and transform it into a C-style string */ /* Must terminate as line[BUFFER_SIZE] == 0 */ line[(unsigned char)line[-1]] = line[(unsigned char)line[-2]] = '\0'; if(0 != (p = strchr(line, '\xd'))) *p = 0; return rc; } ================================================ FILE: lib/myperror.c ================================================ /* Smaller PERROR replacement for FreeCOM (only used in REN and DEL) */ #include "../config.h" #include #include #include #include "../include/misc.h" #include "../strings.h" void myperror( const char *msg ) { displayError( errno == EACCES ? TEXT_ERROR_PERMISSION_DENIED : errno == ENOENT ? TEXT_ERROR_NO_SUCH_FILE : TEXT_ERROR_UNKNOWN_ERROR, msg ); } ================================================ FILE: lib/nls.c ================================================ /* $Id$ * By default COMMAND assumes that the NLS information do change. * refreshNLS() will make sure that nlsBuf is updated and on * occasion when the information could have been changed, nlsBuf * is invalidated in order to be re-read by refreshNLS(). This file bases on NLS.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include "../include/nls.h" Country *nlsBuf = 0; void refreshNLS(void) { if(!nlsBuf) nlsBuf = nlsNewInfo(); } ================================================ FILE: lib/nls_date.c ================================================ /* $Id$ returns the dynamically allocated ASCII representation of the passed in date This file bases on NLS.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/nls.h" char *nls_makedate (int mode, int year, int month, int day) { char buf[4 + 3 + sizeof(int) * 8 * 3]; (void)mode; #ifdef FEATURE_NLS refreshNLS(); switch(nlsBuf->datefmt) { case 0: /* mm/dd/yy */ sprintf(buf, "%02u%s%02u%s%02u", month, nlsBuf->dateSep, day , nlsBuf->dateSep, year); break; case 1: /* dd/mm/yy */ sprintf(buf, "%02u%s%02u%s%02u", day, nlsBuf->dateSep, month , nlsBuf->dateSep, year); break; case 2: /* yy/mm/dd */ sprintf(buf, "%02u%s%02u%s%02u", year, nlsBuf->dateSep, month , nlsBuf->dateSep, day); break; } #else sprintf(buf, "%02u-%02u-%02u", month, day, year); #endif return strdup(buf); } ================================================ FILE: lib/nls_time.c ================================================ /* $Id$ Return the dynamically allocated ASCII representation of the passed in time This file bases on NLS.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.4 2003/03/11 20:01:14 skaus bugfix: PROMPT $T: hour: space padded; fraction zero padded [#1481] Revision 1.3 2001/06/12 22:56:59 skaus bugfix: nls_maketime(): 12hour display does not free AM/PM id Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/misc.h" #include "../include/nls.h" #include "../strings.h" char *nls_maketime(int mode, int hour, int minute, int second, int fraction) { char buf[4 + 4 + sizeof(int) * 8 * 4 + 6]; char *p; int i, pm = 0; #ifdef FEATURE_NLS refreshNLS(); #define fmt nlsBuf->timefmt #define sep nlsBuf->timeSep #define dsep nlsBuf->decimalSep #else #define fmt 0 #define sep ":" #define dsep "." #endif /** Warning: condition always true -- if !NLS **/ if(fmt == 0) { /* 12hour display */ if((pm = hour >= 12) != 0) { hour -= 12; } if(hour == 0) hour = 12; i = sprintf(p = buf, "%2u%s%02u", hour, sep, minute); } else { /** Warning: unreachable code -- if !defined(NLS) **/ i = sprintf(p = buf, "%2u%s%02u", hour, sep, minute); } assert(strlen(buf) < sizeof(buf)); if(i == EOF) return 0; if(second >= 0) { i = sprintf(p += i, "%s%02u", sep, second); if(i == EOF) return 0; if(fraction) { i = sprintf(p += i, "%s%-2u", dsep, fraction); if(i == EOF) return 0; { char *q = p + i; while(*--q == ' ') *q = '0'; } } } assert(strlen(buf) < sizeof(buf)); /** Warning: conditional always true -- if !NLS **/ if(fmt == 0) { char *q = getString(pm? TEXT_STRING_PM: TEXT_STRING_AM); if(!q) return 0; if(mode & NLS_MAKE_SHORT_AMPM) { *(p += i) = *ltrimsp(q); p[1] = 0; } else strcpy(p + i, q); free(q); } assert(strlen(buf) < sizeof(buf)); return strdup(buf); } ================================================ FILE: lib/num_fmt.c ================================================ /* $Id$ * convert * * insert commas into a number This file bases on DIR.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/08/02 20:38:56 skaus bugfix: use of the nls thousands separator in convert() [Eduardo Casino] Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" #include "../include/nls.h" void convert(unsigned long num, unsigned int billions, char * const des) { char temp[sizeof(num) * 8]; int c = 0; assert(des); if(num == 0) { des[0] = '0'; des[1] = 0; } else { refreshNLS(); assert(nlsBuf); temp[31] = 0; do { if (((c + 1) % 4) == 0) temp[30 - c++] = nlsBuf->thousendsSep[0]; temp[30 - c++] = (char)(num % 10) + '0'; num /= 10; if (c == 11 && num == 0) { num = billions; billions = 0; } } while(num != 0 || billions != 0); strcpy(des, &temp[31 - c]); } } ================================================ FILE: lib/onoff.c ================================================ /* $Id$ * Tests if a string is ON or OFF This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.5 2004/02/10 19:10:02 skaus bugfix: onoffStr(): do not ignore leading argument delimiters [#1736] Revision 1.4 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.3 2002/11/12 18:56:48 skaus bugfix: onOffStr(): zaps trailing argument delimiters, e.g. ECHO set= Revision 1.2 2001/04/29 12:24:36 skaus bugfix: >>PATH<< with empty %PATH% --> PATH=(null) fix: BREAK/VERIFY ignore trailing spaces fix: >>PATH ;<< remove PATH environment variable fix: cache 3 environment variables to overcome nested useage (e.g. when loading message segment to print environment variable) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../include/misc.h" enum OnOff onoffStr(char *line) { enum OnOff state = OO_Other; if(!line) return OO_Null; line = ltrimsp(line); if(!*line) return OO_Empty; if(matchtok(line, D_OFF)) state = OO_Off; else if(matchtok(line, D_ON)) state = OO_On; return *line? OO_Other: state; } ================================================ FILE: lib/openf.c ================================================ /* $Id$ * Check if the passed filename is a CP/M style device * * These device names must not contain any drive or path or * extension component, but have a colon ':' at their end. * * Return: * 0: no * else: yes; fnam contains a valid filename now * To handle CP/M style devices, like "CON:" and "LPT1:", which * are not understood by the DOS kernel directly, these functions * wrap the open() and fopen() functions and deal with it. * * Also included are some low-level functions dealing with * file descriptors, such as "isadev()". This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include "../include/misc.h" #include "../include/openf.h" /* * Just for the algorithm: * One could just transform the "XXXX:" style into * "\dev\XXXX". However, WinNT DOSbox does not support * this as it seems ("copy \dev\con test" says path not found). * * On the other hand, how many other DOS clones don't support * the \DEV\ prefix, too? * * So I open the device and check the handle if it's connected to * a character device rather than a block device. */ int isDeviceName(char *const fnam) { char *p; assert(fnam); if ((p = strpbrk(fnam, ":\\/")) != 0 /* has a colon or path component */ && *p == ':' /* has colon --> no path component */ && p[1] == '\0' /* at end of string */ && p >= fnam + 2) { /* no simple drive letter */ int fd; *p = '\0'; /* strip off the colon to make it valid for DOS */ /* open with read access only to prevent from creating disk fiels accidently */ if ((fd = dos_open(fnam, O_RDONLY)) >= 0) { /* open OK */ int rv; /* check for character device */ rv = isadev(fd); dos_close(fd); if (rv) return 1; /* is device name */ } *p = ':'; /* restore the original filename */ } return 0; /* no device name */ } ================================================ FILE: lib/optsb.c ================================================ /* $Id$ * Perform an option check and parse value for boolean This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2005/12/10 10:09:43 perditionc based on patches from Blair Campbell, additional LFN support (slim print, add initial cd,rd,md support, make compile time optional), remove some compiler warnings, and prevent extra linebreak for compatibility Revision 1.3 2005/09/03 18:15:10 perditionc dir /p /p works same as dir /p Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" int optScanBool_(const char * const optstr, int bool, const char *arg, int *value, int flip) { assert(optstr); assert(value); if(arg) { error_opt_arg(optstr); return E_Useage; } switch(bool) { case -1: *value = 0; break; case 0: if (flip) {*value = !*value; break; } /* else fall through to case 1 */ case 1: *value = 1; break; #ifndef NDEBUG default: fprintf(stderr, "Invalid boolean option value: in file %s line %u\n", __FILE__, __LINE__); abort(); #endif } return 0; } ================================================ FILE: lib/optsi.c ================================================ /* $Id$ * Perform an option check and parse value for integer This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" int optScanInteger_ (const char *const optstr, int bool_v, const char * arg, unsigned int * value) { unsigned int v; (void)bool_v; assert(optstr); assert(value); if(!arg || !*arg) { error_opt_noarg(optstr); return E_Useage; } v = 0; --arg; while(isdigit(*++arg)) v = v * 10 + *arg - '0'; if(*arg) { error_invalid_number(optstr); return E_Useage; } *value = v; return 0; } ================================================ FILE: lib/optss.c ================================================ /* $Id$ * Perform an option check and parse value for string This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" int optScanString_ (const char *const optstr, int bool_v, const char * arg, char ** value) { (void)bool_v; assert(optstr); assert(value); if(!arg) { error_opt_noarg(optstr); return E_Useage; } free(*value); if((*value = strdup(arg)) == 0) { error_out_of_memory(); return E_NoMem; } return 0; } ================================================ FILE: lib/parsenum.c ================================================ /* $Id$ * Parse any number of unsigned integer numbers in the range: * 0..9999 * * Input: s: String, != NULL * maxCnt: maximum number of numbers to parse * *cnt: receives the number of parsed numbers, != NULL * nums[]: receives the parsed numbers * * The string may consists of: * string ::= [whitespaces] [num_list [whitespaces]] * whitespaces ::= whitespace | whitespaces whitespace * whitespace ::= any_character_isspace()_returns_true_for * num_list ::= delimited_numbers [delimiter] * delimited_numbers ::= number | delimited_numbers delimiter number * number ::= digit | number digit * digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' * delimiter ::= any_character_ispunct()_and_isascii()_are_true_for * * There can be at maximum one spurious delimiter behind all the * numbers, except behind the maxCnt'th number. This allows to * type in "half" dates, e.g.: "3.3." for 3rd March (equal to: "3.3"); * but this is forbidden for: "3.3.1999.", because maxCnt is equal to * three, when dates are parsed. * * Return: * NULL: Fatal error, e.g. number exceeds boundary * else: pointer to first character not parsed This file bases on PARSENUM.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/misc.h" char *parsenum(const char *s, int maxCnt, int *cnt, int nums[]) { int n; if(!s || !cnt || !nums || maxCnt <= 0) return 0; *cnt = 0; /* skip leading whitespaces */ s = ltrimsp(s); while(isdigit(*s)) { /* scan next number */ n = 0; do { if(n >= 10000) return 0; n = n * 10 + *s - '0'; } while(isdigit(*++s)); nums[(*cnt)++] = n; if(!isascii(*s) || !ispunct(*s) || !--maxCnt) break; ++s; /* skip delimiter */ } return ltrimsp(s); } ================================================ FILE: lib/pr_date.c ================================================ /* $Id$ Parses a date given in ASCIIZ into a dosdate_t structure. 1 number -> day only (month & year filled with current values) 2 numbers -> day & month (year filled with current value) 3 numbers -> day, month,& year if datep == NULL, the result is not returned in *datep -> thus checking for valid values only Return: E_None: *datep filled E_Empty: empty line else: some error This file bases on DATE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 12:56:57 skaus bugfix: DATE: does not accept empty line Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/misc.h" #include "../include/nls.h" static unsigned char months[2][13] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} }; int parsedate (const char * s, struct dosdate_t *const datep) { struct dosdate_t d; unsigned char leap; int nums[3], items; assert(s); /* Parse at maximum three numbers */ s = parsenum(s, 3, &items, nums); if (!s || *s) /* general error or too many characters */ return E_Empty; _dos_getdate(&d); /* fetch current info */ #ifdef FEATURE_NLS refreshNLS(); assert(nlsBuf); assert(/*0 <= nlsBuf->datefmt && */ nlsBuf->datefmt <= 2); assert(nlsBuf->dateSep); switch(nlsBuf->datefmt) { case 0: /* mm/dd/yy */ #endif switch (items) { case 0: /* empty line --> always OK */ return E_Empty; case 1: /* single number --> day only */ d.day = nums[0]; break; case 3: /* three numbers --> year, month & day */ d.year = nums[2]; /* fall through */ case 2: /* two numbers --> month & day */ d.day = nums[1], d.month = nums[0]; break; } #ifdef FEATURE_NLS break; case 1: /* dd/mm/yy */ switch (items) { case 0: /* empty line --> always OK */ return E_Empty; case 3: /* three numbers --> year, month & day */ d.year = nums[2]; /* fall through */ case 2: /* two numbers --> month & day */ d.month = nums[1]; /* fall through */ case 1: d.day = nums[0]; break; } break; case 2: /* yy/mm/dd */ switch (items) { case 0: /* empty line --> always OK */ return E_Empty; case 3: /* three numbers --> year, month & day */ d.year = nums[0]; d.month = nums[1]; d.day = nums[2]; break; case 2: /* two numbers --> month & day */ d.month = nums[0]; d.day = nums[1]; break; case 1: d.day = nums[0]; break; } break; } #endif /* if only entered two digits for year, assume 1900's */ if (d.year < 80) d.year += 2000; else if (d.year < 200) d.year += 1900; leap = (!(d.year % 4) && (d.year % 100)) || !(d.year % 400); if ((d.month >= 1 && d.month <= 12) && (d.day >= 1 && d.day <= months[leap][d.month]) && (d.year >= 1980 && d.year <= 2099)) { if(datep) memcpy(datep, &d, sizeof(d)); return E_None; } return E_Range; } ================================================ FILE: lib/pr_prmpt.c ================================================ /* $Id$ * print the command-line prompt * */ #include "../config.h" #include #include "../include/command.h" #include "../include/misc.h" void printprompt(void) { char *pr; dbg_printmem(); pr = getEnv(PROMPTVAR); /* get PROMPT environment var. */ displayPrompt(pr? pr: DEFAULT_PROMPT); free(pr); } ================================================ FILE: lib/pr_time.c ================================================ /* $Id$ parsetime() parses the ASCII representation of a time into a dostime_t * One can specify: * ^\s*\d+.\d+(.(\d+(.\d*)?)?)?\s*([aApP]([mM]|\.[mM]\.)?\s*$ * If one specifies: * 1 number --> error * 2 numbers --> hour:minute, seconds & hundreds default to zero * 3 numbers --> hour:minute:seconds, hundreds defaults to zero * 4 numbers --> hour:minute:seconds.hundreds * The numbers may be delimited by any character from the 7-bit ASCII set, * which is printable, but not alphanumerical. This file bases on TIME.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/misc.h" #include "../include/nls.h" int parsetime(const char *s, struct dostime_t * const timep) { struct dostime_t t; int nums[4], items; int pm; assert(s); memset(nums, 0, sizeof(nums)); /* let default everything to zero */ /* Parse at maximum three numbers */ s = parsenum(s, 4, &items, nums); if (!s) /* general error */ return E_Syntax; /* 12 hour time format? */ pm = 0; /* no such flag */ switch(toupper(*s)) { case 'P': ++pm; /* post meridian */ case 'A': ++pm; /* ante meridian */ /* strip ?M or ?.M. */ if(toupper(s[1]) == 'M') s += 2; else if(memicmp(s + 1, ".M.", 3) == 0) s += 4; } if(*ltrimsp(s)) return E_Syntax; /* too many characters on line */ switch (items) { case 0: /* empty line --> always OK */ return E_Empty; case 1: /* single number --> error */ return E_Useage; #if 0 default: /* four numbers --> 1/100s, s, min, h */ /* else: 1/100s and/or s default to zero */ break; #endif } t.hour = nums[0]; t.minute = nums[1]; t.second = nums[2]; /* if missing defaults to previously set */ t.hsecond = nums[3]; /* values, aka 0 */ switch (pm) { case 2: /* post meridian */ if(t.hour != 12) t.hour += 12; break; case 1: /* antes meridian */ if (t.hour == 12) t.hour = 0; break; /* default: not specified --> nothing to do */ } if (t.hour >= 24 || t.minute >= 60 || t.second >= 60 || t.hsecond > 99) return E_Range; if(timep) memcpy(timep, &t, sizeof(t)); return E_None; } ================================================ FILE: lib/prf.c ================================================ /****************************************************************/ /* */ /* prf.c */ /* */ /* Abbreviated printf Function */ /* */ /* Copyright (c) 1995 */ /* Pasquale J. Villani */ /* All Rights Reserved */ /* */ /* This file is part of DOS-C. */ /* */ /* DOS-C is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation; either version */ /* 2, or (at your option) any later version. */ /* */ /* DOS-C is distributed in the hope that it will be useful, but */ /* WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */ /* the GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public */ /* License along with DOS-C; see the file COPYING. If not, */ /* write to the Free Software Foundation, 675 Mass Ave, */ /* Cambridge, MA 02139, USA. */ /****************************************************************/ #include #include #include #include #include #include <../include/misc.h> #include #define FALSE 0 #define TRUE 1 static char *charp, *pbuf; static void handle_char(int, FILE *); static char * ltob(long, char *, int); static int do_printf(FILE *f, const char *, register va_list); #ifndef DEBUG FILE *stdin = (FILE *)0, *stdout= (FILE *)1, *stderr = (FILE *)2; #endif static void flushbuf(FILE *f) { dos_write(fileno(f), pbuf, charp - pbuf); charp = pbuf; } int puts(const char *s) { return printf("%s\n", s); } /* special handler to switch between sprintf and printf */ static void handle_char(int c, FILE *f) { if (c == '\n') *charp++ = '\r'; *charp++ = c; /* flush buffer for '\n' or if full */ if (f && (charp - pbuf >= 79 || c == '\n')) flushbuf(f); } /* ltob -- convert an long integer to a string in any base (2-16) */ char *ltob(long n, char * s, int base) { unsigned long u; char *p, *q; int c; u = n; if (base == -10) /* signals signed conversion */ { base = 10; if (n < 0) { u = -n; *s++ = '-'; } } p = q = s; do { /* generate digits in reverse order */ *p++ = "0123456789ABCDEF"[(unsigned short) (u % base)]; } while ((u /= base) > 0); *p = '\0'; /* terminate the string */ while (q < --p) { /* reverse the digits */ c = *q; *q++ = *p; *p = c; } return s; } #define LEFT 0 #define RIGHT 1 /* printf -- short version of printf to conserve space */ int vprintf(const char * fmt, va_list arg) { return vfprintf(stdout, fmt, arg); } int vfprintf(FILE *f, const char * fmt, va_list arg) { char buf[80]; int ret; charp = pbuf = buf; ret = do_printf(f, fmt, arg); flushbuf(f); return ret; } int printf(const char * fmt, ...) { va_list arg; va_start(arg, fmt); return vfprintf(stdout, fmt, arg); } int fprintf(FILE *f, const char * fmt, ...) { va_list arg; va_start(arg, fmt); return vfprintf(f, fmt, arg); } int sprintf(char * buff, const char * fmt, ...) { va_list arg; va_start(arg, fmt); return vsprintf(buff, fmt, arg); } int vsprintf(char *buff, const char * fmt, va_list arg) { charp = buff; do_printf(NULL, fmt, arg); handle_char(0, NULL); return charp - buff - 1; } int do_printf(FILE *f, const char * fmt, va_list arg) { int base; char s[11]; char far * p; int c, flag, size, fill, precision; int longarg; long currentArg; while ((c = *fmt++) != '\0') { if (c != '%') { handle_char(c, f); continue; } longarg = FALSE; flag = RIGHT; fill = ' '; if (*fmt == '0') { fill = '0'; fmt++; } if (*fmt == '-') { flag = LEFT; fmt++; } for(;;) { if (*fmt == '*') { precision = va_arg(arg, int); fmt++; } else { precision = 0; while (*fmt >= '0' && *fmt <= '9') { precision = precision * 10 + (*fmt++ - '0'); } } if(c == '%') { size = precision; precision = -1; if (size < 0) { size = -size; flag = LEFT; } } if((c = *fmt) != '.')break; fmt++; } if (c == 'l') { longarg = TRUE; fmt++; } c = *fmt++; switch (c) { case '\0': return 0; case 'c': handle_char(va_arg(arg, int), f); continue; case 'p': { unsigned short w0 = va_arg(arg, unsigned int); char *tmp = charp; sprintf(s, "%04x:%04x", va_arg(arg, unsigned int), w0); p = s; charp = tmp; goto do_outputstring; } case 's': p = va_arg(arg, char *); goto do_outputstring; case 'F': fmt++; /* we assume %Fs here */ case 'S': p = va_arg(arg, char far *); goto do_outputstring; case 'i': case 'd': base = -10; goto lprt; case 'o': base = 8; goto lprt; case 'u': base = 10; goto lprt; case 'X': case 'x': base = 16; lprt: if (longarg) currentArg = va_arg(arg, long); else currentArg = base < 0 ? (long)va_arg(arg, int) : (long)va_arg(arg, unsigned int); ltob(currentArg, s, base); p = s; do_outputstring: size -= _fstrlen(p); if (flag == RIGHT) { for (; size > 0; size--) handle_char(fill, f); } for (; *p != '\0' && precision != 0; p++, precision--) handle_char(*p, f); for (; size > 0; size--) handle_char(fill, f); continue; case '%': handle_char(c, f); break; default: handle_char('?', f); handle_char(c, f); break; } } va_end(arg); return 0; } #ifdef TEST /* this testprogram verifies that the strings are printed correctly ( or the way, I expect them to print) compile like (note -DTEST !) c:\tc\tcc -DTEST -DI86 -I..\hdr prf.c and run. if strings are wrong, the program will wait for the ANYKEY */ #include void cso(char c) { putch(c); } struct { char *should; char *format; unsigned lowint; unsigned highint; } testarray[] = { { "hello world", "%s %s", (unsigned)"hello", (unsigned)"world"}, { "hello", "%3s", (unsigned)"hello", 0}, { " hello", "%7s", (unsigned)"hello", 0}, { "hello ", "%-7s", (unsigned)"hello", 0}, { "hello", "%s", (unsigned)"hello", 0}, { "1", "%d", 1, 0}, { "-1", "%d", -1, 0}, { "65535", "%u", -1, 0}, { "-32768", "%d", 0x8000, 0}, { "32767", "%d", 0x7fff, 0}, { "-32767", "%d", 0x8001, 0}, { "8000", "%x", 0x8000, 0}, { " 1", "%4x", 1, 0}, { "0001", "%04x", 1, 0}, { "1 ", "%-4x", 1, 0}, { "1000", "%-04x", 1, 0}, { "1", "%ld", 1, 0}, { "-1", "%ld", -1, -1}, { "65535", "%ld", -1, 0}, { "65535", "%u", -1, 0}, { "8000", "%lx", 0x8000, 0}, { "80000000", "%lx", 0, 0x8000}, { " 1", "%4lx", 1, 0}, { "0001", "%04lx", 1, 0}, { "1 ", "%-4lx", 1, 0}, { "1000", "%-04lx", 1, 0}, { "-2147483648", "%ld", 0, 0x8000}, { "2147483648", "%lu", 0, 0x8000}, { "2147483649", "%lu", 1, 0x8000}, { "-2147483647", "%ld", 1, 0x8000}, { "32767", "%ld", 0x7fff, 0}, { "ptr 1234:5678", "ptr %p", 0x5678, 0x1234}, 0}; test(char *should, char *format, unsigned lowint, unsigned highint) { char b[100]; sprintf(b, format, lowint, highint); printf("'%s' = '%s'\n", should, b); if (strcmp(b, should)) { printf("\nhit the ANYKEY\n"); getch(); } } main() { int i; printf("hello world\n"); for (i = 0; testarray[i].should; i++) { test(testarray[i].should, testarray[i].format, testarray[i].lowint, testarray[i].highint); } } #endif ================================================ FILE: lib/prprompt.c ================================================ /* $Id$ Parses a string as PROMPT string and display the result onto the screen This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.8 2006/09/04 19:35:42 blairdude Print long filename current directory Revision 1.7 2006/06/13 02:10:19 blairdude Cleaned up some code, moved write in outc to fwrite to make everybody happy (thanks to Arkady for the reports) Revision 1.6 2006/06/12 14:43:59 blairdude Fix for potential bug noticed by Arkady Revision 1.5 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.4 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.3 2004/05/03 20:36:50 skaus fix: PROMPT $V: include FreeCOM version information [#1776] Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #define FEATURE_ENVVARS_IN_PROMPT #include #include #include #include #include #include #include #include #include #include "../include/context.h" #include "../include/command.h" #include "../include/misc.h" #include "../err_fcts.h" #define PROMPTVAR "PROMPT" void displayPrompt(const char *pr) { #ifdef FEATURE_ENVVARS_IN_PROMPT char *buf = strdup(pr); char *expanded = malloc(MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8); if(buf && expanded) { if(!expandEnvVars(buf, expanded)) error_line_too_long(); else pr = expanded; } free(buf); #endif while (*pr) { if(*pr != '$') { outc(*pr); } else { switch (toupper(*++pr)) { case 'A': outc('&'); break; case 'B': outc('|'); break; case 'C': outc('('); break; /* case 'D': see below */ case 'E': outc(27); break; /* Decimal 27 */ case 'F': outc(')'); break; case 'G': outc('>'); break; case 'H': outc(8); break; /* Decimal 8 */ case 'L': outc('<'); break; /* case 'M': outc('<'); break; remote name of current drive */ /* case 'N': see below */ /* case 'P': see below */ case 'Q': outc('='); break; case 'S': outc(' '); break; /* case 'T': see below */ /* case 'V': see below */ case '$': outc('$'); break; case '_': outc('\n'); break; /* case '+': see below */ case 'D': { char *p; if((p = curDateLong()) != 0) { outs(p); free(p); } break; } case 'N': { outc( ( getdisk() + 'A' ) ); break; } case 'P': { #ifdef FEATURE_LONG_FILENAMES char pathname[MAXDIR]; IREGS r; int d; d = getdisk(); r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7147; r.r_dx = 0; r.r_si = FP_OFF(pathname); r.r_ds = FP_SEG(pathname); intrpt(0x21, &r); if(r.r_flags & 1 || r.r_ax == 0x7100) { r.r_ax = 0x4700; intrpt(0x21, &r); } if(r.r_flags & 1) break; printf("%c:\\", d + 'A'); outs(pathname); #else char *p; if((p = cwd(0)) != 0) { outs(p); free(p); } #endif break; } case 'T': { char *p; if((p = curTime()) != 0) { outs(p); free(p); } break; } case 'V': { /* #1776 fputs(shellname, stdout); */ printf("%s v%s", shellname, shellver); break; } case '+': /* Levels of PUSHD */ { #ifdef INCLUDE_CMD_PUSHD ctxt_info_t *info; int i; info = &CTXT_INFO_STRUCT(CTXT_TAG_DIRSTACK); assert(info); if((i = info->c_nummax) > 0) do { outc('+'); } while(--i); #endif } } } pr++; } #ifdef FEATURE_ENVVARS_IN_PROMPT free(expanded); #endif } ================================================ FILE: lib/readcmd.c ================================================ /* $Id$ Read a line from stdin */ #include "../config.h" #include "../include/command.h" #ifdef FEATURE_ENHANCED_INPUT static int use_enh = 1; int set_readcommandType(int enhanced) { int rv = use_enh; use_enh = ( enhanced != 0 ); return rv; } #else int set_readcommandType(int enhanced) { (void)enhanced; return 0; } #endif void readcommand(char * const str, int maxlen) { #ifdef FEATURE_ENHANCED_INPUT /* If redirected from file or so, should use normal one */ if (use_enh) readcommandEnhanced(str, maxlen); else readcommandDOS(str, maxlen); #else readcommandDOS(str, maxlen); #endif } ================================================ FILE: lib/realnum.c ================================================ /* $Id$ create an absolute number from the relative one */ #include "../config.h" #include #include "../include/context.h" #include "../include/misc.h" unsigned realNum(const Context_Tag tag, const int num) { ctxt_info_t *info; ctxtCheckInfoTag(tag); info = &CTXT_INFO_STRUCT(tag); if(num == 0) return info->c_nummax + 1; else if(num < 0) { int i = info->c_nummax + 1 + num; if(i > (int)info->c_nummin) return i; return (unsigned)-1; } return num; } ================================================ FILE: lib/res.c ================================================ /* $Id$ * RES.C - Resource handling for FreeCOM * * Contains all functions specific for FreeCOM * * int enumResources(altFnam, res_majorid_t, res_callbackp_t fct, void * arg) * Searches for all resources of the specified major ID in the * primary resource file, which is usually the execuatble itself. * On "open error: (rc == -1) the alternate filename "altFnam" is * tried, too. * The callback function is called like this: * int fct(res_majorid_t, res_minorid_t, length, int, arg) * The "length" parameter specifies the length of the data * block (unsigned long), the int fd is the resource file opened * in "r+b" modus <>, "arg" is the pointer passed to * enumREsources(). * The callback function may reposition the file, though, the file * itself must not be closed. * * If the callback function returns 0 (zero), the loop continues, * otherwise enumResource() is terminated and this value is returned. * * * Return: * 0: Nothing found or callback function always returned "0" itself * else: return value of callback function * -1: file open error * This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/res.h" #include "../include/command.h" int enumResources(res_majorid_t id , res_callbackp_t fct , void * const arg) { int ret; char *p = comResFile(); dprintf(("[RES: searching file '%s']\n", p)); ret = enumFileResources(p, id, fct, arg); free(p); return ret; } ================================================ FILE: lib/res_r.c ================================================ /* $id$ $Locker$ $Name$ $State$ * RES_R.C - Read resource * * Contains all functions to encapsule to "read" resources. * * int enumFileResources(fnam, res_majorid_t, int (*fct)(), void * arg) * Searches for all resources of the specified major ID in the * specified file. * The callback function is called like this: * int fct(res_majorid_t, res_minorid_t, length, FILE*, arg) * The "length" parameter specifies the length of the data * block (unsigned long), the file is the resource file opened * in "rb" modus, "arg" is the pointer passed to enumREsources(). * The callback function may reposition the file, though, the file * itself must not be closed. * * If the callback function returns 0 (zero), the loop continues, * otherwise enumResource() is terminated and this value is returned. * * Return: * 0: Nothing found or callback function always returned "0" itself * else: return value of callback function * -1: file open error * This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.8 2006/09/11 00:07:22 blairdude Fixed compilation completely with Turbo C Revision 1.7 2006/09/04 20:03:14 blairdude Support compiler oddity (Arkady) Revision 1.6 2004/08/18 17:18:10 skaus chg: res_r.c: don#('t use relative seek; fails under NTFSdos [Tom Ehlert] Revision 1.4 2002/11/05 19:34:38 skaus chg: enumResources(): handle fnam == 0 (file open error) Revision 1.3 2001/07/27 22:37:35 skaus bugfix: pre-compiled package BINARY.ZIP without command-line editing chg: FreeCOM archive (== executable) is opened read-only. Revision 1.2 2001/06/10 15:20:39 skaus add: error message if debugging when to open the resource file failed Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N TE 14 may 2004: there was some bug wrt NTFS4DOS, fixed. unwound this beautiful C puzzle to do this */ #include "../config.h" #include #include /* memcmp */ #include #if !defined(__GNUC__) && !defined(__WATCOMC__) || !defined(PTCHSIZE) || defined(__MINGW32__) #include /* filelength */ #endif #include "../include/resource.h" #ifdef PTCHSIZE #define dos_open open #define dos_read read #define dos_close close #if defined(__GNUC__) && !defined(__MINGW32__) #ifndef O_BINARY #define O_BINARY 0 #endif #include #include static long int filelength(int fd) { long int cur = lseek(fd, 0, SEEK_CUR); long int fsize = lseek(fd, 0, SEEK_END); lseek(fd, cur, SEEK_SET); return fsize; } #elif defined(__WATCOMC__) #include #include #endif #else #include "../include/misc.h" #endif int enumFileResources(const char *const fnam , res_majorid_t id , res_callbackp_t fct , void * const arg) { resource_t res; unsigned long pos; int rc; int fd; assert(fct); if(!fnam) return -1; rc = 0; #ifdef PTCHSIZE #define OMODE O_RDONLY | O_BINARY #else #define OMODE O_RDONLY #endif if((fd = dos_open(fnam, OMODE)) < 0) { rc = -1; dprintf(("[RES: Failed to open file: %s]\n", fnam)); #ifdef DEBUG perror("Open"); #endif /* resource file could be opened The first resource item is located at the end of the file, the var #("pos#(" is used to indicate the absolute position within the file as relative positioning is failing under NTFSdos {Tom Ehlert} */ } else if((pos = filelength(fd)) != (unsigned long)-1L) while (1) { if(pos <= sizeof(res) /* file corruption */ /* read and verify the resource ID block */ || lseek(fd, pos -= sizeof(res), SEEK_SET) < 0 /* seek error */ || dos_read(fd, &res, sizeof(res)) != sizeof(res) /* read error */ /* file corruption as magic string is missing */ || memcmp(res.res_cookie, RES_COOKIE, sizeof(res.res_cookie)) != 0 /* file corruption: not that many bytes left in file */ || pos < res.res_length /* failed to position to data block in the file */ || lseek(fd, pos -= res.res_length, SEEK_SET) < 0 ) break; if (res.res_majorID == id || id == RES_ID_ANY) if ((rc = fct(res.res_majorID , res.res_minorID , res.res_length , fd , arg)) != 0) break; } dos_close(fd); return rc; } ================================================ FILE: lib/res_vald.c ================================================ /* $Id$ Returns whether the passed-in file is a probably valid resource file. 0 -> is valid 1 -> no such file 2 -> is a device 3 -> not valid */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/misc.h" #include "../include/openf.h" #include "../include/resource.h" #include "../include/strings.typ" /* Is called only, if the Strings resource had been found, hence, returning TRUE alsways. */ static int test_fct (res_majorid_t major, res_minorid_t minor, unsigned long length, int fd, void *const arg) { (void)major, (void)length, (void)fd, (void)arg; assert(major == RES_ID_STRINGS); return minor == STRING_RESOURCE_MINOR_ID? 1 : 2; } int validResFile(const char * const fnam) { int fd; assert(fnam); if((fd = dos_open(fnam, O_RDONLY)) < 0) return 1; if(isadev(fd)) { dos_close(fd); return 2; } dos_close(fd); if(enumFileResources(fnam , RES_ID_STRINGS, test_fct, (void*)0) != 1) return 3; return 0; } ================================================ FILE: lib/res_w.c ================================================ /* $Id$ * RES_W.C - Write resource * * Contains all functions to encapsule to "write" resources. * * startResource(FILE *f, res_majorid_t , res_minorid_t) * Starts a new resource and issues the necessary prologue. * All the data should be dumped immediately now. * * endResource(FILE *f) * ends the resource and write the necessary epilogue. The * should be called when all data has been dumped; when the function * returns the file is positioned immediately behind the last byte * allocated by the resource. * * * Both functions must be called in sequence, that means first * startResource(), then endResource(), but no intermixing or * end() before start(). * This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include #include #include "../include/resource.h" /* information about the currently opened resource */ static resource_t res = { (long)-1, RES_ID_NONE, 0, RES_COOKIE }; void startResource(FILE *f, res_majorid_t major, res_minorid_t minor) { assert(f != 0); /* none resource is currently opened */ assert(res.res_majorID == RES_ID_NONE); res.res_length = ftell(f); assert(res.res_length != (unsigned long)-1); res.res_majorID = major; res.res_minorID = minor; } void endResource(FILE *f) { unsigned long pos; assert(f != 0); assert(res.res_majorID != RES_ID_NONE); pos = ftell(f); assert(pos != (unsigned long)-1); assert(pos >= res.res_length); res.res_length = pos - res.res_length; fwrite(&res, sizeof(res), 1, f); } ================================================ FILE: lib/resfile.c ================================================ /* $Id$ Return the name of the resource file */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../include/misc.h" char *comResFile(void) { if(isSwapFile) { char *p; if((p = comFile()) != 0) { assert(strlen(p) == isSwapFile + 3); memcpy(p + isSwapFile, "SWP", 3); if(exist(p)) return p; free(p); } } return comFile(); } ================================================ FILE: lib/rmtmpfil.c ================================================ /* $Id$ Remove temporary file, the filename is stored in a dynamically allocated buffer, which is also deallocated. * * Comments: * Creates unique filenames and creates the files, too. * The filenames do not contain an extension, but my * consume up to eight (8) characters as filename. * * The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%, * %TMPDIR%, "\\TEMP", "\\TMP", fullpath_of("."), ":\\", * "."; in that order, whichever returns a writeable location first * * The filenames are created within dymamic memory and must be * free()'ed by the caller himself. * The files are touched, meaning they are created with zero * length and no special attributes, but closed; the caller must * remove the file himself. * This file bases on TMPNAM.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void killtmpfn(char * const fn) { if (fn) { remove(fn); free(fn); } } ================================================ FILE: lib/rtrimcl.c ================================================ /* $Id$ * Name: rtrimcl() - right trims a string by removing trailing spaces A '\0' is placed to terminate the string. * Input: str - a pointer to a string * Output: str will have all spaces removed from the right. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands */ #include "../config.h" #include #include #include #include "../include/cmdline.h" void rtrimcl(char * const str) { char *p; assert(str); p = strchr(str, '\0'); while (--p >= str && isargdelim(*p)) ; p[1] = '\0'; } ================================================ FILE: lib/rtrimsp.c ================================================ /* $Id$ * Name: rtrimsp() - right trims a string by removing trailing spaces A '\0' is placed to terminate the string. * Input: str - a pointer to a string * Output: str will have all spaces removed from the right. This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/misc.h" void rtrimsp(char * const str) { char *p; assert(str); p = strchr(str, '\0'); while (--p >= str && isspace(*p)) ; p[1] = '\0'; } ================================================ FILE: lib/salloc.c ================================================ /* $Id$ set allocation strategy This file bases on MISC.C of FreeCOM v0.81 beta 1. This function had been imported from LH.ASM. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void dosSetAllocStrategy(int newState) { USEREGS _BX = newState; _AX = 0x5801; /* set allocation strategy */ geninterrupt(0x21); /* result ignored */ } ================================================ FILE: lib/samefile.c ================================================ /* $Id$ Return: -1: on out-of-memory error 0: if both true filenames differ 1: if both true filenames are the same This file bases on COPY.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include "../include/misc.h" int samefile(const char * const f1, const char * const f2) { char *t1, *t2; int differ; assert(f1); assert(f2); t1 = truepath(f1); t2 = truepath(f2); if(!t1 || !t2) differ = -1; else differ = strcmp(t1, t2) == 0; free(t1); free(t2); return differ; } ================================================ FILE: lib/scancmd.c ================================================ /* $Id$ * Scan command line and handle options * line may be NULL and is treated as empty. * opt may be NULL and is treated as "no valid option". * This will print an error message, if an option is specified. * Return: * == NULL: error, message already on screen any argument possibly * modified * != NULL: argument buffer, must be freed with "freep()" * + *argc := number of non-option arguments within array, & * + *opts := number of parsed options. * + array contains *argc entries now. This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/08/15 00:12:27 skaus bugfix: scancmd.c: /B and /A let COPY fail (ec == E_Ignore) (bug 829) upd: HTML docs Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" /* * Parse global options */ static int parseOptions(optScanner fct, void * const arg, char **argv, int *argc, int *optcnt) { int ec = E_None; char **argp, *a; assert(argv); assert(argc); assert(optcnt); *optcnt = 0; argp = argv; while((*argp++ = a = *argv++) != 0) if(isoption(a)) { if((ec = scanOption(fct, arg, a)) == E_None) { free(*--argp); /* ignore (overwrite) it */ ++*optcnt; } else if(ec != E_Ignore) { /* the entry caused an error */ /* Copy the remaining entries */ while((*argp++ = *argv++) != 0); break; } } *argc -= *optcnt; return ec == E_Ignore? E_None: ec; /* everything done */ } char **scanCmdline(char *line, optScanner fct, void * const arg , int *argc, int *opts) { char **argv; assert(argc); assert(opts); if((argv = split(line, argc)) == 0) { error_out_of_memory(); return 0; } if(parseOptions(fct, arg, argv, argc, opts) != E_None) { freep(argv); return 0; } return argv; } ================================================ FILE: lib/scanerr.pl ================================================ #!perl # Scan the err*.c files and create the ERROR.H include file. $src = shift; for (@ARGV) { push(@h, glob($_)); } @ARGV = @h; while(<>) { next unless /^void\s+[a-z]/; chomp; if(/^([^\(]+\([^\)]+\))\s*$/) { # simple case print "$1;\n"; } else { $line = $_ . "\n"; $cnt = 1; die "Syntax error in function definition" unless ($i = index($line, '(')) >= 0; $fnam = $ARGV; while($cnt) { if(++$i >= length($line)) { $_ = <>; die "Missing right parenthesis in file $fnam\n" if !$_ || $ARGV != $fnam; $line .= $_; } ++$cnt if substr($line, $i, 1) eq '('; --$cnt if substr($line, $i, 1) eq ')'; } print substr($line, 0, $i) . ";\n"; } } if($src) { die "Cannot open file $src: $!\n" unless open(SRC, $src); $i = rindex($src, "\\"); $j = rindex($src, '/'); if($i < 0 && $j < 0) { $dir = '.'; } else { $dir = substr($src, 0, $i > $j? $i: $j); } $cnt = 0; die "Cannot create Makefile include file: $dir/err_fcts.mk: $!\n" unless open(MK, ">$dir/err_fcts.mk"); while() { chop; die "Syntax error" unless /:=/; $header = $`; $body = "displayError($');"; if($header =~ /\(/) { $fctname = $`; } else { $fctname = $header; $header .= '(void)'; } $fnam = "$dir/err" . ++$cnt . '.c'; die "Cannot create $fnam: $!\n" unless open(OUT, ">$fnam"); print "void $header;\n"; print OUT "/* This is an automatic generated file DO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL. Error printing function providing a wrapper for STRINGS */ #include \"../config.h\" #include \"../include/misc.h\" #include \"../err_fcts.h\" #include \"../strings.h\" #undef $fctname void $header { $body } "; close OUT; } print MK "SRC_ERR = "; foreach $i (1..$cnt) { print MK " \\\n\terr$i.c" } print MK "\n\nOBJ_ERR = "; foreach $i (1..$cnt) { print MK " \\\n\terr$i.obj" } print MK "\n\n"; foreach $i (1..$cnt) { print MK "err$i.obj : err$i.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\n" } close MK; } ================================================ FILE: lib/scanopt.c ================================================ /* $Id$ * Scan an option and update its value within the option array * Return: 0 on success This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2002/11/06 20:36:37 skaus bugfix: /?: found on all the command line Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" unsigned currCmdHelpScreen = 0; int scanOption(optScanner fct, void * const ag, char *rest) { char *line, *arg, *optend; int ch, bool; assert(rest); if(!isoption(line = rest)) return -1; /* check for leading boolean character */ switch(*++line) { case '\0': return E_None; /* empty option */ case '-': bool = -1; ++line; break; case '+': bool = 1; ++line; break; default: bool = 0; break; } if(!isprint(ch = toupper(*line)) || strchr("-+=:", ch)) { error_illformed_option(rest); return E_Useage; } if(ch == '?' && currCmdHelpScreen) { displayString(currCmdHelpScreen); return E_Help; } if((optend = strpbrk(line, "=:")) != 0) { /* option has argument */ arg = optend + 1; } else { arg = 0; optend = strchr(line, '\0'); } /* check for trailing boolean character */ switch(optend[-1]) { case '-': bool = -1; --optend; break; case '+': bool = 1; --optend; break; } *optend = '\0'; if(!fct) { error_invalid_lswitch(line); return E_Useage; } return fct(line, line[1]? 0: ch, bool, arg, ag); } ================================================ FILE: lib/session.c ================================================ /* $Id$ Save/restore the current session this copies the Context into near memory (if space allows) and restores it later $Log$ Revision 1.5 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.4 2003/09/01 15:04:26 skaus bugfix: LOADHIGH: deallocating context if /L is present {Tom Ehlert} Revision 1.3 2002/11/12 21:56:17 skaus v0.83 Beta 52: Revision 1.2 2002/11/12 19:48:48 skaus bugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313] Revision 1.1 2002/11/12 18:31:57 skaus add: save/restore session (swap context) {Tom Ehlert} */ #include "../config.h" #include #include #include #include #include #include #include "../err_fcts.h" #include "../include/command.h" #include "../include/context.h" #include "../include/crossjmp.h" #include "../include/misc.h" static unsigned ctxtSavedSize; static void *ctxtSavePtr; void saveSession(void) { if(ctxt && swapContext) { ctxtSavedSize = mcb_length(ctxt); dprintf(("[MEM: save context: %u bytes from 0x%04x]\n" , ctxtSavedSize, ctxt)); ctxtSavePtr = malloc(ctxtSavedSize); if(ctxtSavePtr) { _fmemcpy(ctxtSavePtr, MK_FP(ctxt,0), ctxtSavedSize); DOSfree(ctxt); #ifdef DEBUG ctxt = 0; #endif } } } void restoreSession(void) { assert(ctxt == 0); if(ctxtSavePtr) { dprintf(("[MEM: restore context: %u bytes]\n", ctxtSavedSize)); ctxtCreateMemBlock(ctxtSavedSize); _fmemcpy( MK_FP(ctxt,0), ctxtSavePtr, ctxtSavedSize); free(ctxtSavePtr); ctxtSavePtr = 0; } } ================================================ FILE: lib/showcmds.c ================================================ /* $Id$ * show commands and options that are available. This file bases on INIT.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.7 2006/09/05 01:44:33 blairdude Massive patches from Arkady that I'm way too lazy to sort through. If anything happens, Arkady can answer for it. Revision 1.6 2006/06/22 06:39:43 blairdude The 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). Revision 1.5 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.4 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2002/04/02 18:09:31 skaus add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/command.h" #include "../include/kswap.h" #include "../include/misc.h" #include "../strings.h" int showcmds (char * rest) { struct CMD *cmdptr; int y; (void)rest; displayString(TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS); y = 0; cmdptr = internalCommands; while (cmdptr->name) { if (++y == 8) { puts(cmdptr->name); y = 0; } else printf("%-10s", cmdptr->name); cmdptr++; } if (y != 0) outc('\n'); displayString(TEXT_MSG_SHOWCMD_FEATURES); #ifdef FEATURE_ALIASES displayString(TEXT_SHOWCMD_FEATURE_ALIASES); #endif #ifdef FEATURE_ENHANCED_INPUT displayString(TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT); #endif #ifdef FEATURE_HISTORY displayString(TEXT_SHOWCMD_FEATURE_HISTORY); #endif #ifdef FEATURE_FILENAME_COMPLETION displayString(TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION); #endif #ifdef FEATURE_SWAP_EXEC displayString(TEXT_SHOWCMD_FEATURE_SWAP_EXEC); #endif #ifdef FEATURE_CALL_LOGGING displayString(TEXT_SHOWCMD_FEATURE_CALL_LOGGING); #endif #ifdef FEATURE_LAST_DIR displayString(TEXT_SHOWCMD_FEATURE_LAST_DIR); #endif #ifdef FEATURE_LONG_FILENAMES displayString(TEXT_SHOWCMD_FEATURE_LONG_FILENAMES); #endif #ifdef FEATURE_KERNEL_SWAP_SHELL displayString(TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL); #define INIT_DISPLAY_DEFAULT_SWAP_VALUE #endif #ifdef FEATURE_XMS_SWAP displayString(TEXT_SHOWCMD_FEATURE_XMS_SWAP); #define INIT_DISPLAY_DEFAULT_SWAP_VALUE #endif #ifdef INIT_DISPLAY_DEFAULT_SWAP_VALUE if(swapOnExec != ERROR && defaultToSwap == TRUE) displayString(TEXT_SHOWCMD_DEFAULT_TO_SWAP); #endif #ifdef FEATURE_INSTALLABLE_COMMANDS displayString(TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS); #endif #ifdef FEATURE_NLS displayString(TEXT_SHOWCMD_FEATURE_NLS); #endif #ifdef FEATURE_DIRSTACK displayString(TEXT_SHOWCMD_FEATURE_DIRSTACK); #endif #ifdef DEBUG displayString(TEXT_SHOWCMD_FEATURE_DEBUG); #endif outc('\n'); return 0; } ================================================ FILE: lib/skqwd.c ================================================ /* $Id$ * Skip a quoted word, stop at end of string or at the given string compared case-sensitively or, if not specified, any argument delimter. This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../include/cmdline.h" #if 0 char *skipqword(const char *pp, const char * const stop) { size_t len; int quote = 0; len = stop? strlen(stop): 0; if(*pp) do { if(quote) { if(quote == *pp) quote = 0; } else if(strchr(QUOTE_STR, *pp)) quote = *pp; else if(len? (memcmp(pp, stop, len) == 0): isargdelim(*pp)) break; } while(*++pp); return (char *) pp; /* strip const */ } #else char *skipqword(char *pp, const char * const stop) { size_t len; int quote = 0; char *pp_trunc = 0; len = stop? strlen(stop): 0; if(*pp) do { /* if we find a quote then continue until terminator or end of string found */ if(quote) { if(quote == *pp) { pp_trunc = 0; quote = 0; } else if(len && (memcmp(pp, stop, len) == 0)) { /* no matching quote, so back up to delimiter and mark end of pp */ char *p = pp; while(*p && (!quote || (quote != *p)) && !isargdelim(*p)) p--; p++; if (p < pp) *p='\0'; break; } else if(!pp_trunc && isargdelim(*pp)) { pp_trunc = pp; /* if end of string but no matching quote, terminate at 1st delimiter instead */ } } else if(strchr(QUOTE_STR, *pp)) quote = *pp; else if(len && (memcmp(pp, stop, len) == 0)) { /* no matching quote, so back up to delimiter and mark end of pp */ char *p = pp; while(*p && (!quote || (quote != *p)) && !isargdelim(*p)) p--; p++; if (p < pp) *p='\0'; break; } else if(!pp_trunc && isargdelim(*pp)) { pp_trunc = pp; /* truncate at delimter if not in quoted string */ break; } } while(*++pp); if (pp_trunc) { *pp_trunc = '\0'; /* never found end of quote so stop at first delimiter */ dprintf(("returning [%s]\n", pp_trunc+1)); return pp_trunc+1; } dprintf(("returning [%s]\n", pp)); return (char *) pp; /* strip const */ } #endif ================================================ FILE: lib/spfnam.c ================================================ /* $Id$ skip filename token return the pointer of the next character that is no is_fnchar() */ #include "../config.h" #include #include "../include/misc.h" char *skipfnam(const char * const fnam) { const char *p; assert(fnam); p = fnam - 1; while(is_fnchar(*++p)); return (char*)p; } ================================================ FILE: lib/split.c ================================================ /* $Id$ * split - splits a line up into separate arguments, deliminators * are spaces and /'s * Each option is placed into one individual argument. * The passed in string is preserved. This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.2 2003/03/09 12:09:40 skaus bugfix: split(): out-of-mem condition during building argument array Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/cmdline.h" char *skipnonoptdm(char *p); /* lib/find.c */ char *skipnonopt_word(char *p); static int addArg(char ***Xarg, int *argc, char *sBeg, char **sEnd, int ignore_options) { char **arg; assert(Xarg); assert(argc); assert(sEnd); assert(sBeg); *sEnd = (ignore_options ? skipnonopt_word(sBeg) : skip_word(sBeg)); /* find end of argument */ /* Because *start != '\0' && !isargdelim(*start) ==> s != start */ assert(*sEnd > sBeg); /* add new entry for new argument */ if((arg = realloc(*Xarg, (*argc + 2) * sizeof(char *))) == 0) { freep(*Xarg); return 1; } /* create new entry */ if((arg[*argc] = unquote(sBeg, *sEnd)) == 0) { freep(arg); return 1; } arg[++*argc] = 0; /* keep it a correct argv[] array if a freep() is triggered above */ *Xarg = arg; return 0; } static char **split_cmdline(char *s, int *args, int ignore_options) { char **arg, *start; int ac; assert(args); arg = malloc(sizeof(char *)); if (!arg) return 0; ac = 0; /* skip to next argument */ if(s) while (*(start = (ignore_options?skipnonoptdm(s):skipdm(s))) != '\0') { if(addArg(&arg, &ac, start, &s, ignore_options)) return 0; } arg[*args = ac] = 0; return arg; } char **split(char *s, int *args) { return split_cmdline(s, args, 0); } /* we must not split on option delimiters, only argument delimiters, see issue#52 */ char **split_batchargs(char *s, int *args) { return split_cmdline(s, args, 1); } ================================================ FILE: lib/sumblink.c ================================================ /* $Id$ Set UMB Link state This file bases on MISC.C of FreeCOM v0.81 beta 1. This function had been imported from LH.ASM. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include "../include/misc.h" void dosSetUMBLinkState(int newState) { USEREGS _BX = newState; _AX = 0x5803; /* set UMB link */ geninterrupt(0x21); /* result ignored */ } ================================================ FILE: lib/timeget.c ================================================ /* $Id$ gettime for TurboC++ prior v3 This file bases on TIMEFUNC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef _NO__DOS_TIME #include #include #include "../include/timefunc.h" void _dos_gettime(struct dostime_t *t) { IREGS r; r.r_ax = 0x2C00; intrpt(0x21, &r); t->hour = r.r_cx >> 8; t->minute = r.r_cx & 0xFF; t->second = r.r_dx >> 8; /* high bit */ t->hsecond = r.r_dx & 0xFF; /* low bit */ } #endif ================================================ FILE: lib/timeset.c ================================================ /* $Id$ settime for TurboC++ prior v3 This file bases on TIMEFUNC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #ifdef _NO__DOS_TIME #include #include #include "../include/timefunc.h" unsigned _dos_settime(struct dostime_t *t) { IREGS r; r.r_ax = 0x2D00; r.r_cx = ( ( t->hour & 0xFF ) << 8 ) | ( t->minute & 0xFF ); r.r_dx = ( ( t->second & 0xFF ) << 8 ) | ( t->hsecond & 0xFF ); intrpt(0x21, &r); if (( r.r_ax & 0xFF ) == 0xFF) /* Error occured setting time */ return -1; return 0; } #endif ================================================ FILE: lib/tmpnam.c ================================================ /* $Id$ make a filename of a temporary file. For consistency (atomic operation) the file is created as a zero-length file without special file permissions. * * Comments: * Creates unique filenames and creates the files, too. * The filenames do not contain an extension, but my * consume up to eight (8) characters as filename. * * The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%, * %TMPDIR%, "\\TEMP", "\\TMP", fullpath_of("."), ":\\", * "."; in that order, whichever returns a writeable location first * * The filenames are created within dymamic memory and must be * free()'ed by the caller himself. * The files are touched, meaning they are created with zero * length and no special attributes, but closed; the caller must * remove the file himself. * This file bases on TMPNAM.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #define probefn(path) mktempfile(path, 0) static char *probefnEnv(char *var) { char *p; char *fn = probefn(p = getEnv(var)); free(p); return fn; } char *tmpfn(void) { USEREGS char *fn; /* filename */ static char buf[] = "?:\\"; if ((fn = probefnEnv("TEMP")) == 0 && (fn = probefnEnv("TMP")) == 0 && (fn = probefnEnv("TEMPDIR")) == 0 && (fn = probefnEnv("TMPDIR")) == 0 && (fn = probefn("\\TEMP")) == 0 && (fn = probefn("\\TMP")) == 0 && (fn = probefn(".")) == 0) { /* everything failed --> probe the boot drive */ _DL = 0xff; /* to be safe for old DOS */ _AX = 0x3305; /* Get Boot drive, DOS 4+ */ geninterrupt(0x21); /* note: func 3305h will not return with setting CF on old DOS (3.x or earlier) */ buf[0] = (_CFLAG || _DL == 0xff) ? 'C' : _DL + 'A' - 1; fn = probefn(buf); /* If fn is NULL still, no temporary file can be created */ if (!fn) error_tempfile(); } return fn; } ================================================ FILE: lib/trimcl.c ================================================ /* $Id$ * Combines ltrimcl() & rtrimcl() $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands */ #include "../config.h" #include #include "../include/cmdline.h" char *trimcl(char *str) { assert(str); rtrimcl(str); return ltrimcl(str); } ================================================ FILE: lib/trimsp.c ================================================ /* $Id$ * Combines ltrimsp() & rtrimsp() This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/29 11:33:51 skaus chg: default heap size (tools\ptchsize) set to 6KB chg: error displaying functions centralized into lib\err_fcts.src add: displayError() chg: all errors are displayed through functions void error_*() bugfix: somtimes error messages are not displayed (see displayError()) bugfix: docommand(): type:file must pass ":file" to TYPE bugfix: error_sfile(): string _SFILE_ bugfix: error message on empty redirection bugfix: comma and semicolon ';' are recognized as argument seperators of internal commands Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/misc.h" char *trimsp(char *str) { assert(str); rtrimsp(str); return ltrimsp(str); } ================================================ FILE: lib/truepath.c ================================================ /* $Id$ * Make the given file spec an absolute path/file name. * Returns in a dynamically allocated buffer (free'ed by the caller) * on error: Displays "out of memory" (or appropriate) $Log$ Revision 1.3 2006/06/28 06:29:11 blairdude TRUENAME now supports long filenames Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL */ #include "../config.h" #include #include #include #include "../include/lfnfuncs.h" #include "../err_fcts.h" #include "../include/command.h" #include "../include/misc.h" char *truepath(const char * const fnam) { char *h; assert(fnam); #ifdef FEATURE_LONG_FILENAMES if((h = dfntruename(getshortfilename(fnam))) != 0) #else if((h = dfntruename(fnam)) != 0) #endif return h; display_errno_fnam_error(fnam); return 0; } ================================================ FILE: lib/truncate.c ================================================ /* $Id$ Truncate an opened file at the current position of the file pointer by file descriptor. Return: 0 -> OK != 0 -> error $Log$ Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2003/05/12 16:52:41 skaus add: copy(): Speed-Up by pre-creating the file {Tom Ehlert} */ #include "../config.h" #include #include #include "../include/misc.h" int truncate(int fd) { IREGS r; r.r_ax = 0x4000; /* Write to file descriptor */ r.r_bx = fd; r.r_cx = 0; /* Indicates "truncate" */ intrpt( 0x21, &r ); return r.r_ax; } ================================================ FILE: lib/txtlend.c ================================================ /* $Id$ * Returns the position of the first '\n' or '\0' character; * or NULL if the line overflows the buffer. * "overflow" means that no '\n' character was found and the line * is completely full, so, if the very last line has no newline character, * it is still considered "not overflowed". This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include "../include/misc.h" char *textlineEnd(const char * const buf, const size_t buflen) { const char *p, *end; if(!buf) return 0; end = buflen + (p = buf - 1); do { if(++p == end) /* The very last byte of the buffer is hit ==> there ougth to be a '\0' there ==> no '\n' AND no place for further character ==> overflow */ return 0; } while(*p && *p != '\n'); return (char *)p; /* strip "const" */ } ================================================ FILE: lib/unquote.c ================================================ /* $Id$ * removeQuotes - generates a new dynamically allocated string that * contains no quotes (outer most quotes). * The passed in string is preserved. * Return: NULL on memory allocation problems This file bases on CMDLINE.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/cmdline.h" char *unquote(const char *str, const char * const end) { char *h, *newStr; const char *q; size_t len; assert(str); assert(end); assert(end >= str); if((h = newStr = malloc(end - str + 1)) == 0) return 0; while((q = strpbrk(str, QUOTE_STR)) != 0 && q < end) { /* there is a quote at *q */ /* copy the portion before q */ memcpy(h, str, len = q++ - str); h += len; if((str = strchr(q, q[-1])) == 0 || str >= end) { /* no right quote */ str = q; break; } /* copy the quoted portion */ memcpy(h, q, len = str++ - q); h += len; } /* copy the remaining unquoted portion */ memcpy(h, str, len = end - str); h[len] = '\0'; /* to not waste one byte per deleted quote use this: h = realloc(newStr, strlen(newStr) + 1); assert(h); return h; -or- if you assume that to shrink can fail return (h = realloc(newStr, strlen(newStr) + 1)) != 0 ? h: newStr; */ return newStr; } ================================================ FILE: lib/vcgetch.c ================================================ /* $Id$ Get a character out-of-band and honor Ctrl-Break characters Visible, but does not advance the cursor. This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include "../include/keys.h" #include "../include/misc.h" int vcgetchar(void) { int ch; ch = cgetchar(); outc(isprint(ch) ? ch : ' '); outc('\b'); return cbreak? KEY_CTL_C: ch; } ================================================ FILE: lib/vcgetstr.c ================================================ /* $Id$ get a visual character that must match one of the supplied ones This file bases on MISC.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.4 2006/06/12 04:55:42 blairdude 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 significantly smaller. Revision 1.3 2006/06/11 02:47:05 blairdude Optimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment) Revision 1.2 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include #include #include #include #include #include #include "../include/command.h" #include "../include/misc.h" int vcgetcstr(const char *const legalCh) { int ch; assert(legalCh); while ((ch = vcgetchar()) == 0 || !strchr(legalCh, ch)) beep(); /* hit erroreous character */ outc('\n'); /* advance to next line */ return ch; } ================================================ FILE: lib/where.c ================================================ /* $Id$ Search for an external program and return it in a static buffer, which is overwritten the next time this function is called. This file bases on OPENF.C of FreeCOM v0.81 beta 1. $Log$ Revision 1.12 2006/08/23 06:45:37 blairdude Updated the PATH parsing routine (Arkady) Revision 1.8 2006/06/27 07:09:26 blairdude find_which now uses simpler functions to parse %PATH% to find executables. Revision 1.7 2006/06/26 18:36:36 blairdude FreeCOM can now execute long filenamed executable files. Revision 1.6 2005/12/10 10:09:43 perditionc based on patches from Blair Campbell, additional LFN support (slim print, add initial cd,rd,md support, make compile time optional), remove some compiler warnings, and prevent extra linebreak for compatibility Revision 1.5 2004/09/13 18:59:40 skaus add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer} Revision 1.4 2004/02/01 13:52:17 skaus add/upd: CVS $id$ keywords to/of files Revision 1.3 2004/02/01 13:24:22 skaus bugfix: misidentifying unspecific failures from within SUPPL Revision 1.2 2002/11/05 19:27:37 skaus bugfix: FreeCOM is to pass the fully-qualified path to DOS-4B-00 Revision 1.1 2001/04/12 00:33:53 skaus chg: new structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N */ #include "../config.h" #include /* free */ #include /* strlen, strcpy, memcpy */ #include "suppl.h" #include "dfn.h" /* dfnstat, DFN_FILE, dfnfullpath */ #include "../include/lfnfuncs.h" /* getshortfilename */ #include "../include/misc.h" /* getEnv, display_errno_fnam_error */ /* - Name without suffix(es) ("cmd") always searched with implicit suffixes ("cmd.com", "cmd.exe" and "cmd.bat"). - Name with explicit suffix(es) ("cmd.", "cmd.exe", "cmd.exe.bat") searched only with these suffix(es). - Found directory names are skiped. - PATH variable interated only for name without path ("cmd") or with relative path ("dir\cmd"); name with drive letter ("d:cmd") or absolute path ("\cmd", "\dir\cmd") searched only at this path. Returned pointer references heap, and this memory area will be freed on subsequent calls. */ char *find_which (const char *const name) { static char *pbuf = NULL; /* previously returned pointer */ char *envptr, *path; /* content of PATH env variable */ char buf [MAXPATH + 4]; /* buffer for PATH entry + name */ char *pname, *p; size_t len; free (pbuf), pbuf = NULL; /* copy name at end of buffer */ len = strlen (name); if (len > sizeof buf - 5) /* not enough space? */ return pbuf; p = buf + sizeof buf - 5, pname = strcpy (p - len, name); /* check for explicit suffix in name */ /*if (p > pname)*/ for (;;) { --p; if (*p == '.') break; /* explicit suffix? */ if (p <= pname || /* start of name? */ *p == '\\' || *p == '/' || *p == ':') { /* path separator? */ buf [sizeof buf - 5] = '.'; /* use implicit suffixes */ break; } } /* check for drive letter or absolute path */ p = pname, envptr = NULL; if (p [1] != ':' && *p != '\\' && *p != '/') envptr = getEnv ("PATH"); path = envptr; /* check current directory, then all entries in PATH */ for (;;) { if (buf [sizeof buf - 5] == '.') { strcpy (buf + sizeof buf - 4, "COM"); if (dfnstat (p) & DFN_FILE) break; strcpy (buf + sizeof buf - 4, "EXE"); if (dfnstat (p) & DFN_FILE) break; strcpy (buf + sizeof buf - 4, "BAT"); } if (dfnstat (p) & DFN_FILE) break; /* find next PATH entry, which fit in buf */ if (envptr == NULL || pname == buf) { free(path); return pbuf; } do { while (*envptr == ';') ++envptr; /* skip sequence of ';' */ if (*envptr == '\0') return pbuf; /* no more PATH entries? */ /* count PATH entry len */ len = 0; do ++len, ++envptr; while (*envptr && *envptr != ';'); /* add separator, if necessary, between name and path */ p = pname; if (envptr [-1] != '\\' && envptr [-1] != '/' && envptr [-1] != ':') --p, *p = '\\'; } while (len > p - buf); /* add path before name */ p = memcpy (p - len, envptr - len, len); } free(path); /* file found, now convert its path to full-qualified absolute one */ #ifdef FEATURE_LONG_FILENAMES if ((pbuf = dfnfullpath (getshortfilename (p))) == NULL) display_errno_fnam_error (getshortfilename (p)); #else if ((pbuf = dfnfullpath (p)) == NULL) display_errno_fnam_error (p); #endif return pbuf; } ================================================ FILE: license ================================================ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ================================================ FILE: makefile ================================================ # $Id$ # # Makefile for the FreeDOS kernel's command interpreter # # $Log$ # Revision 1.18 2003/04/28 15:57:43 skaus # v0.82 pl 2: # # Revision 1.17 2002/05/11 22:10:36 skaus # v0.83 Beta 40: # bugfix: ^Break detection after XMS-Swapping # # Revision 1.16 2001/07/27 22:37:34 skaus # bugfix: pre-compiled package BINARY.ZIP without command-line editing # chg: FreeCOM archive (== executable) is opened read-only. # # Revision 1.15 2001/04/29 11:33:50 skaus # chg: default heap size (tools\ptchsize) set to 6KB # chg: error displaying functions centralized into lib\err_fcts.src # add: displayError() # chg: all errors are displayed through functions void error_*() # bugfix: somtimes error messages are not displayed (see displayError()) # bugfix: docommand(): type:file must pass ":file" to TYPE # bugfix: error_sfile(): string _SFILE_ # bugfix: error message on empty redirection # bugfix: comma and semicolon ';' are recognized as argument seperators # of internal commands # # Revision 1.14 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # # .IMPORT : FREEDOS # # .IMPORT .IGNORE : LNG DEBUG NDEBUG # # INCDIR+=;$(FREEDOS)\SRC\INCLUDE;$(PWD:u)\\INCLUDE # # LIBDIR+=;$(FREEDOS)\SRC\LIB\$(_COMPILER) # # LDLIBS = $(FREEDOS)\SRC\LIB\$(_COMPILER)\Suppl_$(_MODEL).lib CMD\\CMDS.LIB LIB\\FREECOM.LIB STRINGS\\STRINGS.LIB # # LDFLAGS += /msl # # NASM *= c:\TOOL\NASMW.EXE # Use BC5 linker in order to use TD of BC5 # # LD_TLINK != D:\BC5\BIN\TLINK.EXE # Project specific C compiler flags # # MYCFLAGS_DBG = -UNDEBUG $(null,$(DEBUG) $(NULL) -DDEBUG=1) # # MYCFLAGS_NDBG = -DNDEBUG=1 -UDEBUG # # MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG)) # Project specific NASM compiler flags # # NASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s # # NASMFLAGS_NDBG = -s # # NASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG)) # # RUNMAKE = $(MAKE) LNG=$(LNG) NASM=$(NASM) DEBUG=$(DEBUG) NDEBUG=$(NDEBUG) MODEL=$(MODEL) .INCLUDE : _config.mk GLOBAL_DEPS = err_fcts.h # # .SOURCE.lib := $(LIBDIR:s/;/ /:u) # Sources of this make target SRC = # # .INCLUDE .IGNORE : lastmake.mk # # THISMAKE !:= $(_COMPILER):$(_MODEL):$(LNG):$(null,$(NDEBUG) DBG NDBG):$(LNG) # Default target all: com.com tools .INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl tags tags : ctags cmd\*.c lib\*.c shell\*.c .IF $(THISMAKE) == $(LASTMAKE) verscheck :; .ELSE verscheck : @+-echo Changed Make parameters, already made files invalid! +-echo LASTMAKE = $(THISMAKE) >lastmake.mk $(RUNMAKE) clobber .IF $(CFG) $(RUNMAKE) $(CFG) .ENDIF .ENDIF __errl: @+-if exist errlist del errlist >nul # -ctags *.c com.com .SEQUENTIAL : utils strings criter lib cmd shell\\com.exe infores @+copy /b shell\\com.exe + infores + criter\\criter + criter\\criter1 + strings\\strings.dat $@ infores : config.h include/command.h shell\\com.exe shell/com.map utils\mkinfres.exe /T$@.txt $@ shell\\com.map shell\\com.exe context : criter shell\\com.exe : shell subdirs.mk : makefile perl mksubmk.pl >$@ .INCLUDE : subdirs.mk err_fcts.h : lib\\err_fcts.src lib\\efct_*.c ; perl lib\\scanerr.pl lib\\err_fcts.src lib\\efct_*.c >$@ #MAKEDEP START #MAKEDEP STOP clobber : $(CLOBBER_DEPENDENCIES) my_clean $(RM) $(RMFLAGS) *.com *.cln subdirs.mk err_fcts.h *.cfg clean : $(CLEAN_DEPENDENCIES) dist : err_fcts.h utils $(DIST_DEPENDENCIES) command.lsm : command.com perl get_vers.pl $< my_clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp $(RM) $(RMFLAGS) strings.dat strings.h context.h_c criter1 criter2 context.inc infores doc .SETDIR=docs/html/commands : upd_html.bat ================================================ FILE: mkdist.bat ================================================ @echo off : Prepare binary distribution set DBG=Yes set DBG= : don't forget to pass on the default rather than mine copy config.std config.mak copy /u docs\download.txt . for %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) set _DBG=REM if NOT "%DBG%"=="" set _DBG= %_DBG setdos /y1 %+ %_DBG echo on set compiler=tc101 set compiler=bc5 set lng=english set model= set xms_swap= iff exist config.h.backup then echo config.h.backup exists echo something went wrong last time cancel 30 endiff iff not isdir old then mkdir old if not isdir old (echo Cannot create OLD %+ quit 10) else del /y old\*.* endiff for %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) %_DBG setdos /y0 %+ %_DBG echo off dmake clobber || quit %_DBG setdos /y1 %+ %_DBG echo on : pause : Make the "with debug" binary set ndebug= set debug=1 set compiler=bc5 %_DBG setdos /y0 %+ %_DBG echo off dmake MODEL!:=l || quit %_DBG setdos /y1 %+ %_DBG echo on : pause if not exist com.com goto ende move com.com packages\debug.std\command.com if exist com.com goto ende for %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) :noKSSFDBG : pause : Disable all debug stuff set ndebug=Yes set debug= set compiler=tc101 set model=s set XMS_SWAP=Yes %_DBG setdos /y0 %+ %_DBG echo off dmake || quit %_DBG setdos /y1 %+ %_DBG echo on if not exist com.com goto ende iff not exist utils\ptchsize.exe then echo no PTCHSIZE goto ende endiff utils\ptchsize.exe com.com +7KB if errorlevel 1 goto ende move com.com packages\xmsswap.std\command.com copy /b shell\com.exe +infores + criter\criter + criter\criter1 packages\localize.std\xmsswap.cln if exist com.com goto ende set XMS_SWAP= : pause ren /q config.h config.h.backup || cancel 20 echo #define IGNORE_ENHANCED_INPUT >config.h type config.h.backup >>config.h set err= %_DBG setdos /y0 %+ %_DBG echo off dmake || set err=%? %_DBG setdos /y1 %+ %_DBG echo on del /q config.h ren /q config.h.backup config.h || cancel 21 if not x%err == x cancel %err if not exist com.com goto ende iff not exist utils\ptchsize.exe then echo no PTCHSIZE goto ende endiff utils\ptchsize.exe com.com +6KB if errorlevel 1 goto ende move com.com packages\plainedt.std\command.com if exist com.com goto ende : pause del /q shell\*.exe lastmake.mk touch config.h %_DBG setdos /y0 %+ %_DBG echo off dmake -W config.h || quit %_DBG setdos /y1 %+ %_DBG echo on : pause if not exist com.com goto ende copy /b shell\com.exe +infores + criter\criter + criter\criter1 command.cln ren com.com command.com if exist com.com goto ende iff not exist utils\ptchsize.exe then echo no PTCHSIZE goto ende endiff utils\ptchsize.exe command.com +6KB if errorlevel 1 goto ende for %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) perl get_ver.pl .\command.com : %_DBG echo on %+ setdos /y1 :: Make HTML documents pushd docs\html\commands || quit echo Updating HTML documents call upd_html.bat popd : %_DBG echo on %+ setdos /y1 call mkpkgs.bat %_DBG setdos /y0 %+ %_DBG echo off dmake clean dist || quit %_DBG setdos /y1 %+ %_DBG echo on rm -frd old :ende ================================================ FILE: mkfiles/bc5.mak ================================================ .AUTODEPEND CC_BASE_PATH = $(BC5_BASE) BINPATH = $(CC_BASE_PATH)\BIN # Turbo/Borland C++ LIBPATH = $(CC_BASE_PATH)\LIB INCLUDEPATH = -I$(CC_BASE_PATH)\INCLUDE CC = $(BINPATH)\BCC # Borland C++ CL = $(CC) AR = $(BINPATH)\Tlib /C LD_RSP = command.rsp LD = $(BINPATH)\Tlink /m/s/l /c/d /i @$(LD_RSP) OBJC0 = $(LIBPATH)\c0$(SHELL_MMODEL).obj LIBC = $(LIBPATH)\c$(SHELL_MMODEL).lib FIXSTRSOPT = --lib1 CFG = TURBOC.CFG CFLAGS1 = -1- -a -f- -ff- -K -w+ -O -Z CFLAGS2 = -b- -v -L$(LIBPATH) # *Implicit Rules* .c.exe: $(CC) $< $(SUPPL_LIB_PATH)\SUPPL_$(SHELL_MMODEL).LIB .c.obj: $(CC) -c {$< } ================================================ FILE: mkfiles/gcc.mak ================================================ # Linux only for now DIRSEP = / ECHOTO = echo >> ECHOTODEP = LIBLIST = > ECHOLIB = echo >> ECHOLIBDEP = RMFILES = rm -f CP = cp LIBC = -li86 NASMFLAGS := $(NASMFLAGS) -felf SHELL_MMODEL_COMP = cmodel=small INCLUDEPATH = -I. -I../compat -I../suppl/compat COMPACT_MMODEL = -mcmodel=compact CC = ia16-elf-gcc CL = ia16-elf-gcc -mcmodel=small CLO = -o $@ AR = ia16-elf-ar crsv LD = $(CL) $(CFLAGS1) -o command.exe $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) command.ld $(LIBS) $(LIBC) -Wl,-Map,command.map CFG = gcc.cfg CFLAGS1 = -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 # *Implicit Rules* .SUFFIXES: .SUFFIXES: .c .asm .com .exe .obj ifeq ($(UTILS_BUILD),1) .c.exe: gcc -x c -Og -g -Wall -DGCC -D__GETOPT_H -I../suppl $< -o $@ else ifeq ($(COMPACT_MODEL),1) .c.obj .c.exe: @echo ------------------------------------------------------ @echo "$@ (DOS version) is not build because" @echo ia16-elf-gcc does not support the compact memory model @echo ------------------------------------------------------ .obj.exe: else .c.obj: $(CC) -c $< @$(CFG) -o $@ .c.exe .obj.exe: $(CL) $< @$(CFG) $(LIBS) $(LIBC) -o $@ endif ================================================ FILE: mkfiles/tc2.mak ================================================ CC_BASE_PATH = $(TC2_BASE) BINPATH = $(CC_BASE_PATH) # Turbo C LIBPATH = $(CC_BASE_PATH)\LIB INCLUDEPATH = -I$(CC_BASE_PATH)\INCLUDE CC = $(BINPATH)\TCC # Turbo C/C++ CL = $(CC) AR = $(BINPATH)\Tlib /C LD_RSP = command.rsp LD = $(BINPATH)\Tlink /m/s/l /c/d @$(LD_RSP) OBJC0 = $(LIBPATH)\c0$(SHELL_MMODEL).obj LIBC = $(LIBPATH)\c$(SHELL_MMODEL).lib FIXSTRSOPT = --lib2 CFG = TURBOC.CFG CFLAGS1 = -1- -a- -f- -ff- -K -w+ -O -Z CFLAGS2 = -L$(LIBPATH) # *Implicit Rules* .c.exe: $(CC) $< $(SUPPL_LIB_PATH)\SUPPL_$(SHELL_MMODEL).LIB .c.obj: $(CC) -c $< ================================================ FILE: mkfiles/turbocpp.mak ================================================ .AUTODEPEND CC_BASE_PATH = $(TP1_BASE) BINPATH = $(CC_BASE_PATH)\BIN # Turbo/Borland C++ LIBPATH = $(CC_BASE_PATH)\LIB INCLUDEPATH = -I$(CC_BASE_PATH)\INCLUDE CC = $(BINPATH)\TCC # Turbo C/C++ CL = $(CC) AR = $(BINPATH)\Tlib /C LD_RSP = command.rsp LD = $(BINPATH)\Tlink /m/s/l /c/d @$(LD_RSP) OBJC0 = $(LIBPATH)\c0$(SHELL_MMODEL).obj LIBC = $(LIBPATH)\c$(SHELL_MMODEL).lib FIXSTRSOPT = --lib2 CFG = TURBOC.CFG CFLAGS1 = -1- -a -f- -ff- -K -w+ -O -Z CFLAGS2 = -b- -L$(LIBPATH) # *Implicit Rules* .c.exe: $(CC) $< $(SUPPL_LIB_PATH)\SUPPL_$(SHELL_MMODEL).LIB .c.obj: $(CC) -c {$< } ================================================ FILE: mkfiles/watcom.mak ================================================ !ifdef __UNIX__ DIRSEP = / RMFILES = rm -f ECHOTO = echo >> ECHOTODEP = CP = cp !endif LIBLIST = > ECHOLIB = echo >> ECHOLIBDEP = !ifdef __UNIX__ LD = $(CL) -l=dos -fe=command.exe $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) -\"op map,statics,verbose,stack=4k\" !else LD_RSP = command.rsp LD = wlinker /ma/nologo @$(LD_RSP) !endif INCLUDEPATH = -I$(WATCOM)$(DIRSEP)h CC = wcc -zq -fo=.obj CL = wcl -zq -fo=.obj -bcl=dos CL386 = wcl386 -zq -fo=.obj AR = wlib -n -c CFG = watcomc.cfg CFLAGS1 = -os-s-wx # *Implicit Rules* !ifeq UTILS_BUILD 1 .c.exe: ! ifdef __LINUX__ $(CL386) -I$(WATCOM)$(DIRSEP)lh $< -fm -fe=$@ -I..$(DIRSEP)suppl ! else ifdef __MSDOS__ ! ifeq COMPACT_MODEL 1 $(CL) -mc -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl ! else $(CL) -ms -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl ! endif ! else ifdef __OSX__ clang -x c -Og -g -Wall -Wno-pragma-pack -DGCC -D__GETOPT_H -I../suppl $< -o $@ ! else $(CL386) -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl ! endif !else .c.obj: $(CC) $< -bt=dos @$(CFG) .obj.exe: wlink sys DOS f $< lib $(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib op q,map .c.exe: $(CL) $< @$(CFG) -\"op map,statics,verbose,stack=4k\" !endif ================================================ FILE: scripts/complng.pl ================================================ #!perl # Compare a language file of two different ages # Useage: $0 new old die "Useage: $0 new old\n" unless $ARGV[0] && $ARGV[1]; die "Cannot open $ARGV[1]: $!\n" unless open(IN, $ARGV[1]); while() { next unless /^:/; $name = $'; $name = $` if $name =~ /\#/; $name =~ s/\s+//g; $body = ''; while() { $body .= $_; last if /^[\.\,]\s*$/; } $string{$name} = $body; } close IN; unlink("$ARGV[0].old"); die "Cannot backup $ARGV[0]: $!\n" unless rename($ARGV[0], "$ARGV[0].old"); die "Cannot open backup $ARGV[0].old: $!\n" unless open(IN, "$ARGV[0].old"); die "Cannot create $ARGV[0]: $!\n" unless open(OUT, ">$ARGV[0]"); while() { if(/^:/) { $name = $'; $name = $` if $name =~ /\#/; $name =~ s/\s+//g; $body = ''; while() { $body .= $_; last if /^[\.\,]\s*$/; } $name .= '#1' unless $string{$name} eq $body; print OUT ":$name\n", $body; } else { print OUT; } } close IN; close OUT; ================================================ FILE: scripts/compsyms.pl ================================================ die "Useage: $0 this_map previous_map" unless $#ARGV == 1; die "Cannot open this map $ARGV[0]" unless open(IN, $ARGV[0]); while( ($_ = ) && !/^\s*Address/ ) {} LOOP1: while() { s/^\s*//; s/\s*$//; @F = split(/\s+/, $_); last LOOP1 if $F[0] eq 'Address'; if($#F == 1) { $sym{$F[1]} = 1; } elsif($#F == 2 && $F[1] eq 'Abs') { $sym{$F[2]} = 1; } } close IN; die "Cannot open previous map $ARGV[1]" unless open(IN, $ARGV[1]); while( ($_ = ) && !/^\s*Address/ ) {} LOOP1: while() { s/^\s*//; s/\s*$//; @F = split(/\s+/, $_); last LOOP1 if $F[0] eq 'Address'; if($#F == 1) { $nam = $F[1]; } elsif($#F == 2 && $F[1] eq 'Abs') { $nam = $F[2]; } else { next; } if(defined $sym{$nam}) { delete $sym{$nam}; } else { print "- $nam\n"; } } close IN; foreach $nam (sort keys %sym) { print "+ $nam\n"; } ================================================ FILE: scripts/director.bat ================================================ : $Id$ : Maintainer: Bernd Blaauw, bblnews@hotmail.com : to use on a cdrom to create localized versions @echo off ctty nul if [%1]==[makesys] goto makesys @REM Using auxiliary program to get current dir in variable %basepath%, set by prog @REM basepath.exe, ftp://garbo.uwasa.fi/pc/link/tsbat.zip (freeware, prof Timo Salmi) @REM TODO: also fix case of multiple FreeDOS installations! (easily done by above) @REM TODO: fix Xkeyb support. @REM TODO: how about mouse support? cdrom support [atapicdd.sys]? rem Detecting sample config.sys in freedos install destination dir, rem UPDATE THE FILESIZE NUMBER in line below (4749) if editing sample rem before distribution!!!!!!!!!!!!!!!!!!!!!!! if not exist %cdrom%\FREEDOS\INSTALL\BASEPATH.EXE goto end set destvar= %cdrom%\FREEDOS\FDOS\BIN\locate.com config.sys /S:4749! /O:&D /N /F:1 /G %cdrom%\FREEDOS\INSTALL\BASEPATH.EXE CONFIG.SYS PUSHD set destvar=%basepath% rem destvar has value C:\FDOS\ for example, inclusing ending \ !!! set basepath= rem %destvar% is the freedos install directory which was created, so alreadyy exists... if not exist %destvar%nul goto end set name1=c:\config.sys set name2=c:\autoexec.bat set name3=c:\command.com goto makeconf for %%x in ( c:\autoexec.bat c:\config.sys c:\command.com ) do if exist %%x goto FDname goto makeconf :FDname set name1=c:\fdconfig.sys set name2=%destvar%fdauto.bat set name3=%destvar%bin\command.com goto makeconf :makeconf cls if exist %name1% echo Skipped updating %name1% if exist %name1% goto makeauto echo Creating system configuration file . . . echo Creating multimenu templates for %name1% echo MENU 1 - Load FreeDOS and XMS-memory driver > %name1% echo MENU 2 - Load FreeDOS without drivers >> %name1% echo MENUDEFAULT=1,5 >> %name1% echo 1?DEVICE=%destvar%BIN\FDXXMS.SYS >> %name1% echo 1?DOS=HIGH >> %name1% echo 1?SHELL=%destvar%BIN\CMDXSWP.COM /P=%name2% >> %name1% echo 2?SHELL=%name3% /P=%name2% >> %name1% echo !LASTDRIVE=Z >> %name1% echo ECHO Loading remaining configuration files . . . >> %name1% goto makeauto :makeauto if exist %name2% echo Skipped updating %name2% if exist %name2% %name2% echo Creating system startup automation file [%name2%] echo @echo off > %name2% echo set lang=%lang% >> %name2% if not [%key%]==[false] echo set key=%key% >> %name2% echo set path=C:\;%destvar%;%destvar%bin >> %name2% type %cdrom%\FREEDOS\INSTALL\autofill.txt>>%name2% echo echo BootFiles: %name1%, %name2%, %name3%>> %name2% echo echo. >> %name2% echo echo Welcome to FreeDOS >> %name2% rem adding more files cls rem 1024 bytes Environment (almost) full, so clearing things.... set name1= set name2= set findfile= for %%x in ( [] [EN] [en] ) do if [%lang%]==%%x goto final set workdir=%cdrom%\freedos\install\freecom if not exist %workdir%\strings.%lang% echo Could not find FreeCOM %lang% messagefile for command.com translation. if not exist %workdir%\strings.%lang% goto final set copycmd=/y copy /b %workdir%\command.cln + %workdir%\strings.%lang% %name3% copy /b %workdir%\xms_swap.cln + %workdir%\strings.%lang% %destvar%\bin\cmdxswp.com cls echo FreeDOS command interpreter succesfully translated to language %lang% set workdir= goto final :final REM for easy adding to possible bootloader: REM we first save command.com if it exists, then run SYS with bootsector2file option, then restore the command.com if exist c:\command.fd8 del c:\command.fd8 if exist c:\fdbtsect.bin del c:\fdbtsect.bin if exist c:\command.com ren c:\command.com c:\command.fd8 SYS A: C: C:\FDBTSECT.BIN if exist c:\command.com del c:\command.com if exist c:\command.fd8 ren c:\command.fd8 c:\command.com rem prevent any SYS C: from overwriting the (localized) newest command.com!!! %cdrom%\freedos\fdos\bin\attrib +r %name3% cls alias boot = %cdrom%\freedos\install\director.bat makesys ctty con rem Configuring a graphical program like Seal2 is pointless in VMware! if [%VM%]==[TRUE] goto the_end if exist %destvar%seal2\install.exe Pause press a key to start manual Seal Desktop install if exist %destvar%seal2\install.exe %destvar%seal2\install.exe goto the_end :the_end ctty con echo Following things have just been done during postconfiguration: echo. echo * Set up alternate Config.sys file echo * Set up alternate Autoexec.bat file echo * Transfer FREEDOS core files, so your harddisk is almost bootable. echo * Save bootsector in C:\FDBTSECT.BIN for easy adding to a bootmanager echo - like Boot.ini for example echo * Translate command.com into the language you used during installation. echo * loading of some drivers and boot-settings. echo. echo Please type BOOT if you want to make your harddisk bootable, echo else reboot the system now. popd pushd goto end :makesys rem being called by the alias called BOOT to transfer bootsector and files, rem without overwriting the created translated command.com file sys a: c: if exist c:\command.com attrib -r -s -h c:\command.com attrib -r -s -h %name3% ctty con cls echo Your system is now bootable. We recommend to reboot the system goto end :end ctty con ================================================ FILE: scripts/disp_cmd.asm ================================================ ; Display the command line ; THE LAST CHARACTER MUST BE A DOLLAR SIGN!!! ; e.g.: ; C> disp_cmd=abcd$ mov ah, 9 mov dx, 81h int 21h mov ax, 4c00h int 21h int 20h ================================================ FILE: scripts/echolib.bat ================================================ @echo off if "%2%3%4%5%6%7%8%9" == "" goto nothing if '^(' == '(' goto :cmd_shell echo +%2 & >>%1 if "%3%" == "" goto nothing echo +%3 & >>%1 if "%4%" == "" goto nothing echo +%4 & >>%1 if "%5" == "" goto nothing echo +%5 & >>%1 if "%6" == "" goto nothing echo +%6 & >>%1 if "%7" == "" goto nothing echo +%7 & >>%1 if "%8" == "" goto nothing echo +%8 & >>%1 if "%9" == "" goto nothing echo +%9 & >>%1 goto :args_check :cmd_shell echo +%2 ^& >>%1 if "%3%" == "" goto nothing echo +%3 ^& >>%1 if "%4%" == "" goto nothing echo +%4 ^& >>%1 if "%5" == "" goto nothing echo +%5 ^& >>%1 if "%6" == "" goto nothing echo +%6 ^& >>%1 if "%7" == "" goto nothing echo +%7 ^& >>%1 if "%8" == "" goto nothing echo +%8 ^& >>%1 if "%9" == "" goto nothing echo +%9 ^& >>%1 :args_check shift if "%9" == "" goto nothing echo echolib.bat arguments overflow :nothing ================================================ FILE: scripts/echoto.bat ================================================ @echo off if "%2%3%4%5%6%7%8%9" == "" goto nothing echo %2 %3 %4 %5 %6 %7 %8 %9 >>%1 shift if "%9" == "" goto nothing echo echoto.bat arguments overflow :nothing ================================================ FILE: scripts/fetchseg.pl ================================================ die "Useage: $0 this_map previous_map\n" unless $#ARGV == 1; die "Cannot open this map file $ARGV[0]" unless open(IN, $ARGV[0]); LOOP1: while() { s/^\s+//; s/\s+$//; @F = split(/\s+/, $_); next if $#F < $[; last LOOP1 if $#F != 4; next if $F[4] eq 'Class'; $segs{$F[3]} = hex(substr($F[2], 0, length($F[2]) - 1)); } close IN; die "Cannot open previous map file $ARGV[1]" unless open(IN, $ARGV[1]); LOOP2: while() { s/^\s+//; s/\s+$//; @F = split(/\s+/, $_); next if $#F < $[; last LOOP2 if $#F != 4; next if $F[4] eq 'Class'; $len = hex(substr($F[2], 0, length($F[2]) - 1)); if(defined $segs{$F[3]}) { $len = $segs{$F[3]} - $len; delete $segs{$F[3]}; } $total += $len; $len = "+" . $len if $len > 0; (print("$F[3]: $len\n"), $disp = 1) if $len; } close IN; $total = "+" . $total if $total > 0; print "Total: $total\n" if $disp; ================================================ FILE: scripts/findstrg.pl ================================================ #!perl # Searches for string codes in sources $lng = shift; die "Useage: $0 lng-file {source-files}\n" unless $lng; foreach $pattern (@ARGV) { if(substr($pattern, 0, 1) eq '-') { $pattern = substr($pattern ,1); $negate = 1; } else { $negate = 0; } foreach $file (glob($pattern)) { if(-f $file) { $ofile = lc($file); if($negate) { delete $files{$ofile}; } else { $files{$ofile} = $file; } } } } foreach $ofile (sort keys %files) { $file = $files{$ofile}; warn "Cannot open file $file: $!\n" unless open(IN, $file); while() { while(/\b(TEXT|PROMPT)_[A-Z_]+\b/) { $string{$&} = 1; $_ = $'; } } close IN; } die "Cannot open lng file: $!\n" unless open(IN, $lng); while() { next unless /^:/; $name = $'; $name = $` if $name =~ /\#/; $name =~ s/\s+//g; $body = ''; while() { $body .= $_; last if /^[\.\,]\s*$/; } print $name . "\n" unless $string{$name}; } close IN; ================================================ FILE: scripts/makecmd.bat ================================================ @echo off : Copyright (C) Bernd Blaauw : Creates localized FreeCOM-versions depending on which language files : are available in the current directory : Note: all versions use default lang (compiled in) for critical errors, usually English : Usage: makecmd : makecmd YY Name : where no arguments creates all variants : where YY Name just creates version for specified language if "%1"=="continue" goto loop SET MAKEALL=%1 if "%1"=="" SET MAKEALL=EN if "%1"=="" del strings.* > NUL set languages=%1 %2 if "%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 call %0 continue %languages% :: do english last and keep the strings.dat if "%1"=="" call %0 continue EN English set languages= set MAKEALL= goto end :loop shift if "%1"=="" goto end set lang=%1 goto compile ::if exist %1.lng del %1.lng goto end :compile if "%2"=="" goto end for %%x in ( command.cln xmsswap.cln fixstrs.exe default.lng %2.lng ) do if not exist %%x goto end if exist strings.err del strings.err if exist strings.log del strings.log fixstrs %2.lng copy strings.dat strings.%1 > NUL if "%MAKEALL%"=="%1" copy /b command.cln + strings.dat command.com > NUL if "%MAKEALL%"=="%1" copy /b xmsswap.cln + strings.dat xmsswap.com > NUL if exist strings.err echo Translation file out of date for language %2 [file: %2.lng]! if exist strings.log echo Translation file out of date for language %2 [file: %2.lng]! :: leave strings.dat if matches MAKEALL, which must be last language specified, i.e. leave a default STRINGS.DAT if NOT "%MAKEALL%"=="%1" if exist strings.dat del strings.dat if NOT "%MAKEALL%"=="%1" if exist strings.log del strings.log if exist strings.h del strings.h shift goto loop :end if "%lang%"=="" echo Warning: nothing done due to LANG variable not set ================================================ FILE: scripts/mkxref.pl ================================================ #!perl # Generate Xref from all local *.OBJ files and the C standard library ##### Environmental settings # How to dump .OBJ/.LIB files ## '%f%' is substituted by the source filename $dump = 'tdump %f%'; # Name of C standard library $clib = 'd:\bc5\lib\cs.lib'; # Name of SUPPL library $suppl = 'suppl_s.lib'; # Names of files to be ignored while generted the dependency %ignoreFile = ('c0.asm' => 1); ##### End of user-configurable settings open(LOG, ">mkxref.log") or die "Cannot create mkxfer.log: $!"; @files = <*.dmp>; # Read in all local source files $mkextref = sub { $ext{$name} .= ',' . $file; $extf{$file} .= ',' . $name; }; foreach $file (@files) { print STDERR "Processing $file ...\n"; $file =~ tr/A-Z/a-z/; next if $file =~ /^(suppl|clib)_.\.dmp$/; &scan($file, sub { $file = $name; } , sub { if(defined $pub{$name}) { &warning("$name multiply defined: $pub{$name} and $file"); } else { $pub{$name} = $file; $pubf{$file} .= ",$name"; } } , $mkextref); } print STDERR "Processing SUPPL library...\n"; &scan('suppl_s.dmp', sub { $file = "Suppl<$name>"; } , sub { if(defined $pub{$name}) { &warning("$name in $file overridden by $pub{$name}"); --$warning; } else { $pub{$name} = $file; $pubf{$file} .= ",$name"; } } , $mkextref); print STDERR "Processing C library...\n"; &scan('clib_s.dmp', sub { $file = "Clib<$name>"; } , sub { if(defined $pub{$name}) { &warning("$name in $file overridden by $pub{$name}"); --$warning; } else { $pub{$name} = $file; $pubf{$file} .= ",$name"; } } , $mkextref); die "Solve the warnings before proceed" if $warning; print STDERR "Generating file dependency information...\n"; # "What files reference a given symbol" foreach $symbol (keys %pubf) { $reftbl{$symbol} = ''; %refby = ('' => -1, $symbol => -1); # $refSyms: symbols exports the given file and can be # referenced by other files $refSyms = $pubf{$symbol}; $depth = 0; while($refSyms) { ++$depth; # Aquire where these symbols are located $files = ''; foreach $name (split(',', $refSyms)) { # The exported symbols of the files referenced at this depth are # referenced are referenced themselves by these files $files .= $ext{$name}; } $refSyms = ''; # Aquire which symbols are externally referenced by the new files $sym = '|'; foreach $file (split(',', $files)) { if(!defined $refby{$file} && !defined $ignoreFile{$file}) { $reftbl{$symbol} .= $sym . $file; $sym = ','; $refby{$file} = $depth; # the $file references the current file, now determine # which files reference symbols exported by this one # to get a recursive list $refSyms .= $pubf{$file}; } } } } # "What files a given symbol references" foreach $symbol (keys %extf) { $needtbl{$symbol} = ''; %needs = ('' => -1, $symbol => -1); $needSyms = $extf{$symbol}; $depth = 0; while($needSyms) { ++$depth; # Aquire which files the imported symbols are located in $newneedSyms = ''; $sym = '|'; foreach $name (split(',', $needSyms)) { $file = $pub{$name}; if(!defined $needs{$file} && !defined $ignoreFile{$file}) { $needs{$file} = $depth; $needtbl{$symbol} .= $sym . $file; $sym = ','; # $file is referenced by the current file, now determine # which symbols are referenced by this one $newneedSyms .= $extf{$file}; } } $needSyms = $newneedSyms; } } print STDERR "Processing MAP file...\n"; @ARGV = <*.map> unless @ARGV; while(<>) { last if /Publics by Value/; } $lastSegm = $lastAddr = ''; @names = (); @files = (); while(<>) { next unless /^\s*([0-9a-fA-F]+):([0-9a-fA-F]+)\s+(\S+)\s*$/; $segm = $1; $addr = $2; $name = $3; push(@names, $name); if(defined $pub{$name}) { $file = $pub{$name}; $files{$file} = 1; } if($lastSegm eq $segm) { $len{$lastName} = hex($addr) - hex($lastAddr); } $lastSegm = $segm; $lastAddr = $addr; $lastName = $name; } print "Imported symbols:\n\t" . join("\n\t", sort @names) . "\n"; print "Linked files:\n\t" . join("\n\t", sort keys %files) . "\n"; foreach $name (sort @names) { print "\n$name: "; if(defined $pub{$name}) { $file = $pub{$name}; print "PUBDEF in $file\n"; } else { print "no PUBDEF\n"; } if(defined $len{$name}) { print "\testimated length: $len{$name} byte\n"; } &printRec("references", 'references nothing', $needtbl{$pub{$name}}); &printRec("referenced by", 'never referenced', $reftbl{$pub{$name}}); } sub files { local($files) = @_; local($file); local($h) = ''; foreach $file (split(',', $files)) { if($file && defined $files{$file}) { $h .= ", $file"; } } return substr($h, 2); } sub warning { ++$warning; print LOG join("\n", @_) . "\n"; print STDERR join("\n", @_) . "\n"; } sub scan { local($file, $thecode, $pubcode, $extcode) = @_; open(IN, "$file") or die "Cannot open $file"; while() { $code = '' if /^\S/; if(/\bTHEADR\s+(\S+)\s*$/) { $name = $1; $name =~ tr/A-Z/a-z/; &$thecode; } elsif(!$code && /\bPUBDEF\b/) { $_ = $'; $code = $pubcode; } elsif(!$code && /\bEXTDEF\b/) { $_ = $'; $code = $extcode; } &processList($code) if $code; } close IN; } sub processList { local($code) = @_; if(/\'([^\']+)\'/) { $name = $1; &$code; } } sub printRec { local($yesStr, $noStr, $files) = @_; local(@files, $depth, $prompt, $fil, $dep); if(length($files) > 1) { @files = split(/\|/, $files); $prompt = "==$yesStr"; $dep = 0; foreach $depth ($[..$#files) { $fil = &files($files[$depth]) and (print "$prompt: $fil\n"), $prompt = " depth #" . ++$dep; } } else { $noStr and print "==$noStr\n"; } } ================================================ FILE: scripts/rmfiles.bat ================================================ @echo off :loop_commandline if \%1 == \ goto done_with_commandline if exist %1 del %1>nul shift goto loop_commandline :done_with_commandline ================================================ FILE: scripts/sav.btm ================================================ @echo off : setdos /y1 echo on iff %# == 0 then echo Useage: %@name[%0] COM.* description else set max=0 for /a:d %dir in (c[1-9]*) (set num=%@substr[%dir,1]if %num GT %max set max=%num) set ldir=..\c%max set dir=c%@eval[%max+1] mkdir %dir iff not isdir %dir then echo Cannot create directory %dir else dmake32 xref || (Echo failed to create XREF quit 20) pushd %dir echo %& >info copy /q ..\com.* ..\xref ..\mkxref.log . perl ..\fetchseg.pl com.map %ldir\com.map >chg_segs perl ..\compsyms.pl com.map %ldir\com.map >chg_syms echo Backup %dir created iff %@filesize[chg_segs,b] GT 0 then echo Changes of the length of the segments: type chg_segs endiff iff %@lines[chg_syms] GE 0 then echo The number of symbols changed by %@eval[%@lines[chg_syms]+1] endiff popd endiff endiff ================================================ FILE: shell/batch.c ================================================ /* $Id$ * BATCH.C - batch file processor for COMMAND.COM. * * Comments: * * ??/??/?? (Evan Jeffrey) * started. * * 15 Jul 1995 (Tim Norman) * modes and bugfixes. * * 08 Aug 1995 (Matt Rains) * i have cleaned up the source code. changes now bring this source * into guidelines for recommended programming practice. * * i have added some constants to help making changes easier. * * 29 Jan 1996 (Steffan Kaiser) * made a few cosmetic changes * * 05 Feb 1996 (Tim Norman) * - changed to comply with new first/rest calling scheme * * 14 Jun 1997 (Steffen Kaiser) * - bug fixes. added error level expansion %?. ctrl-break handling * * 16 Jul 1998 (Hans B Pufal) * - Totally reorganised in conjunction with COMMAND.C (cf) to implement * proper BATCH file nesting and other improvements. * * 16 Jul 1998 (John P Price ) * - Seperated commands into individual files. * * 19 Jul 1998 (Hans B Pufal) [HBP_001] * - Preserve state of echo flag across batch calls. * * 19 Jul 1998 (Hans B Pufal) [HBP_002] * - Implementation of FOR command * * 20-Jul-1998 (John P Price ) * - added error checking after malloc calls * * 27-Jul-1998 (John P Price ) * - added config.h include * * 02-Aug-1998 (Hans B Pufal) [HBP_003] * - Fixed bug in ECHO flag restoration at exit from batch file * * 10-Aug-1998 ska * - added modifyable batchfile (standard behaviour) * - corrected ^Break processing * - added "newBatchContext()" to create/clear/chain a bcontext variable * - added initBatchContext() & clearBatchContext() to make changes in the * bcontext structure easier. * * 12-Aug-1998 ska * - added tracemode variable, however, it's currently ignored * * 1998/12/05 ska * - fix: ECHO state of interactive command line was not properly preserved * * 1999/04/23 ska * bugfix: batch_param(): Missing right quote, after stopping the do-while * loop, the '\0' byte is copied, then s2 incremented --> right of string. * bugfix: batch(): fullname is duplicated into heap, but * not freed if this function fails * bugfix: batch(): no error checking of batch_params() * * 1999/05/06 ska (see CMT2.TXT) * bugfix: FOR %a IN (dir\*.*) :: must expand to dir\... * bugfix: %9 wrong, if 9 > number of parameters * chg: %0 returns full name now * add: exit_all_batch() for session management * * 1999/07/08 ska * add: find_arg() returns a valid string for all, even negative indexes */ #include "../config.h" #include #include #include #include #include #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../include/batch.h" #include "../err_fcts.h" #ifdef INCLUDE_CMD_LFNFOR extern unsigned char lfnfor; #else #define lfnfor 0 #endif struct bcontext *bc = 0; /* The stack of current batch contexts. * NULL when no batch is active */ unsigned int echo = 1; /* The echo flag */ int tracemode = 0; /* debug trace of scripts */ /* Returns a pointer to the n'th parameter of the current batch file. * If no such parameter exists returns pointer to empty string. * If no batch file is current, returns NULL */ char *find_arg_bc(struct bcontext const * const b, int n) { dprintf(("[find_arg (%d)]\n", n)); if(!b) return 0; n += b->shiftlevel; if(n == 0) return b->bfirst; if(n > b->numParams || n < 0) return ""; return b->params[n - 1]; } struct bcontext *activeBatchContext(void) { struct bcontext *b = bc; while(b && b->forvar) b = b->prev; return b; } /* see split(...) in lib\split.c -- we must not split on option delimiters, only argument delimiters, see issue#52 */ char **split_batchargs(char *s, int *args); /* * setBatchParams builds a parameter list in newly allocated memory. * The parameters consist of null terminated strings with a final * NULL character signalling the end of the parameters. */ int setBatchParams(char *s) { if((bc->params = split_batchargs(s, &bc->numParams)) == 0) { error_out_of_memory(); return 0; } return 1; } /* Move init/clear functionality out of the files in order to centralize * the low-level functionality --> easier to add/remove members of bcontext */ static void clearBatchContext(struct bcontext *b) { assert(b); if (b->bfile) dos_close(b->bfile); if (b->bfnam) free(b->bfnam); if (b->bfirst) free(b->bfirst); if (b->blabel) free(b->blabel); if (b->ffind) free(b->ffind); if (b->forproto) free(b->forproto); if (b->forvar) free(b->forvar); if (b->params) freep(b->params); } static void initBatchContext(struct bcontext *b) { assert(b); memset(b, 0, sizeof(*b)); b->brewind = 1; } void exit_batch(void) { /* * If a batch file is current, exits it, freeing the context block and * chaining back to the previous one. * * If no new batch context is found, sets ECHO back ON. * * If the parameter is non-null or not empty, it is printed as an exit * message */ dprintf(("exit_batch (..)\n")); if (bc) { struct bcontext *t = bc; if (bc->blabel) error_bfile_no_such_label(bc->bfnam, bc->blabel); clearBatchContext(bc); echo = bc->echo; /* Preserve echo state across batch calls */ bc = bc->prev; free(t); } if (!bc) /* Notify ^Break handler to cancel "leave all" state */ chkCBreak(BREAK_ENDOFBATCHFILES); } #if 0 /* kill all batch contexts */ void exit_all_batch(void) { while(bc) exit_batch(); } #endif /* Create/Clear/Chain all fields of the structure */ struct bcontext *newBatchContext(void) { struct bcontext *b; b = malloc(sizeof(*b)); if (!b) { error_out_of_memory(); return 0; } initBatchContext(b); b->echo = echo; /* a new context must always preserve the current ECHO state */ b->prev = bc; return bc = b; } /* * Batch files are entitled to be "modifyable" and may span across * floppy disks (you know: calling an external program that says * "Please insert next floppy", then the INSTALL.BAT file on the * the "next floppy" is accessed rather the originally opened one). * The current implementation keeps the batchfile open, which is not * the standard behaviour. */ int batch (char * fullname, char * firstword, char * param) { /* * Start batch file execution * * The firstword parameter is the full filename of the batch file. */ assert(fullname); assert(firstword); assert(param); if((fullname = abspath(fullname, 1)) == 0) return 1; dprintf(("batch ('%s', '%s', '%s')\n", fullname, firstword, param)); while (bc && bc->forvar) /* Kill any and all FOR contexts */ exit_batch(); if (bc == 0) /* No current batch file, create new context */ { if (!newBatchContext()) { free(fullname); return 1; } } else { /* Then we are transferring to another batch */ struct bcontext *q; int echo; clearBatchContext(bc); q = bc->prev; /* preserve context chain intact */ echo = bc->echo; /* preserve former ECHO state */ /* if the _current_ ECHO state would be preserved, the following case would forget about the ECHO state on the interactive command line: === File BATCH1.BAT @echo off batch2 === File BATCH2.BAT @echo off === The transfer to BATCH2 would destroy BTACH1's context and therefore the original ECHO state. because BATCH2 is called with ECHO OFF, this state would be preserved as the command line's ECHO state */ initBatchContext(bc); bc->prev = q; bc->echo = echo; } bc->bfnam = fullname; /* already duplicated */ if(0 == (bc->bfirst = strdup(firstword)) || !setBatchParams(param)) { /* out of memory condition */ exit_batch(); /* clear this erroreous batch context */ return 1; } return 0; } static int getbline(int fd, char *textline, int len, int bufsize) { /* get line from batchfile, and fill textline buffer if necessary */ /* input: fd = file descriptor textline = buffer len = length of previous line, if len>0 the buffer needs to be shifted. bufsize = total length of the buffer, except for trailing '\n'. output: returns static variable size = active length of buffer, or 0 if error. textline contains a batch file window on demand. */ static int size; if (len == 0) size = len; else { size -= len; if (size > 0) { memmove(textline, &textline[len], size+1); if (textlineEnd(textline, size)) return size; } else size = 0; } if (size < bufsize) { int sz = dos_read(fd, &textline[size], bufsize - size); if (sz >= 0) { size += sz; textline[size] = '\n'; return size; } } return 0; } char *readbatchline(int *eflag, char *textline, int size) { /* * Read and return the next executable line from the current batch file * * If no batch file is current or no further executable lines are found * return NULL. * * Here we also look out for FOR bcontext structures which trigger the * FOR expansion code. * * Set eflag to 0 if line is not to be echoed else 1 */ char *first; char *ip; int len; if (bc == 0) /* No batch */ return 0; dprintf(("readbatchline ()\n")); assert(textline); assert(size > 1); assert(eflag); ip = ""; /* make sure ip != NULL in the first iteration of the loop */ len = 0; first = 0; while (bc) { first = 0; /* by default return "no file" */ if (bc->forvar) /* If its a FOR context... */ { int forvarlen; char *fv1, *sp, /* pointer to prototype command */ *dp, /* Place to expand protoype */ *fv; /* Next list element */ if (chkCBreak(BREAK_FORCMD) || bc->shiftlevel > bc->numParams) /* End of list or User break so... */ { exit_batch(); /* just exit this context */ continue; } fv1 = fv = getArgCur(0); if (bc->ffind) { /* First already done fo do next */ if( #ifdef FEATURE_LONG_FILENAMES lfnfor ? lfnfindnext( bc->ffind ) != 0 : #endif sfnfindnext((struct ffblk *)bc->ffind) != 0) /* no next file */ { dos_findclose( bc->ffind ); free(bc->ffind); /* free the buffer */ bc->ffind = 0; bc->shiftlevel++; /* On to next list element */ continue; } fv = bc->ffind->ff_name; } else { if (strpbrk(fv, "?*") == 0) { /* element is not wild file */ bc->shiftlevel++; /* No -> use it and shift list */ fv1 = ""; /* No additional info */ } else { /* Wild file spec, find first (or next) file name */ /* For first find, allocate a find first block */ if ((bc->ffind = malloc(sizeof(*bc->ffind))) == 0) { error_out_of_memory(); exit_batch(); /* kill this FOR context */ break; } if( #ifdef FEATURE_LONG_FILENAMES lfnfor ? lfnfindfirst( fv, bc->ffind, (bc->forFlags&FLAG_OPT_DIRECTORY? FA_DIREC:FA_NORMAL) ) == 0 : #endif sfnfindfirst( fv, ( struct ffblk * )bc->ffind, (bc->forFlags&FLAG_OPT_DIRECTORY? FA_DIREC:FA_NORMAL) ) == 0 ) { /* found a file */ *dfnfilename(fv) = '\0'; /* extract path */ fv = bc->ffind->ff_name; } else { /* if not found use the string itself */ #if 0 /* To use the pattern is not compatible with MS COMMAND */ ++bc->shiftlevel; fv1 = ""; /* No additional info */ #else free(bc->ffind); /* free the buffer */ bc->ffind = 0; bc->shiftlevel++; /* On to next list element */ continue; #endif } } } /* At this point, fv points to parameter string */ /* fv1 is the string usually set to the path to the found file, otherwise it points to "" */ sp = bc->forproto; /* pointer to prototype command */ dp = textline; /* Place to expand protoype */ assert(sp); assert(bc->forvar); forvarlen = strlen(bc->forvar); while (*sp) { if (memcmp(sp, bc->forvar, forvarlen) == 0) dp = stpcpy(stpcpy(dp, fv1), fv), sp += forvarlen; else *dp++ = *sp++; /* Else just copy */ } *dp = '\0'; assert(dp - textline <= size); *eflag = echo; first = textline; if(*first == '@') { /* don't echo this line */ first = ltrimcl(first + 1); *eflag = 0; } break; } if (!bc->bfile) { /* modifyable batchfiles */ if ((bc->bfile = dos_open(bc->bfnam, O_RDONLY)) == 0) { error_bfile_vanished(bc->bfnam); exit_batch(); continue; } bc->bclose = 1; if (bc->brewind) { bc->brewind = 0; /* fopen() position at start of file */ bc->blinecnt = 0; bc->bpos = 0; } else if (lseek(bc->bfile, bc->bpos, SEEK_SET) == -1) { /* end of file reached */ /* so says MS COMMAND */ exit_batch(); continue; } } else if(bc->brewind) { lseek(bc->bfile, 0, SEEK_SET); bc->brewind = 0; bc->blinecnt = 0; bc->bpos = 0; } assert(ip != 0); ++bc->blinecnt; if (chkCBreak(BREAK_BATCHFILE) /* User break */ || getbline(bc->bfile, textline, len, size-1) == 0 /* End of file.... */ || (ip = textlineEnd(textline, size)) == 0) /* line too long */ { if (!ip) error_long_batchline(bc->bfnam, bc->blinecnt); exit_batch(); continue; } /* Strip leading spaces and \n chars */ /* rtrimsp(textline); must not remove trailing spaces */ first = memchr(textline, '\n', size); len = first + 1 - textline; bc->bpos += len; while(--first >= textline && ( *first == '\n' || *first == '\r' ) ); first[1] = '\0'; first = ltrimcl(textline); assert(first); if(*first == '@') { /* don't echo this line */ first = ltrimcl(first + 1); *eflag = 0; } else *eflag = echo; /* ignore empty lines */ if(!*first) continue; if(*first == ':') { /* if a label is searched for test if we reached it */ if(bc->blabel) { /* label: the 1st word immediately following the colon ':' */ for(ip = ++first; isgraph(*ip); ++ip) ; *ip = '\0'; if (stricmp(first, bc->blabel) == 0) { /* OK found */ free(bc->blabel); bc->blabel = 0; } } continue; /* ignore label */ } if(bc->blabel) continue; /* we search for a label! */ /* Got a line to execute */ break; } if (bc && bc->bclose) { /* modifyable batchfiles - ska */ dos_close(bc->bfile); bc->bfile = 0; bc->bclose = 0; } return first; } ================================================ FILE: shell/cb_catch.asm ================================================ ; $Id$ ; ^Break signal catcher and initialization function. ; Bases on CB_CATCH.ASM ; It is activated only, if FreeCOM is active. ; --> FreeCOM polls the ^Break state actively, so the ^C press is ; recorded, but ignored otherwise ; There are several possibility to communicate with FreeCOM, because ; FreeCOM actively polls the ^Break status, this implementation ; optimizes for the polling rather this handler. ; $Log$ ; Revision 1.3 2004/02/01 13:52:18 skaus ; add/upd: CVS $id$ keywords to/of files ; ; Revision 1.2 2002/04/02 18:09:31 skaus ; add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) ; ; Revision 1.1 2001/04/12 00:09:06 skaus ; chg: New structure ; chg: If DEBUG enabled, no available commands are displayed on startup ; fix: PTCHSIZE also patches min extra size to force to have this amount ; of memory available on start ; bugfix: CALL doesn't reset options ; add: PTCHSIZE to patch heap size ; add: VSPAWN, /SWAP switch, .SWP resource handling ; bugfix: COMMAND.COM A:\ ; bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed ; add: command MEMORY ; bugfix: runExtension(): destroys command[-2] ; add: clean.bat ; add: localized CRITER strings ; chg: use LNG files for hard-coded strings (hangForEver(), init.c) ; via STRINGS.LIB ; add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts ; add: fixstrs.c: prompts & symbolic keys ; add: fixstrs.c: backslash escape sequences ; add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C ; chg: splitted code apart into LIB\*.c and CMD\*.c ; bugfix: IF is now using error system & STRINGS to report errors ; add: CALL: /N ; ; Revision 1.1.1.1.4.2 2001/02/18 21:08:23 skaus ; add: command WHICH ; fix: BUILD.BAT and accompanying makefiles for TC++ v1.01 ; ; Revision 1.1.1.1.4.1 2001/02/18 17:59:36 skaus ; bugfix: KSSF: restore parentPSP on exit ; chg: Using STRINGS resource for all non-interactive messages ; chg: moving all assembly files to NASM ; %include "../include/model.inc" %include "../include/stuff.inc" ;segment _DATA ; EXTERN _ctrlBreak segment _TEXT ; GLOBAL _initCBreak cglobal cbreak_handler cglobal CBreakCounter ;_initCBreak: ; ;; At this point DS is the segment of _ctrlBreak ; mov WORD [CS:?freecomSegment], ds ; ret ;?freecomSegment DW 0 CBreakCounter DW 0 cbreak_handler: %ifdef DEBUG dec BYTE [CS:strEnd] jz noRecurs inc BYTE [CS:strEnd] jmp short recurs noRecurs: push ds, dx, ax, bp mov dx, strBeg mov ax, cs mov ds, ax mov ah, 9 int 21h inc BYTE [strEnd] pop ds, dx, ax, bp %endif ;; ^Break of COMAMND --> just set the variable inc WORD [CS:CBreakCounter] recurs: clc ;; tell DOS to proceed retf 2 %ifdef DEBUG strBeg: db 0dh, 0ah, 'COMMAND: ^Break detected. ', 0dh, 0ah, 0dh, 0ah, '$' strEnd db 1 %endif ================================================ FILE: shell/cmdtable.c ================================================ /* $Id$ * CMDTABLE.C - table of internal commands. * * Comments: * * 16 Jul 1998 (Hans B Pufal) * started. * New file to keep the internal command table. I plan on * getting rid of the table real soon now and replacing it * with a dynamic mechnism. * * * 27 Jul 1998 John P. Price * - added config.h include * * 12-Aug-1998 ska * - enabled the reference to the CTTY dummy * * 2000/01/15 ska * - CTTY is dummy no longer * * 2000/06/22 ska * add: DIRS/PUSHD/POPD patch D. Lucas Parker * add: CDD * * 2000/12/10 ska * chg: Uppercased command names (support for Installable Commands) * * 2001/02/16 ska * add: command WHICH */ #include #include "../config.h" #include "../include/command.h" #include "../strings.h" /* a list of all the internal commands, associating their command names */ /* to the functions to process them */ /* Lines marked * $$ are external commands * !! internal commands which are not yet implemented * ** special FREEDOS specific implementation */ struct CMD internalCommands[] = { #ifdef FEATURE_ALIASES {"ALIAS", 0, cmd_alias, TEXT_CMDHELP_ALIAS}, #endif #ifdef INCLUDE_CMD_BEEP {"BEEP", 0, cmd_beep, TEXT_CMDHELP_BEEP}, #endif #ifdef INCLUDE_CMD_BREAK {"BREAK", CMD_NO_ERRORLEVEL, cmd_break, TEXT_CMDHELP_BREAK}, #endif {"CALL", CMD_SPECIAL_DIR | CMD_BATCHONLY, cmd_call, TEXT_CMDHELP_CALL}, #ifdef INCLUDE_CMD_CHDIR {"CD", CMD_SPECIAL_DIR, cmd_chdir, TEXT_CMDHELP_CD}, {"CHDIR", CMD_SPECIAL_DIR, cmd_chdir, TEXT_CMDHELP_CD}, #endif #ifdef INCLUDE_CMD_CDD {"CDD", CMD_SPECIAL_DIR, cmd_cdd, TEXT_CMDHELP_CDD}, #endif #ifdef INCLUDE_CMD_CHCP { "CHCP", 0, cmd_chcp, TEXT_CMDHELP_CHCP}, #endif #ifdef INCLUDE_CMD_CLS {"CLS", CMD_NO_ERRORLEVEL, cmd_cls, TEXT_CMDHELP_CLS}, #endif #ifdef INCLUDE_CMD_COPY { "COPY", CMD_SPECIAL_DIR, cmd_copy, TEXT_CMDHELP_COPY }, #endif #ifdef INCLUDE_CMD_CTTY { "CTTY", 0, cmd_ctty , TEXT_CMDHELP_CTTY}, #endif #ifdef INCLUDE_CMD_DATE {"DATE", CMD_NO_ERRORLEVEL, cmd_date, TEXT_CMDHELP_DATE}, #endif #ifdef INCLUDE_CMD_DEL {"DEL", CMD_SPECIAL_DIR, cmd_del, TEXT_CMDHELP_DEL}, #endif #ifdef INCLUDE_CMD_DIR {"DIR", CMD_SPECIAL_DIR, cmd_dir, TEXT_CMDHELP_DIR}, #endif #ifdef INCLUDE_CMD_DIRS {"DIRS", 0, cmd_dirs, TEXT_CMDHELP_DIRS}, #endif #ifdef FEATURE_HISTORY {"DOSKEY", CMD_NO_ERRORLEVEL, cmd_doskey, TEXT_CMDHELP_DOSKEY}, #endif {"ECHO", CMD_SPECIAL_ALL | CMD_NO_ERRORLEVEL, cmd_echo, TEXT_CMDHELP_ECHO}, #ifdef INCLUDE_CMD_DEL {"ERASE", CMD_SPECIAL_DIR, cmd_del, TEXT_CMDHELP_DEL}, #endif {"EXIT", 0, internal_exit, TEXT_CMDHELP_EXIT}, #ifdef DEBUG {"EXIT!!", 0, force_exit, TEXT_CMDHELP_EXIT}, #endif {"FOR", CMD_NO_ERRORLEVEL, cmd_for, TEXT_CMDHELP_FOR}, {"GOTO", CMD_BATCHONLY | CMD_NO_ERRORLEVEL, cmd_goto, TEXT_CMDHELP_GOTO}, #ifdef FEATURE_HISTORY {"HISTORY", 0, cmd_history, TEXT_CMDHELP_HISTORY}, #endif {"IF", CMD_NO_ERRORLEVEL, cmd_if, TEXT_CMDHELP_IF}, #ifdef FEATURE_LONG_FILENAMES #ifdef INCLUDE_CMD_LFNFOR {"LFNFOR", CMD_NO_ERRORLEVEL, cmd_lfnfor, TEXT_CMDHELP_LFNFOR}, #endif #endif #ifdef INCLUDE_CMD_FAKELOADHIGH {"LH", CMD_SPECIAL_DIR, cmd_call, TEXT_CMDHELP_CALL}, {"LOADHIGH", CMD_SPECIAL_DIR, cmd_call, TEXT_CMDHELP_CALL}, #endif #ifdef INCLUDE_CMD_LOADHIGH {"LH", CMD_SPECIAL_DIR, cmd_loadhigh, TEXT_CMDHELP_LH}, {"LOADHIGH", CMD_SPECIAL_DIR, cmd_loadhigh, TEXT_CMDHELP_LH}, #endif #ifdef INCLUDE_CMD_LOADFIX {"LOADFIX", CMD_SPECIAL_DIR, cmd_loadfix, TEXT_CMDHELP_LOADFIX}, #endif #ifdef INCLUDE_CMD_MEMORY {"MEMORY", CMD_NO_ERRORLEVEL, cmd_memory, TEXT_CMDHELP_MEMORY}, #endif #ifdef INCLUDE_CMD_MKDIR {"MD", CMD_SPECIAL_DIR, cmd_mkdir, TEXT_CMDHELP_MD}, {"MKDIR", CMD_SPECIAL_DIR, cmd_mkdir, TEXT_CMDHELP_MD}, #endif #ifdef INCLUDE_CMD_PATH {"PATH", CMD_SPECIAL_ALL, cmd_path, TEXT_CMDHELP_PATH}, #endif #ifdef INCLUDE_CMD_PAUSE {"PAUSE", CMD_NO_ERRORLEVEL, cmd_pause, TEXT_CMDHELP_PAUSE}, #endif #ifdef INCLUDE_CMD_PROMPT {"PROMPT", 0, cmd_prompt, TEXT_CMDHELP_PROMPT}, #endif #ifdef INCLUDE_CMD_PUSHD {"PUSHD", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_pushd, TEXT_CMDHELP_PUSHD}, #endif #ifdef INCLUDE_CMD_POPD {"POPD", CMD_NO_ERRORLEVEL, cmd_popd, TEXT_CMDHELP_POPD}, #endif #ifdef INCLUDE_CMD_RMDIR {"RD", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_rmdir, TEXT_CMDHELP_RD}, #endif #ifdef INCLUDE_CMD_REM {"REM", CMD_NO_ERRORLEVEL, cmd_rem, TEXT_CMDHELP_REM}, #endif #ifdef INCLUDE_CMD_RENAME {"REN", CMD_SPECIAL_DIR, cmd_rename, TEXT_CMDHELP_REN}, {"RENAME", CMD_SPECIAL_DIR, cmd_rename, TEXT_CMDHELP_REN}, #endif #ifdef INCLUDE_CMD_RMDIR {"RMDIR", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_rmdir, TEXT_CMDHELP_RD}, #endif #ifdef INCLUDE_CMD_SET {"SET", CMD_NO_ERRORLEVEL, cmd_set, TEXT_CMDHELP_SET}, #endif {"SHIFT", CMD_BATCHONLY | CMD_NO_ERRORLEVEL, cmd_shift, TEXT_CMDHELP_SHIFT}, #ifdef INCLUDE_CMD_TIME {"TIME", CMD_NO_ERRORLEVEL, cmd_time, TEXT_CMDHELP_TIME}, #endif #ifdef INCLUDE_CMD_REM {"TITLE", CMD_NO_ERRORLEVEL, cmd_rem, TEXT_CMDHELP_REM}, #endif #ifdef INCLUDE_CMD_TRUENAME {"TRUENAME", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_truename, TEXT_CMDHELP_TRUENAME}, #endif #ifdef INCLUDE_CMD_TYPE {"TYPE", CMD_SPECIAL_DIR, cmd_type, TEXT_CMDHELP_TYPE}, #endif #ifdef INCLUDE_CMD_VER {"VER", CMD_NO_ERRORLEVEL, cmd_ver, TEXT_CMDHELP_VER}, #endif #ifdef INCLUDE_CMD_VERIFY {"VERIFY", 0, cmd_verify, TEXT_CMDHELP_VERIFY}, #endif #ifdef INCLUDE_CMD_VOL {"VOL", 0, cmd_vol, TEXT_CMDHELP_VOL}, #endif #ifdef INCLUDE_CMD_QUESTION {"?", CMD_NO_ERRORLEVEL, showcmds, TEXT_CMDHELP_QUESTION}, #endif #ifdef DEBUG {"FDDEBUG", CMD_NO_ERRORLEVEL, cmd_fddebug, TEXT_CMDHELP_FDDEBUG}, #endif #ifdef INCLUDE_CMD_WHICH {"WHICH", 0, cmd_which, TEXT_CMDHELP_WHICH}, #endif {0, 0, 0, 0} }; /* append, $$ */ /* assign, $$ */ /* attrib, $$ */ /* backup, $$ */ /* chkdsk, $$ */ /* command, $$ */ /* comp, $$ */ /* debug, $$ */ /* diskcomp, $$ */ /* diskcopy, $$ */ /* doskey, ** */ /* dosshell, $$ */ /* edit, $$ */ /* edlin, $$ */ /* emm386, $$ */ /* exe2bin, $$ */ /* expand, $$ */ /* fastopen, $$ */ /* fc, $$ */ /* fdisk, $$ */ /* find, $$ */ /* format, $$ */ /* graftabl, $$ */ /* graphics, $$ */ /* help, $$ */ /* join, $$ */ /* keyb, $$ */ /* label, $$ */ /* mem, $$ */ /* mirror, $$ */ /* mode, $$ */ /* more, $$ */ /* nlsfunc, $$ */ /* print, $$ */ /* qbasic, $$ */ /* recover, $$ */ /* replace, $$ */ /* restore, $$ */ /* setver, $$ */ /* share, $$ */ /* sort, $$ */ /* subst, $$ */ /* sys, $$ */ /* tree, $$ */ /* undelete, $$ */ /* unformat, $$ */ /* xcopy, $$ */ /* pushd, ** */ /* popd, ** */ ================================================ FILE: shell/command.c ================================================ /* $Id$ * COMMAND.C - command-line interface. * */ #include "../config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../include/lfnfuncs.h" #include "../include/command.h" #include "../include/batch.h" #include "../include/cmdline.h" #include "../err_fcts.h" #include "../strings.h" #ifdef FEATURE_NLS #include "../include/nls.h" #endif #include "../include/openf.h" #include "../include/kswap.h" #include "../include/cswap.h" #include #ifdef FEATURE_INSTALLABLE_COMMANDS #include "../include/mux_ae.h" #endif #include "../include/crossjmp.h" #ifdef I_AM_TOM #ifndef DEBUG void suppl_testMemChain() {} #endif #endif /* Shall the message block remain in memory when an external program is executed */ int persistentMSGs = 0; int interactive_command = 0; /* command directly entered by user */ int exitflag = 0; /* indicates EXIT was typed */ #ifndef FEATURE_XMS_SWAP /* If XMS-Swap, this variable is located in resident portion */ int canexit = 0; /* indicates if this shell is exitable enable within initialize() */ #endif /*int ctrlBreak = 0;*/ /* Ctrl-Break or Ctrl-C hit */ int errorlevel = 0; /* Errorlevel of last launched external prog */ int forceLow = 0; /* load resident copy into low memory */ int oldinfd = -1; /* original file descriptor #0 (stdin) */ int oldoutfd = -1; /* original file descriptor #1 (stdout) */ int autofail = 0; /* Autofail <-> /F on command line */ int inInit = 2; int isSwapFile = 0; jmp_buf jmp_beginning; /* FALSE: no swap this time TRUE: swap this time ERROR: no swap avilable at all */ int swapOnExec = FALSE; int defaultToSwap = FALSE; /* if != 0, pointer to static context NOT allowed to alter if swapOnExec == ERROR !! */ int swapContext = TRUE; /* may destroy external context */ #ifdef FEATURE_LONG_FILENAMES unsigned char __supportlfns = 1; #endif /* stack checking: initialize memory at the bottom of stack to some known state (actually its own address) later verify that at least some of this memory is still left unchanged. */ static void **stack_bottom, **stack_unused; void stack_check_init(void) { void *current_stack_location; volatile void * volatile *barrier; /* place a barrier at the bottom of the stack code assumes 4 K right now */ stack_bottom = ¤t_stack_location - (4*1024 - 50) / sizeof(void *); stack_unused = ¤t_stack_location; for (barrier = (volatile void * volatile *)stack_bottom; (void **)barrier < stack_unused ; barrier++) *barrier = barrier; } int stack_check(const char *commandline) { void **barrier; for (barrier = stack_bottom; barrier < stack_unused; barrier++) if (*barrier != barrier) break; if (barrier < stack_unused) { unsigned stack_left = (barrier - stack_bottom) * sizeof(void *); if (stack_left < 0x300) { fprintf(stderr, "stack left %u after <%.60s>\n",stack_left,commandline); if (stack_left < 0x100) { fprintf(stderr, "hit any key to continue"); cgetchar(); } } stack_unused = barrier; } return 0; } #ifdef __GNUC__ int dup(int fd) { int ret; asm volatile("int $0x21" : "=a"(ret): "Rah"((char)0x45), "b"(fd)); return ret; } int dup2(int oldfd, int newfd) { int scratch; asm volatile("int $0x21" : "=a" (scratch) : "Rah"((char)0x46), "b"(oldfd), "c"(newfd)); return 0; } #endif #ifdef FEATURE_SWITCHAR char switchar(void) { USEREGS _AX = 0x3700; geninterrupt(0x21); return(_AL == 0x00 ? _DL : '/'); } #endif unsigned isdrive(unsigned char cc) { if (isalpha(cc)) return 1; if ((cc - 'A') < 32) return 1; return 0; } void execute(char *first, char *rest, int lh_lf) { /* * This command (in first) was not found in the command table * * * first - first word on command line * rest - rest of command line * */ char *fullname; char *extension; assert(first); assert(rest); /* check for a drive change (not for loadhigh/loadfix) */ if (!lh_lf && (strcmp(first + 1, ":") == 0) && isdrive(*first)) { changeDrive(*first); return; } if(strchr(first,'?') || strchr(first,'*')) { error_bad_command(first); return; } /* search through %PATH% for the binary */ errno = 0; fullname = find_which(first); if(!fullname) { error_bad_command(first); return; } dprintf(("[find_which(%s) returned %s]\n", first, fullname)); /* check if this is a .BAT file */ extension = strrchr(dfnfilename(fullname), '.'); assert(extension); /* loadhigh/loadfix don't do batch files */ if(!lh_lf && ((stricmp(extension, ".bat") == 0) || (stricmp(extension, ".cmd") == 0))) { dprintf(("[BATCH: %s %s]\n", fullname, rest)); batch(fullname, first, rest); } else if(stricmp(extension, ".exe") == 0 || stricmp(extension, ".com") == 0) { /* exec the program */ int result; dprintf(("[EXEC: %s %s]\n", fullname, rest)); if(strlen(rest) > MAX_EXTERNAL_COMMAND_SIZE) { char *fullcommandline = malloc( strlen( first ) + strlen( rest ) + 3 ); if( fullcommandline == NULL ) return; if ( strchr( first, ' ' ) ) { sprintf( fullcommandline, "\"%s\"%s", first, rest ); } else { sprintf( fullcommandline, "%s%s", first, rest ); } if( chgEnv( LONG_CMDLINE_ENV_NAME, fullcommandline ) != 0 ) { free( fullcommandline ); return; } free( fullcommandline ); } /* Prepare to call an external program */ /* Unload the message block if not loaded persistently */ if(!persistentMSGs) unloadMsgs(); /* Execute the external program */ #ifdef FEATURE_KERNEL_SWAP_SHELL if(swapOnExec == TRUE && kswapMkStruc(fullname, rest)) { /* The Criter and ^Break handlers has been installed within the PSP in kswapRegister() --> nothing to do here */ dprintf(("[EXEC: exiting to kernel swap support]\n")); exit(123); /* Let the kernel swap support do the rest */ } #ifdef DEBUG if(swapOnExec == TRUE) dprintf(("KSWAP: failed to save context, proceed without swapping\n")); #endif #endif /* Install the dummy (always abort) handler */ #ifdef FEATURE_XMS_SWAP set_isrfct(0x23, MK_FP(FP_SEG(lowlevel_cbreak_handler)-0x10, FP_OFF(lowlevel_cbreak_handler)+0x100)); /* * some tools expect this interrupt to have the same segment as the * command.com PSP, but FreeCOM is an exe... */ #else set_isrfct(0x23, kswapContext->cbreak_hdlr); #endif #ifdef FEATURE_XMS_SWAP { isr v; get_isr(0x2e, v); if( *(unsigned char far *)v == 0xCF && !canexit) /* IRET? */ set_isrfct( 0x2E, MK_FP(FP_SEG(lowlevel_int_2e_handler)-0x10, FP_OFF(lowlevel_int_2e_handler)+0x100)); } #endif result = exec(fullname, rest, 0); set_isrfct(0x23, cbreak_handler); /* Install local CBreak handler */ /* The external command might has killed the string area. */ env_nullStrings(0); setErrorLevel(result); } else { /* not bat, exe, or com file */ error_bad_command(first); } /* clear CMDLINE once return from program execution so not still in environment */ chgEnv( "CMDLINE", NULL ); } static void docommand(char *line) { /* * look through the internal commands and determine whether or not this * command is one of them. If it is, call the command. If not, call * execute to run it as an external program. * * line - the command line of the program to run */ char *cp; char *rest; /* pointer to the rest of the command line */ struct CMD *cmdptr = 0; #ifdef FEATURE_INSTALLABLE_COMMANDS /* Duplicate the command line into such buffer in order to allow Installable Commands to alter the command line. *line cannot be modified as pipes would be destroyed. */ /* Place both buffers immediately following each other in order to make sure the contents of args can be appended to com without any buffer overflow checks. *2 -> one buffer for com and one for args +2 -> max length byte of com + cur length of com +3 -> max length byte of args + cur length of args + additional '\0' */ char *buf = malloc(2+2*BUFFER_SIZE_MUX_AE+2+1); #define args (buf + 2) #define ARGS_BUFFER_SIZE (2 + BUFFER_SIZE_MUX_AE + 3) #define com (buf + ARGS_BUFFER_SIZE) #define BUFFER_SIZE BUFFER_SIZE_MUX_AE #else char *com = malloc(MAX_INTERNAL_COMMAND_SIZE); #define args line #define buf com #define BUFFER_SIZE MAX_INTERNAL_COMMAND_SIZE #endif assert(line); if(!buf) { error_out_of_memory(); return; } /* delete leading spaces, but keep trailing whitespaces */ line = ltrimcl(line); #ifdef FEATURE_INSTALLABLE_COMMANDS #if BUFFER_SIZE < MAX_INTERNAL_COMMAND_SIZE if(strlen(line) > BUFFER_SIZE) { error_line_too_long(); goto errRet; } #endif strcpy(args, line); #endif if (*(rest = args)) /* Anything to do ? */ { cp = com; /* Copy over 1st word as upper case */ /* Internal commands are constructed out of non-delimiter characters; ? had been parsed already */ while(*rest && is_fnchar(*rest) && !strchr(QUOTE_STR, *rest)) *cp++ = toupper(*rest++); if(*rest && strchr(QUOTE_STR, *rest)) /* If the first word is quoted, it is no internal command */ cp = com; /* invalidate it */ *cp = '\0'; /* Terminate first word */ if(*com) { #ifdef FEATURE_INSTALLABLE_COMMANDS int tryMUXAE; for(tryMUXAE = MUX_AE_MAX_REPEAT_CALL; tryMUXAE > 0; --tryMUXAE) { /* Check for installed COMMAND extension */ switch(runExtension(com, args)) { case 1: /* OK, done */ goto errRet; case 0: /* no extension */ tryMUXAE = 0; } /* reset the argument pointer */ rest = &args[(unsigned char)com[-1]]; dprintf( ("[Command on return of Installable Commands check: >%s]\n", com) ); #ifndef NDEBUG dprintf( ("[Command line: >") ); for(cp = args; cp < rest; ++cp) dprintf( ("%c", *cp) ); dprintf( ("|%s]\n", rest) ); #endif /* !defined(NDEBUG) */ #endif /* Scan internal command table */ for (cmdptr = internalCommands ; cmdptr->name && strcmp(com, cmdptr->name) != 0 ; cmdptr++); if(cmdptr && cmdptr->name) { /* internal command found */ #ifdef FEATURE_INSTALLABLE_COMMANDS cp = malloc(ARGS_BUFFER_SIZE); strcpy(cp, rest); rest = cp; free(buf); buf = rest; #else free(buf); buf = 0; /* no further useage of this buffer */ #endif switch(cmdptr->flags & (CMD_SPECIAL_ALL | CMD_SPECIAL_DIR)) { case CMD_SPECIAL_ALL: /* pass everything into command */ break; case CMD_SPECIAL_DIR: /* pass '\\' & '.' too */ if(*rest == '\\' || *rest == '.' || *rest == ':') break; default: /* pass '/', ignore ',', ';' & '=' */ if(!*rest || *rest == '/') break; if(isargdelim(*rest)) { rest = ltrimcl(rest); break; } /* else syntax error */ error_syntax(0); goto errRet; } currCmdHelpScreen = cmdptr->help_id; /* JPP this will print help for any command */ if(memcmp(ltrimcl(rest), "/?", 2) == 0) { displayString(currCmdHelpScreen); } else { int internal_errorlevel; /* error level for internal command */ dprintf(("CMD '%s' : '%s'\n", cmdptr->name, rest)); internal_errorlevel = cmdptr->func(rest); /* don't set errorlevel for some commands such as IF, GOTO, FOR, etc. */ if (!(cmdptr->flags & CMD_NO_ERRORLEVEL)) errorlevel = internal_errorlevel; } goto errRet; } #ifdef FEATURE_INSTALLABLE_COMMANDS } #endif } free(buf); buf = 0; /* no longer used */ /* no internal command --> spawn an external one */ cp = unquote(line, rest = skip_word(line)); if(!cp) { error_out_of_memory(); goto errRet; } execute(cp, rest, 0); free(cp); } #undef com #undef args #undef BUFFER_SIZE #undef ARGS_BUFFER_SIZE errRet: free(buf); } /* * process the command line and execute the appropriate functions * full input/output redirection and piping are supported */ void parsecommandline(char *s, int redirect) { char *in = 0; char *out = 0; char *fname0 = 0; char *fname1 = 0; char *nextcmd; int of_attrib = O_CREAT | O_TRUNC | O_WRONLY; int num; assert(s); dprintf(("[parsecommandline (%s)]\n", s)); #ifdef FEATURE_ALIASES aliasexpand(s, MAX_INTERNAL_COMMAND_SIZE); dprintf(("[alias expanded to (%s)]\n", s)); #endif if (tracemode) { /* Question after the variables expansion and make sure _all_ executed commands will honor the trace mode */ /* * Commands may be nested ("if errorlevel 1 echo done>test"). To * prevent redirecting FreeCOM prompts to user file, temporarily * revert redirection. */ int redir_fdin = -1, redir_fdout = -1, answer; if (oldinfd != -1) { redir_fdin = dup (0); dup2 (oldinfd, 0); } if (oldoutfd != -1) { redir_fdout = dup (1); dup2 (oldoutfd, 1); } printprompt(); outs(s); /* If the user hits ^Break, it has the same effect as usually: If he is in a batch file, he is asked if to abort all the batchfiles or just the current one */ answer = userprompt(PROMPT_YES_NO); if (oldinfd != -1) { dup2 (redir_fdin, 0); dos_close (redir_fdin); } if (oldoutfd != -1) { dup2 (redir_fdout, 1); dos_close (redir_fdout); } if (answer != 1) return; /* "No" or ^Break */ } if(!redirect) { docommand(s); return; } assert(oldinfd == -1); /* if fails something is wrong; should NEVER */ assert(oldoutfd == -1); /* happen! -- 2000/01/13 ska*/ num = get_redirection(s, &in, &out, &of_attrib); if (num < 0) /* error */ goto abort; /* Set up the initial conditions ... */ if (in || (num > 1)) /* Need to preserve stdin */ oldinfd = dup(0); if (in) /* redirect input from this file name */ { dos_close(0); if (0 != devopen(in, O_RDONLY)) { error_redirect_from_file(in); goto abort; } } if (out || (num > 1)) /* Need to preserve stdout */ oldoutfd = dup(1); /* Now do all but the last pipe command */ while (num-- > 1) { dos_close(1); /* Close current output file */ if ((fname0 = tmpfn()) == 0) goto abort; dos_creat(fname0, 0); nextcmd = s + strlen(s) + 1; docommand(s); dos_close(1); dup2(oldoutfd, 1); dos_close(0); killtmpfn(fname1); /* fname1 can by NULL */ fname1 = fname0; fname0 = 0; dos_open(fname1, O_RDONLY); s = nextcmd; } /* Now set up the end conditions... */ if (out) /* Final output to here */ { dos_close(1); if (1 != devopen(out, of_attrib)) { error_redirect_to_file(out); goto abort; } } else if (oldoutfd != -1) /* Restore original stdout */ { dos_close(1); dup2(oldoutfd, 1); dos_close(oldoutfd); oldoutfd = -1; } docommand(s); /* process final command */ abort: if (oldinfd != -1) /* Restore original STDIN */ { dos_close(0); dup2(oldinfd, 0); dos_close(oldinfd); oldinfd = -1; } if (oldoutfd != -1) /* Restore original STDOUT */ { dos_close(1); dup2(oldoutfd, 1); dos_close(oldoutfd); oldoutfd = -1; } killtmpfn(fname1); killtmpfn(fname0); if (out) free(out); if (in) free(in); } /* line -- min size: MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8 */ int expandEnvVars(char *ip, char * const line) { char *cp, *tp; assert(ip); assert(line); /* Return the maximum pointer into parsedline to add 'numbytes' bytes */ #define parsedMax(numbytes) \ (line + MAX_INTERNAL_COMMAND_SIZE - 1 - (numbytes)) cp = line; while(*ip) { /* Assume that at least one character is added, place the test here to simplify the switch() statement */ if(cp >= parsedMax(1)) return 0; if(*ip == '%') { switch(*++ip) { case '\0': *cp++ = '%'; break; case '%': *cp++ = *ip++; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if(0 != (tp = find_arg(*ip - '0'))) { if(cp >= parsedMax(strlen(tp))) return 0; cp = stpcpy(cp, tp); ip++; } else *cp++ = '%'; /* Let the digit be copied in the cycle */ break; #if 0 /* Caused conflicts with some batches, see %ERRORLEVEL% */ case '?': /* overflow check: parsedline has that many character "on reserve" */ cp += sprintf(cp, "%u", errorlevel); ip++; break; #endif default: #if 0 if(forvar == toupper(*ip)) { /* FOR hack */ *cp++ = '%'; /* let the var be copied in next cycle */ break; } #endif if((tp = strchr(ip, '%')) != 0) { char *evar; *tp = '\0'; if((evar = getEnv(ip)) != 0) { if(cp >= parsedMax(strlen(evar))) { free(evar); return 0; } cp = stpcpy(cp, evar); free(evar); } else if(matchtok(ip, "ERRORLEVEL")) { /* overflow check: parsedline has that many character "on reserve" */ cp += sprintf(cp, "%u", errorlevel); } else if(matchtok(ip, "_CWD") || matchtok(ip, "CD")) { if(0 == (evar = cwd(0))) { return 0; } else { if(cp >= parsedMax(strlen(evar))) { free(evar); return 0; } cp = stpcpy(cp, evar); free(evar); } } ip = tp + 1; } else { #if 0 *cp++ = '%'; /* don't copy over % if no match, e.g. %somevar should print somevar not %somevar */ #endif } break; } continue; } #if 0 if(iscntrl(*ip)) { *cp++ = ' '; ++ip; } else #endif *cp++ = *ip++; } assert(cp); assert(cp < line + MAX_INTERNAL_COMMAND_SIZE); *cp = 0; return 1; } /* * do the prompt/input/process loop * * If xflg is true, the function will not go interactive, but returns. * If commandline != NULL, this command is processed first. * * Return: 0: on success */ int process_input(int xflag, char *commandline) { /* Dimensionate parsedline that no sprintf() can overflow the buffer */ char parsedline[MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8] , *readline; #if 0 /* Return the maximum pointer into parsedline to add 'numbytes' bytes */ #define parsedMax(numbytes) \ (parsedline + MAX_INTERNAL_COMMAND_SIZE - 1 - (numbytes)) char *evar; char *tp; char *cp; #endif char *ip; #if 0 char forvar; #endif int echothisline; int tracethisline; do { #ifdef FEATURE_LONG_FILENAMES char *lfn = getEnv("LFN"); if( lfn && toupper( *lfn ) == 'N' ) __supportlfns = 0; else __supportlfns = 1; free(lfn); #endif interactive_command = 0; /* not directly entered by user */ echothisline = tracethisline = 0; if(commandline) { ip = commandline; readline = commandline = 0; } else { if ((readline = malloc(MAX_INTERNAL_COMMAND_SIZE + 1)) == 0) { error_out_of_memory(); return 1; } if (0 == (ip = readbatchline(&echothisline, readline, MAX_INTERNAL_COMMAND_SIZE))) { /* if no batch input then... */ int attr; if (xflag /* must not go interactive */ || ((attr = fdattr(0)) & 0x84) == 0x84 /* input is NUL device */ || (attr & 0xc0) == 0x80) /* no further input */ { free(readline); break; } /* Go Interactive */ interactive_command = 1; /* directly entered by user */ /* Ensure the prompt starts at column #0 */ if(echo && (mywherex()>1)) outc('\n'); readcommand(ip = readline, MAX_INTERNAL_COMMAND_SIZE); tracemode = 0; /* reset trace mode */ } } /* Make sure there is no left-over from last run */ currCmdHelpScreen = 0; /* * The question mark '?' has a double meaning: * C:\> ? * ==> Display short help * * C:\> ? command arguments * ==> enable tracemode for just this line */ if(*(ip = ltrimcl(ip)) == '?') { ip = ltrimcl(ip + 1); if(!*ip) { /* is short help command */ #ifdef INCLUDE_CMD_QUESTION showcmds(ip); #endif free(readline); continue; } /* this-line-tracemode */ echothisline = 0; tracethisline = 1; } #if 0 /* The FOR hack If the line matches /^\s*for\s+\%[a-z]\s/, the FOR hack becomes active, because FOR requires the sequence "%" in its input. When the percent (%) expansion is made later on, any sequence "%" is retained. */ cp = ip; if(matchtok(cp, "for") && *cp == '%' && isalpha(cp[1]) && isargdelim(cp[2])) /* activate FOR hack */ forvar = toupper(cp[1]); else forvar = 0; #else if(cmd_for_hackery(ip)) { free(readline); continue; } #endif { int rc = expandEnvVars(ip, parsedline); free(readline); if(!rc) { error_line_too_long(); continue; } } if (echothisline) /* Echo batch file line */ { printprompt(); puts(parsedline); } if (*parsedline) { if(swapOnExec != ERROR) swapOnExec = defaultToSwap; if(tracethisline) ++tracemode; parsecommandline(parsedline, TRUE); if(tracethisline) --tracemode; } stack_check(parsedline); } while (!canexit || !exitflag); return 0; } static void hangForever(void) { #ifdef FEATURE_AUTOREDIRECT_TO_CON int i; i = FEATURE_AUTOREDIRECT_TO_CON + 1; #endif /* this might happen in certain "emergency"-level problems. The "cannot_exit" state must be honored, though. Also, it cannot be considered that the string area is available -- 1999/07/06 ska*/ for(;;) { #ifdef FEATURE_AUTOREDIRECT_TO_CON if(--i == 0) cmd_ctty("CON"); #endif #if 0 puts( "\r\n\r\n" "The shell is about to be terminated, though, this is\r\n" "forbidden (usually by enabling the \"/P\" option).\r\n" "You must reboot the system or, if this shell runs in\r\n" "a multitasking environment, terminate this process/task manually.\r\n" ); #else #undef TEXT_MSG_REBOOT_NOW puts(TEXT_MSG_REBOOT_NOW); #endif beep(); delay(9000); /* Keep the message on the screen for at least 1s, in case FreeCom has some problems with the keyboard */ } } int cdecl my2e_parsecommandline( char *s ) { s[ (unsigned char)s[ 0 ] ] = '\0'; /* printf("_my2e_parsecommandline( %s )\n", s );*/ parsecommandline( &s[ 1 ], 1 ); return( errorlevel ); } int main(void) { /* * * main function */ stack_check_init(); if(setjmp(jmp_beginning) == 0 && initialize() == E_None) process_input(0, 0); if(!canexit) hangForever(); #ifdef FEATURE_KERNEL_SWAP_SHELL kswapDeRegister(kswapContext); #endif return errorlevel; } ================================================ FILE: shell/command.ld ================================================ /* value for text segment (like _TEXT for OMF), same calculation as in main linker script */ _TEXTSEG = LOADADDR (.text) / 16 - __msdos_mz_hdr_paras - ADDR (.text) / 16 + 0x10000; ================================================ FILE: shell/command.m1 ================================================ .AUTODEPEND CFG_DEPENDENCIES = makefile.mak ..\strings.h !include "..\config.mak" all: $(CFG) command.exe ================================================ FILE: shell/command.m2 ================================================ command # no map file $(SUPPL_LIB_PATH)\suppl_s.lib + ..\cmd\cmds.lib + ..\lib\freecom.lib + ..\strings\strings.lib + $(LIBPATH)\cs.lib | ================================================ FILE: shell/cswap.asm ================================================ ; $Id$ ; File: ; cswap.asm ; Description: ; command.com swapping ; ; Copyright (c) 2001 tom ehlert ; All Rights Reserved ; ; This file is part of DOS-C. ; ; DOS-C is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version ; 2, or (at your option) any later version. ; ; DOS-C is distributed in the hope that it will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ; the GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public ; License along with DOS-C; see the file COPYING. If not, ; write to the Free Software Foundation, 675 Mass Ave, ; Cambridge, MA 02139, USA. ; ; %include "model.inc" %include "stuff.inc" segment _BSS ; transient data (in DS) cglobal SwapResidentSize SwapResidentSize resw 1 cglobal XMSsave XMSsave resw 8 %define currentSegmOfFreeCOMsave XMSsave+8 execSS resw 1 execSP resw 1 segment _DATA resize_free db 4ah segment _TEXT %ifidn __OUTPUT_FORMAT__,elf ; GCC/ELF: no seg so use linker script symbol extern _TEXTSEG %else %define _TEXTSEG _TEXT %endif cglobal dosFCB1,dosFCB2 dosFCB1 times 37 db 0 dosFCB2 times 37 db 0 ;; global _dosCMDTAIL, _dosCMDNAME use command line from within PSP cglobal dosCMDNAME ;;_dosCMDTAIL times 128 db 0 dosCMDNAME times 128 db 0 times 256 db 0 global localStack localStack: cglobal dosParamDosExec dosParamDosExec times 22 db 0 cglobal XMSdriverAdress XMSdriverAdress dd 0 %define callXMS call far [XMSdriverAdress] cglobal SwapTransientSize SwapTransientSize dw 0 cglobal XMSrestore XMSrestore times 8 DW 0 %define xms_handle XMSrestore+4 %define currentSegmOfFreeCOM XMSrestore+14 cglobal canexit canexit DB 0 ; 1 -> can exit; _else_ --> cannot exit filler DB 0 cglobal mySS, mySP mySS DW 0 mySP DW 0 execRetval dw 0 real_XMSexec: int 21h ; shrink/free: first thing done from resident code ; do exec ;; mov ax, cs ; ds:dx = ASCIZ program name ;; mov ds, ax mov dx,dosCMDNAME ; es:bx = parameter block mov es, cx mov bx, dosParamDosExec ; our temporary stack ;; mov ss, ax ;; mov sp,localStack mov ax,04b00h ; load & execute int 21h jc exec_error xor ax,ax exec_error: cld ; don't rely on that ; reload into memory mov cx, cs mov ss, cx mov sp,localStack-6 ; location on stack of return cs:ip and ds ; restore: mov ds, cx mov [execRetval],ax ; we need some memory ;; First ensure that FreeCOM is reloaded in low memory ;; so that LOADHIGH would come into problems ;;ska mov ax, 5800h ; Get current allocation strategy ;;ska int 21h ;;ska mov dx, ax ;;ska mov ax, 5801h ; Set current allocation strategy ;;ska mov bx, 0 ; low memory / first fit ;;ska int 21h ; ignore any errors mov ah,48h mov bx,[SwapTransientSize] int 21h ;;ska pushf ; Restore Alloc Strat ;;ska mov ax, 5801h ; Set current allocation strategy ;;ska mov bx, dx ;;ska int 21h ;;ska popf jc DOS_trouble_while_swapping_in ; calculate relocation factor mov bx,ax ; new execute address sub bx,[currentSegmOfFreeCOM] ; new address - old address push bx ; mov [currentSegmOfFreeCOM],ax ; new prog address ; restore everything to XMS mov ah,0bh mov si,XMSrestore callXMS pop bx ; get relocation factor back cmp ax,1 jnz XMS_trouble_while_swapping_in mov bp,sp add [bp+2],bx ; relocate return segment retf ; done XMS_err db 'XMS copy error$' DOS_err db 'Memory allocation error$' common_error db 0dh,0ah,0ah,'FreeCOM: XMSSwap-In: $' XMS_trouble_while_swapping_in: mov bx,XMS_err jmp short trouble_while_swapping_in DOS_trouble_while_swapping_in: mov bx,DOS_err trouble_while_swapping_in: ; push cs ; do some error message ; pop ds mov dx, common_error mov ah,09 int 21h mov dx,bx mov ah,09 int 21h terminate_myself: mov ax,04cffh ; and die ... int 21h ;; FALL THROUGH for elder FreeCOM kernels that simply ignore ;; DOS-4C for shells cextern terminateFreeCOMHook jmp terminateFreeCOMHook global xms_kill xms_kill: ; Kill the XMS memory block mov dx, [xms_handle] or dx, dx jz terminate_myself ; no block to deallocate mov ah, 0ah ; deallocate XMS memory block callXMS ret ; ; as I don't know how to set the old interrupt handler ; I write my own ; or we use the TURBO_C _restorezero() and use the ; DOS default handler for that %if 0 MsgZerodivide db 'integer zero divide$' global _ZeroDivideInterrupt _ZeroDivideInterrupt: push cs pop ds mov dx,MsgZerodivide mov ah,09 int 21h mov ax,04c7fh ; terminate with errorlevel 127 int 21h jmp _ZeroDivideInterrupt %endif ;******************************************************************** ; ************* END OF RESIDENT AREA ****************************** ;******************************************************************** cglobal SWAPresidentEnd SWAPresidentEnd: %if 0 ; ; normal EXEC ; global _DosEXEC _DosEXEC: ; save ALL registers needed later push si push di push bp push ds push cs ; ds:dx = ASCIZ program name pop ds mov dx,_dosCMDNAME mov [execSS],ss mov [execSP],sp push cs pop es mov bx, _dosParamDosExec mov ax,04b00h int 21h jc exec_error2 ; if there was an error, the error code is in AX xor ax,ax exec_error2: cld ; don't rely on that mov ss,[cs:execSS] mov sp,[cs:execSP] pop ds pop bp pop di pop si retf %endif ;; Added here to make it more easier for the C-part to make a XMS ;; request, because the code: ;; (*XMSdriverAdress)(); ;; is translated into something like: ;; mov ax, _CODE ;; immediate value ;; mov es, ax ;; call DWORD PTR es:[_XMSdriverAdress] ;; detroying AX already holding the API function number ;; To be called with _far_!! cglobal XMSrequest ;; Note: Because [CS:driverAdress] == [residentCS:driverAdress] ;; we need not use a similiar approach as with XMSexec XMSrequest: jmp far [cs:XMSdriverAdress] ;; Added here to make it more easier for the C-part to call functions ;; located in the resident part, because: ;; _XMSexec(); ;; is translated into something like: ;; nop ;; push cs <-> WRONG!! ;; call _XMSexec ;; now also used to contain code that does not need to be resident. ;;TODO: DS ought to be equal to SS, DS could be reconstructed from ;; SS at the end of the XMSexec function cglobal XMSexec XMSexec: ; save ALL registers needed later %ifidn __OUTPUT_FORMAT__,elf ; GCC: need to preserve es push es %endif push si push di push bp mov [execSS],ss mov [execSP],sp ; save everything to XMS mov ah,0bh mov si,XMSsave call far [cs:XMSdriverAdress] ;;TODO: test of result mov es,[currentSegmOfFreeCOMsave] ; first time: shrink current psp mov ah,[resize_free] mov bx,[SwapResidentSize] mov dx, ds mov cx, _TEXTSEG reloc1 equ $-2 mov ds, cx mov [mySS],ss ; 2E mov [mySP],sp ; 2E mov ss, cx ; this stack is definitely large enough AND present mov sp,localStack push dx ; save DS of transient portion call _TEXTSEG:real_XMSexec reloc2 equ $-2 ret_from_resident: mov ax,[execRetval] ; relocate segment registers add [bp+4],bx ; ds pop ds mov byte [resize_free],49h ; change to "free" for next times add [currentSegmOfFreeCOMsave],bx mov cx,[execSS] add cx,bx mov ss,cx mov sp,[execSP] %ifidn MODEL, m ; in medium & large need to fixup return segment mov bp, sp add [bp+8],bx %endif pop bp pop di pop si %ifidn __OUTPUT_FORMAT__,elf ; GCC: need to preserve es pop es %endif ret ; done (really), retn/retf based on memory model, see model.inc %ifidn __OUTPUT_FORMAT__,elf ; NASM does not support segment relocations so add them ; manually segment .msdos_mz_reloc dw reloc1, _TEXTSEG dw reloc2, _TEXTSEG %endif ================================================ FILE: shell/cswapc.c ================================================ /* $Id$ File: cswapc.c Description: command.com swapping Copyright (c) 2001 tom ehlert All Rights Reserved more description: this allows COMMAND.COM swapping to XMS memory, completely ignoring all poor XT's ;-) (AT's would be handled if HIMEM would handle them) command.com is split into 2 parts - the resident part, located int CSWAP.ASM, which should be located at or near begin of command.com and the transient part. during command execution, the transient portion is freed. after execution, DOS is asked to give us some memory again, the complete image is then copied there, and SS,CS,DS located to the new position. this works as long as the rest of command.com nowhere references _TEXT, _DATA like mov ax,_TEXT mov ax,DGROUP useful to verify this is kernel2025c\utils\exeflat command.exe which will show, where what segments are referenced ============ Structure of XMS memory block: offset useage 0 Strings resource N*16 FreeCOM N == number of paragraphes required to store the STRINGS resource into (XMSmsglen). ; ; This file is part of DOS-C. ... */ #include "../config.h" #include #include #include #include #include "../include/command.h" #include "../include/cswap.h" /*#define XMSALLOCSIZE 128*/ /* 128Kb available */ #if 0 #define MK_FP(seg,ofs) ((void far *) \ (((unsigned long)(seg) << 16) | (unsigned)(ofs))) #define FP_OFF(fp) ((unsigned)(fp)) #define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16)) #endif #define RM2PHYS_ADDR(segm,ofs) (SEG2PHYS_ADDR((segm)) | (ofs)) #define SEG2PHYS_ADDR(segm) ((unsigned long)(segm) << 16) static word XMSmsglen = 0; static enum { INIT_NO ,INIT_FAILED ,INIT_SUCCEEDED } initialized = INIT_NO; int XMSisactive(void) { return initialized == INIT_SUCCEEDED; } #if 0 void fmemcpy(void far *d1, void far *s1, unsigned len) { char far *d=d1, far *s=s1; for ( ; len ; --len) *d++ = *s++; } #endif #ifdef __GNUC__ __attribute__((noinline)) #endif static int XMScopy( long length, ... /* short shandle, long soffset, short dhandle, long doffset */ ) { assert(XMSdriverAdress); /* asm push si; asm lea si,length asm mov ah,0bh; */ #if defined(__TURBOC__) _SI = (unsigned)&length; _AH = 0xb; XMSrequest(); /* asm pop si; */ return _AX; /* shut up warning */ #elif defined(__GNUC__) return XMSrequest(0xb00, 0, &length); #else return XMSdriverAdress(0xb00, 0, &length); #endif } /* #pragma warn -asc */ /* cannot use inline assembly without external assembler in TC++1 */ void XMSinit(void) { USEREGS #if defined(__WATCOMC__) unsigned long res; xmsfunc far *xmsaddr; #elif defined(__GNUC__) unsigned long res; void far *xmsaddr; #else unsigned (far *xmsaddr)(void); #endif unsigned xmshandle; unsigned msglen, segm; struct MCB _seg *mcb; unsigned /*long*/ xms_block_size; if(initialized != INIT_NO) /* already checked --> no changed possible */ return; swapOnExec = ERROR; /* just in case */ initialized = INIT_FAILED; /* Fetch the size of the message segment */ segm = msgSegment(); if(segm) { mcb = MK_SEG_PTR (struct MCB, SEG2MCB (segm)); msglen = mcb->mcb_size; } else { msglen = 0; /* do not load messages into XMS?? */ } /* asm mov ax, 4300h; */ /* asm int 2fh; */ /* XMS installation check */ _AX = 0x4300; geninterrupt(0x2f); if(_AL != 0x80) /* No XMS driver installed */ return; /* asm cmp al, 80h; */ /* asm jne not_detected; */ /* asm mov ax, 4310h; */ /* XMS get driver address */ /* asm int 2fh; */ _AX = 0x4310; geninterrupt(0x2f); xmsaddr = MK_FP(_ES, _BX); /* asm mov word ptr xmsaddr, bx; */ /* asm mov word ptr xmsaddr+2, es; */ if(!xmsaddr) return; /* sanity check */ XMSdriverAdress = xmsaddr; SwapResidentSize = FP_SEG(&SWAPresidentEnd) + (FP_OFF(&SWAPresidentEnd) + 0x0f) / 16 - _psp + 1; mcb = MK_SEG_PTR (struct MCB, SEG2MCB (_psp)); xms_block_size = SwapTransientSize = mcb->mcb_size; xms_block_size += msglen; /* both messages and FreeCOM into the XMS block */ /* xms_block_size *= 16; */ /* the sizes are in paragraphes */ /* xms_block_size /= 1024; */ xms_block_size /= 1024 / 16; /* total size in KB */ /* asm mov ah, 09 */ /* asm mov dx, XMSALLOCSIZE; */ /* will do for first try */ #if defined(__WATCOMC__) res = xmsaddr(0x900, xms_block_size + 1, NULL); #elif defined(__GNUC__) res = XMSrequest(0x900, xms_block_size + 1, NULL); #else _DX = xms_block_size + 1; _AH = 9; (*xmsaddr)(); #endif #if defined(__WATCOMC__) || defined(__GNUC__) _AX = res & 0xffff; _DX = res >> 16; #endif if(_AX) { /* Got the XMS block */ /* asm or ax,ax */ /* asm jz not_detected */ /* asm mov xmshandle,dx */ xmshandle = _DX; XMSsave.length = SwapTransientSize * 16l; /* XMSsave.shandle = 0; default value */ /* XMSsave.soffset = (long)MK_FP(_psp,0); */ XMSsave.soffset = SEG2PHYS_ADDR(_psp); XMSsave.dhandle = xmshandle; /* XMSsave.doffset = 0; default value */ XMSsave.doffset = msglen * 16l; /* STRINGS resource preceeds the FreeCOM swap area */ /* restore: same as above with d and s swapped */ XMSrestore.length = SwapTransientSize * 16l; XMSrestore.doffset = SEG2PHYS_ADDR(_psp); XMSrestore.shandle = xmshandle; XMSrestore.soffset = msglen * 16l; swapOnExec = FALSE; /* to swap is allowed now */ defaultToSwap = TRUE; /* make it the default for XMSwap */ initialized = INIT_SUCCEEDED; /* Unregister the Division by zero handler installed by the C startup code */ #if 0 { extern void interrupt far ZeroDivideInterrupt(); set_isr(0,ZeroDivideInterrupt); } #endif #ifdef __TURBOC__ { extern void _restorezero(void); _restorezero(); } #endif if(msglen /* Because the STRINGS resource never changes, it is copied statically into the XMS mem block */ && XMScopy( msglen * 16l, 0, /* from DOS */ SEG2PHYS_ADDR(segm), /* message segment */ XMSsave.dhandle, /* our common XMS handle */ 0l /* at beginning of the allocated blk */ )) { XMSmsglen = msglen; #ifdef DEBUG if(persistentMSGs) dbg_outsn("MEM: active XMS Swap superceeds persistent messages"); #endif persistentMSGs = FALSE; /* when the messages are in XMS, there is no need to keep them in convential memory */ } } /*not_detected: */ /* ; */ } void XMSexit(void) { /* unsigned (far *xmsaddr)(void) = XMSdriverAdress; */ /* unsigned handle = XMSsave.dhandle; */ if(initialized == INIT_SUCCEEDED) { #if 0 asm mov dx, XMSsave.dhandle; asm mov ah, 0ah; /* free XMS memory */ #endif #if defined(__WATCOMC__) XMSdriverAdress(0xa00, XMSsave.dhandle, NULL); #elif defined(__GNUC__) XMSrequest(0xa00, XMSsave.dhandle, NULL); #else _DX = XMSsave.dhandle; _AH = 0xa; /* free XMS memory */ XMSrequest(); #endif } } #if 0 /* Joined with XMSinit() in order to allocate a block of memory large enough ska*/ void InitSwapping(void) { if (initialized) return; initialized = 1; XMSinit(); SwapResidentSize = FP_SEG(&SWAPresidentEnd) + (FP_OFF(&SWAPresidentEnd) +0x0f) / 16 - _psp ; SwapTransientSize = *(short far *)MK_FP(_psp-1,3); XMSsave.length = (unsigned long)SwapTransientSize * 16; /* XMSsave.shandle = 0; by init */ XMSsave.soffset = (long)MK_FP(_psp,0); /* XMSsave.dhandle = XMShandle; above */ /* XMSsave.doffset = 0; by init */ /* printf("resident bytes %lu\n", (long)SwapResidentSize*16); */ /* printf("transient bytes %lu\n", (long)SwapTransientSize*16); */ } #endif #if 0 /* Joined with XMSinit ska*/ void XMSswapmessagesOut(void) { InitSwapping(); if(msgSegm == 0) return; if(XMSdriverAdress == 0) return; XMSmsglen = *(word far *)MK_FP(msgSegm-1,3); XMScopy( XMSmsglen * 16l, 0, /* from DOS */ (long)MK_FP(msgSegm,0), /* message segment */ XMSsave.dhandle, /* our common XMS handle */ (long)XMSALLOCSIZE*1024l - XMSmsglen /* at end off allocated blk */ ); freeBlk(msgSegm); msgSegm = 0; } #endif word XMSswapmessagesIn(loadStatus *status) { word segm; assert(status); /* Strings in XMS at all? */ if(!XMSmsglen) return 0; assert(XMSdriverAdress); /* Allocate swap buffer in conventional memory mode: last fit, high first */ segm = DOSalloc(XMSmsglen, 0x82); if(!segm) { *status = STRINGS_OUT_OF_MEMORY; return 0; } if(XMScopy( XMSmsglen * 16l ,XMSsave.dhandle /* our common XMS handle */ ,0l /* at beginning of allocated blk */ ,0 /* to DOS */ ,SEG2PHYS_ADDR(segm) /* message segment */ )) { *status = STRINGS_LOADED; return segm; } DOSfree(segm); return 0; } #if 0 DoExec(char *command,char *cmdtail) { int len; short retval; /* printf("executing %s - %s\n",command, cmdtail); */ dosParamDosExec.envSeg = 0; dosParamDosExec.cmdtail = &dosCMDTAIL; dosParamDosExec.cmdtail = &dosCMDTAIL; _fmemcpy(dosCMDTAIL+1, cmdtail,128-1); len = strlen(cmdtail); if (len >= 127) len = 127; dosCMDTAIL[0] = len; dosCMDTAIL[1+ len] = '\r'; _fmemcpy(dosCMDNAME, command,128); if(initialized == INIT_SUCCEEDED) retval = DosEXECSwap(); else retval = DosEXEC(); return retval; } #endif #define FREECOM_NEED_EXIT #ifdef __BORLANDC__ #if __BORLANDC__ >= 0x500 #undef FREECOM_NEED_EXIT #endif #endif #ifdef __GNUC__ #undef FREECOM_NEED_EXIT #endif #ifdef FREECOM_NEED_EXIT /* Using the original exit() function crashes in TC++ v1.01 */ /* And it uses invalid segment relocations (for FreeCOM!) in OpenWatcom */ void exit(int status) { USEREGS extern void exitfct(void); /* from INIT.C */ exitfct(); /* restore the old owner_psp */ _AX = 0x4c00 | status; geninterrupt(0x21); } #endif ================================================ FILE: shell/depend.mk ================================================ shell .SEQUENTIAL : utils err_fcts.h strings context lib cmd shell_dir shell_dir .SETDIR=shell : @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += shell_clean shell_clean .SETDIR=shell : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += shell_clobber shell_clobber .SETDIR=shell : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += shell_dist shell_dist .SETDIR=shell : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: shell/dummies.asm ================================================ ; $Id$ ; Dummy drivers to be included into FreeCOM itself %include "../include/model.inc" %include "../include/stuff.inc" segment _TEXT cglobal dummy_criter_handler cglobal end_dummy_criter_handler dummy_criter_handler: mov al, 3 ; always fail iret end_dummy_criter_handler: ================================================ FILE: shell/expalias.c ================================================ /* $Id$ Expand aliases */ #include "../config.h" #include #include #include #include #include #include #include "../include/cmdline.h" #include "../include/context.h" #include "../include/misc.h" #include "../err_fcts.h" void aliasexpand(char * const cmd, const int maxlen) { char *hbuf; /* work buffer */ char *cp, *p; unsigned ofs, *expanded, *he; int i, numExpanded; assert(cmd); assert(strlen(cmd) < maxlen); if((hbuf = malloc(maxlen)) == 0) { error_out_of_memory(); return; } numExpanded = 0; expanded = 0; redo: /* iteration to expand all aliases */ cp = ltrimcl(cmd); /* skip leading whitespaces */ /* Check if the user disabled alias expansion */ if(*cp == '*') { memmove(cmd, cp + 1, strlen(cp)); goto errRet; } /* Get the name of this command */ for(p = hbuf; is_fnchar(*cp) || *cp == '.';) *p++ = *cp++; if(p == hbuf || is_pathdelim(*cp) || is_quote(*cp)) /* no name || part of path -> no alias */ goto errRet; *p = 0; StrFUpr(hbuf); /* all aliases are uppercased */ if((ofs = env_findVar(ctxtAlias, hbuf)) == (unsigned)-1) /* not found -> no alias */ goto errRet; /* Prevent recursion by recording the offset of the found variable */ for(i = 0; i < numExpanded; ++i) if(expanded[i] == ofs) /* already used -> ignore */ goto errRet; if((he = realloc(expanded, ++numExpanded)) == 0) { error_out_of_memory(); goto errRet; } expanded = he; expanded[numExpanded - 1] = ofs; /************ Expand the command line "cp" with the alias at MK_FP(ctxtAlias, ofs) ***********************/ ofs += strlen(hbuf) + 1; /* advance to value */ if(_fstrlen(MK_FP(ctxtAlias, ofs)) < maxlen - strlen(cp)) { /* prepend alias value to remaining command line */ _fstrcpy(TO_FP(hbuf), MK_FP(ctxtAlias, ofs)); strcat(hbuf, cp); assert(strlen(hbuf) < maxlen); strcpy(cmd, hbuf); goto redo; /* next expansion */ } error_command_too_long(); errRet: /* return to caller */ free(expanded); free(hbuf); } ================================================ FILE: shell/init.c ================================================ /* $Id$ * INIT.C - initialization code * * This is more or less a complete rewrite based on the * initialize() code of v0.74c, but also some changes of 0.75b. * */ #include "../config.h" #include #include #include #include #include #include "mcb.h" #include "environ.h" #include "dfn.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../include/context.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../include/module.h" #include "../include/keys.h" #include "../strings.h" #include "../include/kswap.h" #include "../include/cswap.h" #define pspTermAddr *(void far* far*)MK_FP(_psp, 0xa) /* Check for an argument; ch may be evaluated multiple times */ #define isargsign(ch) \ ((ch) == ':' || (ch) == '=') #ifdef FEATURE_CALL_LOGGING #ifndef INCLUDE_CMD_FDDEBUG static char logFilename[] = LOG_FILE; #endif #endif #define oldPSP origPPID char *ComPath; /* absolute filename of COMMAND shell */ #if defined(__WATCOMC__) unsigned _heaplen = 0; /* NOT in BSS */ #elif defined(DEBUG) extern unsigned _heaplen; #endif #ifndef FDDEBUG_INIT_VALUE #define FDDEBUG_INIT_VALUE 0 #endif #ifdef DEBUG int fddebug = FDDEBUG_INIT_VALUE; /* debug flag */ #else static int fddebug = FDDEBUG_INIT_VALUE; #endif #ifdef DISP_EXITCODE int dispExitcode = 0; #endif /* Without resetting the owner PSP, the program is not removed from memory */ void exitfct(void) { unloadMsgs(); /* free the message strings segment */ OwnerPSP = oldPSP; pspTermAddr = termAddr; #ifdef FEATURE_XMS_SWAP XMSexit(); #endif } static unsigned int showhelp = 0, internalBufLen = 0, inputBufLen = 0, spawnAndExit = E_None, newEnvSize = 0; static int skipAUTOEXEC = 0; /* static int newEnvSize = 0; Min environment table size */ static char *user_autoexec = 0; optScanFct(opt_init) { int ec = E_None; (void)arg; switch(ch) { case '?': showhelp = 1; return E_None; case '!': return optScanBool(fddebug); case 'Y': return optScanBool(tracemode); #ifdef DISP_EXITCODE case 'Z': return optScanBool(dispExitcode); #endif case 'F': return optScanBool(autofail); case 'D': return optScanBool(skipAUTOEXEC); case 'P': if(optHasArg()) /* change autoexec.bat */ ec = optScanString(user_autoexec); canexit = 0; return ec; case 'E': return optScanInteger(newEnvSize); case 'L': return optScanInteger(internalBufLen); case 'U': return optScanInteger(inputBufLen); case 'C': /* spawn command, then exit */ spawnAndExit = E_Exit; case 'K': /* spawn command */ return E_NoOption; /* don't tread as option */ case 0: /* longname option */ switch(toupper(*optstr)) { case 'C': /* spawn command, then exit */ spawnAndExit = E_Exit; case 'K': /* spawn command */ return E_NoOption; /* don't tread as option */ case 'L': if(optLong("LOW")) return optScanBool(forceLow); break; case 'M': if(optLong("MSG")) return optScanBool(persistentMSGs); break; case 'S': if(optLong("SWAP")) return optScanBool(defaultToSwap); break; } break; } optErr(); return E_Useage; } #ifndef INCLUDE_CMD_CTTY #define cmd_ctty(q) error_ctty_excluded() #endif /* * set up global initializations and process parameters * * This function will: * 1) Set up the host environment (Create a new environment segment if * necessary, alter the parent process ID, catch ^Break etc.) * 2) Create the COMSPEC variable * 3) Parse the command line parameters passed to COMMAND.COM * 4) Perform all command line actions (spawn "/c" commands, alter * size of environment etc.) * 5) If shell is interactive, invoke a ver() command. * * If a serious problem occurs, e.g. FreeCom has received an invalid * command line from the system (e.g. 128 bytes), FreeCom assumes that the * user wants an interactive shell. So the command line is scanned until * the problem occurs, but the rest is ignored. */ int initialize(void) { int comPath; /* path to COMMAND.COM (for COMSPEC/reload) */ int newTTY; /* what to change TTY to */ int showinfo; /* show initial info only if no command line options */ int ec; /* error code */ unsigned offs; /* offset into environment segment */ unsigned cmdlen; /* length of command line */ char *cmdline; /* command line duplicated into heap */ char *p, *h, *q; #ifdef FEATURE_CALL_LOGGING #ifndef INCLUDE_CMD_FDDEBUG FILE *f; #endif #endif #ifdef DEBUG int orig_env; #endif dprintf( ("[INIT: initialise()]\n") ); /* Set up the host environment of COMMAND.COM */ /* Give us shell privileges */ myPID = _psp; termAddr = pspTermAddr; pspTermAddr = terminateFreeCOMHook; oldPSP = OwnerPSP; atexit(exitfct); OwnerPSP = _psp; /* Install the dummy handlers for Criter and ^Break */ /* initCBreak(); */ set_isrfct(0x23, cbreak_handler); #ifdef FEATURE_XMS_SWAP /* There is no special handler for FreeCOM currently --> activate the real one */ set_isrfct(0x24, lowlevel_err_handler); { extern word far criter_repeat_checkarea; registerCriterRepeatCheckAddr(&criter_repeat_checkarea); } #else set_isrfct(0x24, dummy_criter_handler); #endif /* DOS shells patch the PPID to the own PID, how stupid this is, however, because then DOS won't terminate them, e.g. when a Critical Error occurs that is not detected by COMMAND.COM */ #ifdef __WATCOMC__ /* minimum block size requested for HEAP from DOS */ _amblksiz = _heaplen; #endif #ifdef DEBUG { void* p; if((p = malloc(5*1024)) == 0) dprintf(("[MEM: Out of memory allocating test block during INIT]")); else free(p); } #endif dbg_printmem(); #ifdef FEATURE_KERNEL_SWAP_SHELL if(kswapInit()) { /* re-invoked */ if(kswapLoadStruc()) { /* OK, on success we need not really keep the shell trick (pretend we are our own parent), which might cause problems with beta-software-bugs ;-) In fact, KSSF will catch up our crashes and re-invoke FreeCOM, probably with the loss of any internal settings. */ OwnerPSP = oldPSP; return E_None; } } #endif /* Some elder DOSs may not pass an initializied environment segment */ if(env_glbSeg && !isMCB(SEG2MCB(env_glbSeg))) { env_setGlbSeg(0); /* Disable the environment */ dprintf(("[ENV: Disabled invalid environment]")); } /* Now parse the command line parameters passed to COMMAND.COM */ /* Preparations */ newTTY = 0; comPath = tracemode = 0; showinfo = 1; dprintf( ("[INIT: grab argv[0] ]\n") ); /* Because FreeCom should be executed in a DOS3+ compatible environment most of the time, it is assumed that its path can be determined from the environment. This has the advantage that the string area is accessable very early in the run. The name of the current file is string #0. */ if((offs = env_string(0, 0)) != 0) { /* OK, environment filled */ /* this fails for MSDOS, if the environment is empty: passed one: 00 00 01 00 a:command.com 00 */ /* if (*(char far *)MK_FP(env_glbSeg, offs) == 0) */ if (peekb(env_glbSeg, offs) == 0) /* empty ergv[0] assume broken */ offs++; /* MSDOS environment */ grabComFilename(0, (char far *)MK_FP(env_glbSeg, offs)); } #ifdef DEBUG else dprintf(("[ENV: No argv[0]!]\n")); #endif /* After that argv[0] is no longer used and maybe zapped. This also will help, as most programs altering the environment segment externally don't expect a string area. */ env_nullStrings(0); /* Aquire the command line, there are three possible sources: 1) DOS command line @PSP:0x80 as pascal string, 2) extended DOS command line environment variable CMDLINE, if peekb(PSP, 0x80) == 127,& 3) MKS command line @ENV:2, if peekb(ENV, 0) == '~' && peekb(ENV, 1) == '=' Currently implemented is version #1 and #2 */ /* get size of command line, if <= 126 then assume actual size >126 treat as flag indicating to use CMDLINE env variable */ cmdlen = (unsigned)peekb(_psp, 0x80); /* #2 extended command line in CMDLINE env var */ /* printf("Command line is %u chars long\n", cmdlen); */ if (cmdlen > MAX_EXTERNAL_COMMAND_SIZE) { cmdlen = 0; cmdline = 0; /* see if CMDLINE env var exists, if so use it, should be \0 terminated we need to see if it exists, copy to local address space skipping past command.com */ if (!(env_matchVar(0, LONG_CMDLINE_ENV_NAME) & 7)) { /* found? ==0 */ word segm; int ofs; segm = env_dfltSeg? env_dfltSeg : env_glbSeg; /* get env segment */ if (segm) { if ((ofs = env_findVar(segm, LONG_CMDLINE_ENV_NAME)) >= 0) { /* get offset to CMDLINE env var if exists */ char far *p = MK_FP(segm, ofs + strlen(LONG_CMDLINE_ENV_NAME) + 1); /* skip past CMDLINE= */ while (*p && !isargdelim(*p)) { p++; } /* skip past argv[0] ~= COMMAND.COM */ if (0 == (cmdline = _fdupstr(p))) { /* copy into local address space just cmd tail */ error_out_of_memory(); return E_NoMem; } cmdlen = strlen(cmdline); } } } if (cmdline == 0) { /* either no free memory or no CMDLINE env var found */ error_corrupt_command_line(); } } if (cmdlen <= MAX_EXTERNAL_COMMAND_SIZE) { /* duplicate the command line into the local address space */ if((cmdline = malloc(cmdlen + 1)) == 0) { error_out_of_memory(); /* Cannot recover from this problem */ return E_NoMem; } _fmemcpy((char far*)cmdline, MK_FP(_psp, 0x81), cmdlen); cmdline[cmdlen] = '\0'; } /* printf("CMDLINE:[%s]\n", cmdline); */ #ifdef FEATURE_CALL_LOGGING #ifndef INCLUDE_CMD_FDDEBUG if((f = fopen(logFilename, "at")) == 0) { fprintf(stderr, "Cannot open logfile: \"%s\"\n", logFilename); } else { putc('"', f); if(ComPath) /* path to command.com already known */ fputs(ComPath, f); putc('"', f); putc(':', f); fputs(cmdline, f); putc('\n', f); fclose(f); } #else cmd_fddebug(logFilename); dbg_outc('"'); dbg_outs(ComPath); dbg_outc('"'); dbg_outc(':'); dbg_outsn(cmdline); #endif #endif canexit = 1; p = cmdline; /* start of the command line */ do { ec = leadOptions(&p, opt_init, 0); if(ec == E_NoOption) { /* /C or /K */ assert(p && *p); if(!isoption(p)) { error_quoted_c_k(); p = 0; break; } assert(p[1] && strchr("kKcC", p[1])); p += 2; /* p := start of command line to execute */ break; } else if(ec != E_None) { showhelp = 1; p = 0; break; } assert(p && !isoption(p) && !isspace(*p)); if(!*p) { p = 0; break; /* end of line reached */ } q = unquote(p, h = skip_word(p)); p = h; /* Skip this word */ if(!q) { error_out_of_memory(); p = 0; break; } if(!comPath || !newTTY) { int rc = grabComFilename(0, (char far*)q); if(rc == 2 && !newTTY) { cmd_ctty(q); newTTY = 1; } else if(!comPath) { if(rc) /* Display the error mesg */ grabComFilename(1, (char far*)q); else comPath = 1; } else { /* has to be CTTY */ cmd_ctty(q); newTTY = 1; } } else { error_too_many_parameters(q); showhelp = 1; } free(q); } while(1); /* * Now: * + autoexec: AUTOEXEC.BAT file to be executed if /P switch * is enabled; if NULL, use default * + comPath: user-defined PATH to COMMAND.COM; if NULL, use * the one from the environment * + newTTY: the name of the device to be CTTY'ed; if NULL, * no change * + p: pointer to the command to be executed: * *p == 'c' or 'C' --> spawn command, then terminate shell * *p == 'k' or 'K' --> spawn command, then go interactive * &p[1] --> command line, unless the first character is an * argument character */ /* Now process the options */ #ifdef FEATURE_XMS_SWAP if(autofail) { dprintf(("[INIT: Activate AutoFail handler]\n")); set_isrfct(0x24, autofail_err_handler); } #endif if(!ComPath) { /* Force interactive querying of the executable */ inInit = 1; msgSegment(); if(!ComPath) { /* FreeCom is unable to find itself --> print error message */ /* Emergency error */ #undef TEXT_MSG_FREECOM_NOT_FOUND puts(TEXT_MSG_FREECOM_NOT_FOUND); #undef TEXT_TERMINATING puts(TEXT_TERMINATING); return E_Useage; } } /* First of all, set up the context */ #ifndef FEATURE_XMS_SWAP /* Install INT 24 Critical error handler */ /* Needs the ComPath variable, eventually */ if(!kswapContext) { /* Load the module/context into memory */ if((kswapContext = modContext()) == 0) { error_loading_context(); return E_NoMem; } #ifdef FEATURE_KERNEL_SWAP_SHELL if(swapOnExec != ERROR) kswapRegister(kswapContext); #endif } ctxtCreate(); /* Create context before env seg, as it is persistent in non-XMS-Mode */ #endif /* Now set up the environment */ /* If a new valid size is specified, use that */ #ifdef DEBUG orig_env = env_glbSeg; #endif env_resizeCtrl |= ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT; if(forceLow) env_resizeCtrl &= ~ENV_USEUMB; if(newEnvSize > 16 && newEnvSize < 32769u) env_setsize(0, newEnvSize); #ifdef ENVIRONMENT_KEEP_FREE #if ENVIRONMENT_KEEP_FREE > 0 else if(env_freeCount(env_glbSeg) < ENVIRONMENT_KEEP_FREE) { dprintf(("[ENV: auto-resize environment because too small: %d]\n" , env_freeCount(env_glbSeg)) ); env_replace(0 /* Modify the default segment */ , ENV_DELETE | ENV_COPY | ENV_CREATE | ENV_FREECOUNT , ENVIRONMENT_KEEP_FREE); } #else #error ENVIRONMENT_KEEP_FREE is non-positive #endif #endif /* Otherwise the path is placed into the environment */ /* Set the COMSPEC variable. */ if(chgEnv("COMSPEC", ComPath)) { /* keep it silent */ /* Failed to add this variable, the most likely problem should be that the environment is too small --> it is increased and the operation is redone */ env_resize(0, strlen(ComPath) + 10); if(chgEnv("COMSPEC", ComPath)) chgEnv("COMSPEC", NULL); /* Cannot set -> zap an old one */ } inInit = 0; #ifdef DEBUG if(orig_env != env_glbSeg) { dprintf(("[ENV: Environment changed: @%04x -> @%04x; free %u]\n" , orig_env, env_glbSeg, env_freeCount(env_glbSeg))); } #endif #ifdef FEATURE_XMS_SWAP ctxtCreate(); /* Create context after env seg, as it is floating in XMS-Mode */ /* Now everything is setup --> initialize the XMS stuff */ XMSinit(); /* Initialize the EXEC Block structure used by XMS Swap Exec interface */ /* envSeg = 0; default & always updated by caller */ dosParamDosExec.cmdtail = dosCMDTAIL; dosParamDosExec.FCB1 = dosFCB1; dosParamDosExec.FCB2 = dosFCB2; /* overlPtr1; not used by this exec */ /* overlPtr2; not used by this exec */ #else /* re-use the already loaded Module */ set_isrfct(0x24, MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter)); #endif if(internalBufLen) error_l_notimplemented(); if(inputBufLen) error_u_notimplemented(); if(tracemode) showinfo = 0; if (showhelp) displayString(TEXT_CMDHELP_COMMAND); if ((showhelp || exitflag) && canexit) return E_Exit; /* Terminate this session */ /* Now the /P option can be processed */ if(!canexit) { char *autoexec; spawnAndExit = E_None; autoexec = user_autoexec? user_autoexec: AUTO_EXEC; showinfo = 0; /* short_version(); */ cmd_ver(NULL); if(skipAUTOEXEC) { /* /D option */ showinfo = 0; displayString(TEXT_MSG_INIT_BYPASSING_AUTOEXEC, autoexec); } else { if(exist(autoexec)) { #ifdef FEATURE_BOOT_KEYS IREGS r; int key; r.r_ax = 0x3000; /* Get DOS version & OEM ID */ intrpt(0x21, &r); if(!tracemode /* /Y --> F8 on CONFIG.SYS */ || ((r.r_bx & 0xff00) == 0xfd00 /* FreeDOS >= build 2025 */ && !(r.r_cx > 0x101 || (r.r_bx & 0xff) > 24))) { displayString(TEXT_MSG_INIT_BYPASS_AUTOEXEC, autoexec); key = cgetchar_timed(3); outc('\n'); } else key = 0; if(key == KEY_F8) tracemode = 1; if(key == KEY_F5) displayString(TEXT_MSG_INIT_BYPASSING_AUTOEXEC, autoexec); else #endif process_input(1, autoexec); } else { if(user_autoexec) error_sfile_not_found(user_autoexec); #ifdef INCLUDE_CMD_DATE cmd_date(0); #endif #ifdef INCLUDE_CMD_TIME cmd_time(0); #endif } } free(user_autoexec); } else { assert(user_autoexec == 0); } /* Now the /C or /K option can be processed */ if (p) { process_input(1, p); return spawnAndExit; } /* Don't place something here that must be executed after a /K or /C */ if (showinfo) { /* short_version(); */ cmd_ver(NULL); /* #ifndef DEBUG No more commands putchar('\n'); showcmds(0); putchar('\n'); #endif */ } return E_None; } ================================================ FILE: shell/kswap.c ================================================ /* $Id$ Kernel-supported swapping 2001/01/21 ska started */ #include "../config.h" #ifdef FEATURE_KERNEL_SWAP_SHELL #include #include #include #include #include #include #include #include "../include/context.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/kswap.h" #define FD_MAGIC 0x4446 /* 'FD' */ /* Lock kswap feature within kernel and invalidate a previous external prg Return: FALSE no swap feature within kernel */ int kswapInit(void) { IREGS r; r.r_ax = 0x4bfe; /* Get kswap argument structure segm */ r.r_dx = FD_MAGIC; intrpt(0x21, &r); if(!( r.r_flags & 1 )) { dprintf(("[KSWAP: using kernel swapping support (KSSF eventually at %04x)]\n", r.r_ax)); if(r.r_bx) { /* segment found */ kswapContext = (kswap_p)MK_SEG_PTR(kswap_t, r.r_bx); /* invalidate external program if this shell aborts accidently */ kswapContext->prg = 0; dprintf(("[KSWAP: static context found at 0x%04x]\n", r.r_bx)); return TRUE; /* re-invoked */ } return FALSE; /* not _re-_ invoked */ } else if(r.r_ax == 5) { /* Access denied -> there exists a static context with embedded Criter, but this copy of FreeCOM is NOT allowed to alter it */ kswapContext = (kswap_p)MK_SEG_PTR(kswap_t, r.r_bx); dprintf(("[KSWAP: static context found at 0x%04x]\n", r.r_bx)); } dprintf(("[KSWAP: kernel swapping support is not used]\n")); swapOnExec = ERROR; /* No swapping allowed */ return FALSE; } static void kswapSetISR(void) { *(void far* far*)MK_FP(_psp, 0xe) = kswapContext->cbreak_hdlr; /* The ^Break handler has been set already in INIT.C as it is an internal one (no part of the module) */ *(void far* far*)MK_FP(_psp, 0x12) = MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter); set_isrfct(0x24, MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter)); } void kswapRegister(kswap_p ctxt) { IREGS r; dprintf(("[KSWAP: Registering static context at: 0x%04x]\n", (word)ctxt)); assert(ctxt); /* our own PSP gets patched in order to load the values of the Criter and ^Break handlers of the context on termination of this instance of FreeCOM. It is save, because this function is activated only, if the KSS is present, which faker has the previous values stored. */ kswapSetISR(); r.r_ax = 0x4bfd; /* Set kswap argument structure segm */ r.r_bx = (word)ctxt; r.r_dx = FD_MAGIC; intrpt(0x21, &r); if(r.r_flags & 1) { /* failed */ swapOnExec = ERROR; /* cannot register -> cannot use */ dprintf(("[KSWAP: Registering failed, kernel swap deactivated]\n")); return; } /* Initialize the constant values */ /* environment block required only, if swapping is avail */ ctxt->envSize = mcb_length(env_glbSeg); ctxt->envSegm = allocSysBlk(ctxt->envSize, 0x82); if(!ctxt->envSegm) { error_kswap_allocmem(); swapOnExec = ERROR; } else dprintf(("[KSWAP: master environment allocated at 0x%04x]\n" , ctxt->envSegm)); } void kswapDeRegister(kswap_p ctxt) { if(swapOnExec != ERROR) { /* context belongs to this FreeCOM */ dprintf(("[KSWAP: DeRegistering static context at: 0x%04x]\n", (word)ctxt)); assert(ctxt); ctxt->shell = 0; /* causes the kernel swap support to exit */ } } /* Update the kswap argument block Return: 0 on error <-> no swapping possible else: segment of structure */ unsigned kswapMkStruc(const char * const prg, const char * const cmdline) { word shellname; word segm; char *q, *h; assert(prg); assert(cmdline); if(swapOnExec == ERROR) /* missing kernel support */ return FALSE; assert(kswapContext); /* To update the static context is a good idea even if we don't swap after all */ /* preserve the environment */ assert(kswapContext->envSegm); assert(kswapContext->envSize); segm = kswapContext->envSegm; dprintf(("[KSWAP: Updating master environment at 0x%04x]\n", segm)); assert(isMCB(SEG2MCB(segm))); assert(isMCB(SEG2MCB(env_glbSeg))); assert(mcb_length(env_glbSeg) <= mcb_length(segm)); _fmemcpy(MK_FP(segm, 0), MK_FP(env_glbSeg, 0), mcb_length(env_glbSeg)); /* Update the shell name as maybe %COMSPEC% was changed */ /* COMSPEC is the central and traditionally the only place of the name of the shell */ if(isSwapFile || (shellname = env_findVar(segm, "COMSPEC") + 8) == (unsigned)-1 + 8) { char *p = comResFile(); ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_SHELLNAME, p); free(p); if((kswapContext->shell /* fetch first in case of failure */ = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_SHELLNAME)) == 0) return FALSE; } else kswapContext->shell = MK_FP(segm, shellname); /* Update central settings of FreeCOM */ kswapContext->canexit = canexit; kswapContext->dfltSwap = defaultToSwap; #ifdef NDEBUG kswapContext->debug = (word)stderr; #else kswapContext->debug = fddebug; #endif /* Create the dynamic portion of the context */ /* Construct command line string */ if(*cmdline) { if((q = malloc(strlen(cmdline) + 4)) == 0) { error_out_of_memory(); return FALSE; } h = stpcpy(q + 1, cmdline); *q = h - q - 1; /* command line length */ *h = '\r'; /* command line terminator */ h[1] = 0; /* ASCIIZ */ ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE, q); free(q); } else ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE, "\1 \r"); ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_PRGNAME, prg); return (kswapContext->cmdline /* fetch first in case of failure */ = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE)) != 0 && (kswapContext->prg = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_PRGNAME)) != 0; } /* Restore the kswap argument block */ int kswapLoadStruc(void) { kswapSetISR(); if(swapOnExec == ERROR) /* missing kernel support */ return FALSE; assert(kswapContext); /* kswapContext->prg had been disabled in kswapInit() */ assert(!kswapContext->prg); setErrorLevel(kswapContext->execErr); canexit = kswapContext->canexit; defaultToSwap = kswapContext->dfltSwap; #ifndef NDEBUG fddebug = kswapContext->debug; #endif grabComFilename(1, kswapContext->shell); if((ctxt = kswapContext->dyn_ctxt) == 0) { error_no_context_after_swap(); ctxtCreate(); } /* if the SHELL= statement specified the size of the environment, it must be applied each time FreeCOM is re-invoked, because DOS does not preserve the size of the original environment. */ env_resizeCtrl = ENV_ALLOWMOVE | ENV_LASTFIT | ENV_USEUMB; if(forceLow) env_resizeCtrl &= ~ENV_USEUMB; /* if the size does not change this function performs no actions */ env_setsize(0, kswapContext->envSize); return TRUE; } #endif ================================================ FILE: shell/loadhigh.c ================================================ /* $Id$ * LOADHIGH.C - command that loads a DOS executable into upper memory. * * Comments * * ??/??/96 (Svante Frey) * began. * * 01/17/96 (Tim Norman) * plugged into COMMAND.COM * * 02/05/96 (Tim Norman) * converted to new first/rest calling scheme * * 08/27/96 (Tim Norman) * removed support for - as a switch character * * 27-Jul-1998 (John P Price ) * - added config.h include * * 2000/07/05 Ron Cemer * bugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol * * 2001/02/14 ska * chg: made all helper functions and variables 'static' * chg: clean up code to not implement some functions twice * chg: reduced some static variables * * 2002/02/14 ska * chg: to behave as documented in DOCS\LOADHIGH.TXT */ #include "../config.h" #include #include #include #include #include "mcb.h" #include "suppl.h" #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" #include "../include/misc.h" #include "../strings.h" /* Macro to convert bytes to paragraphs */ #define topara(x) (((x) + 0xf) >> 4) #define mcbAssign(mcb,wordValue) (mcb = MK_SEG_PTR(struct MCB,wordValue)) /* skip to next MCB in chain */ #define mcbNext(mcb) mcbAssign(mcb, nxtMCB(FP_SEG(mcb))) #define DosAlloc(value) DOSalloc((value), 0xF) #define BLOCKMAX 256 #define AVAILBLOCKMAX 256 #define REGIONMAX 64 enum error_codes { err_help = -1, OK, err_silent = -2, /* These error codes are more or less DOS-compatible */ err_file_not_found = 2, err_mcb_chain = 7, err_out_of_memory = 8, err_invalid_parms = 87 }; static int lh_lf(char *c); static int loadhigh_prepare(void); static int loadfix_prepare(void); static int findUMBRegions(void); static int parseArgs(char *cmdline, char **fnam, char **rest); static void lh_error(int errcode); /* This module takes care of both the LOADHIGH and the LOADFIX command, * since those two commands have much in common. * * The global variable 'loadfix_flag' is used to keep track of which * command is currently executing. If this variable is non-zero, it's * LOADFIX, otherwise LOADHIGH. */ #ifdef INCLUDE_CMD_LOADHIGH static int loadfix_flag; /* Flag: LOADFIX instead of LOADHIGH? */ #define INCLUDE_LOADHIGH_HANDLER /* This is the loadhigh handler */ int cmd_loadhigh(char *rest) { int ret; int old_link = dosGetUMBLinkState(); int oldSwapContext = swapContext; loadfix_flag = 0; ret = lh_lf(rest); /* Restore UMB link state to its original value. */ dosSetUMBLinkState(old_link); swapContext = oldSwapContext; return ret; } #endif #ifdef INCLUDE_CMD_LOADFIX #ifndef INCLUDE_LOADHIGH_HANDLER static int loadfix_flag; /* Flag: LOADFIX instead of LOADHIGH? */ #define INCLUDE_LOADHIGH_HANDLER #endif /* This is the loadfix handler */ int cmd_loadfix(char *rest) { loadfix_flag = 1; return lh_lf(rest); } #endif #ifdef INCLUDE_LOADHIGH_HANDLER /* This array will contain the memory blocks that the new program can't use */ static int allocatedBlocks = 0; static word *block = 0; static int upper_flag; /* Flag: should the program be loaded high? */ /* UMB region info */ static int umbRegions = 0; /* How many UMB regions are there? */ static struct UMBREGION { word start; /* start of the region */ word end; /* end of the region */ word minSize; /* minimum free size, given by the L switch */ int access; /* does the program have access to this region? */ } *umbRegion = 0; static int optS; static char *optL = 0; /* Helper functions */ static int initialise(void) { /* reset global variables */ allocatedBlocks = 0; upper_flag = 1; /* initialize options */ optS = 0; /* Allocate dynamic memory for some arrays */ if ((block = malloc(BLOCKMAX * sizeof(*block))) == 0) return err_out_of_memory; #ifdef FEATURE_XMS_SWAP if(_CS >= 0xa000 || _CS < 0x2000) { /* Try to relocate the transient portion to the end of the lower memory so *prepare won't miscalculate our own memory block */ dprintf(("[MEM: Relocate our transient portion from: 0x%04x", _CS)); dosSetAllocStrategy(0x02); /* low memory last fit */ exec(";=/","",0); /* Note: 1) Due to the invalid file name, exec() will fail, but won't display an error message. The ERRORLEVEL is destroyed, though, but there will be started a program anyway (unless systax errors). a) If XMS is not active or swapping is disabled, to call exec() won't help anything, but won't hurt on the other hand. */ dprintf((" to: 0x%04x\n", _CS)); } #endif if ((umbRegion = malloc(REGIONMAX * sizeof(*umbRegion))) == 0) return err_out_of_memory; /* find the UMB regions */ return findUMBRegions(); } /* This is the "real" handler of the two commands. The argument is * the original command line. */ static int lh_lf(char *args) { int rc; char *fnam; int i; int old_strat = dosGetAllocStrategy(); assert(args); assert(umbRegion == 0); assert(block == 0); assert(optL == 0); if((rc = initialise()) == OK) { if ((rc = parseArgs(args, &fnam, &args)) == OK) { /* command line was OK - allocate the memory */ if (loadfix_flag) rc = loadfix_prepare(); else rc = loadhigh_prepare(); /* finally, execute the file */ if (!rc) execute(fnam, args, 1); free(fnam); } } /** Clean Up **/ /* free any memory that was allocated to prevent the program from using it */ for (i = 0; i < allocatedBlocks; i++) DOSfree(block[i]); /* free dynamic arrays */ free(umbRegion); free(block); free(optL); optL = 0; umbRegion = 0; block = 0; /* Restore DOS malloc strategy to its original value. */ dosSetAllocStrategy(old_strat); /* if any error occurred, print & return the error */ if (rc) { lh_error(rc); return rc; } /* otherwise return the exit code of the program that ran */ return errorlevel; } /* lh_error(): print error messages to stderr */ static void lh_error(int errcode) { switch (errcode) { case err_invalid_parms: error_syntax(0); break; case err_file_not_found: error_file_not_found(); break; case err_out_of_memory: error_out_of_memory(); break; case err_mcb_chain: /* error while searching the MCB chain */ error_bad_mcb_chain(); break; default: error_unknown(errcode); break; case err_silent: break; } } /* findUMBRegions(): * This routine scans the MCB chain to find all active memory regions. * Info about the regions is written to the array "umbRegions". * * Each continous region is numbered. Region 0 is the conventional * memory. */ static int findUMBRegions(void) { struct UMBREGION *region = umbRegion; struct MCB _seg *mcb; char sig; int i; mcbAssign(mcb, GetFirstMCB()); /* get start of MCB chain */ umbRegions = 0; region->start = FP_SEG(mcb); /* First, find the end of the conventional memory: * Turn UMB link off, and track the MCB chain to the end. */ dosSetUMBLinkState(0); while (mcb->mcb_type == 'M') mcbNext(mcb); if (mcb->mcb_type != 'Z') return err_mcb_chain; /* If the last memory block in conventional memory is "reserved", * conventional memory ends at the paragraph before the block. If * the last block is an ordinary one, conventional memory ends at * the last paragraph of the block. */ if (mcb->mcb_ownerPSP == 8 && !_fmemcmp(mcb->mcb_name, "SC", 2)) region->end = FP_SEG(mcb) - 1; else region->end = FP_SEG(mcb) + mcb->mcb_size; region++; region->start = 0; /* Turn UMB link on. If MS-DOS UMBs are available, the signature of * the last conventional memory block will change from 'Z' to 'M'. */ dosSetUMBLinkState(1); if (mcb->mcb_type == 'M') { /* UMBs are available */ mcbNext(mcb); /* go to next block */ /* This loop searches for the regions, by searching either for * special MCBs or 'reserved' memory regions. */ do { sig = mcb->mcb_type; if (mcb->mcb_ownerPSP == 8 && (!_fmemcmp(mcb->mcb_name, "SC", 2) || !_fmemcmp(mcb->mcb_name, "S\x00\x30", 3))) /* lDOS S MCB type 30h */ { /* this is a 'hole' in memory */ if (region->start) { region->end = FP_SEG(mcb) - 1; if (! (mcb->mcb_type == 'Z' && 0 == mcb->mcb_size)) { if ((region - umbRegion) >= REGIONMAX) { return err_out_of_memory; } region++; region->start = 0; } } } else { /* In MS-DOS 6.x, each UMB region starts with a 'major' mcb * that is outside the ordinary MCB chain. This mcb defines * the size of the whole region. */ struct MCB _seg *umb_mcb; mcbAssign(umb_mcb, FP_SEG(mcb) - 1); if((umb_mcb->mcb_type == 'Z' || umb_mcb->mcb_type == 'M') && !_fmemcmp(umb_mcb->mcb_name, "UMB ", 8)) { /* This is the signature of the special MS-DOS MCBs */ region->start = umb_mcb->mcb_ownerPSP; region->end = umb_mcb->mcb_ownerPSP + umb_mcb->mcb_size - 1; if ((sig = umb_mcb->mcb_type) == 'M') region->end--; if ((region - umbRegion) >= REGIONMAX) { return err_out_of_memory; } region++; region->start = 0; mcbAssign(mcb, FP_SEG(umb_mcb) + umb_mcb->mcb_size); if (sig == 'Z') break; continue; } if (!region->start) region->start = FP_SEG(mcb); } if (sig == 'Z') { region->end = FP_SEG(mcb) + mcb->mcb_size; if ((region - umbRegion) >= REGIONMAX) { return err_out_of_memory; } region++; break; } mcbNext(mcb); } while (sig == 'M'); if (sig != 'Z') return err_mcb_chain; } umbRegions = region - umbRegion; /* By default, the program will have access to all UMB regions. This * may be modified by command-line arguments. */ for (i = 0; i < umbRegions; i++) { umbRegion[i].access = 1; umbRegion[i].minSize = 0xffff; } return OK; } /* loadhigh_prepare(): * This routine allocates memory as necessary. All memory that the * program is not allowed to access must be temporarily allocated * while the program is running. */ static int loadhigh_prepare(void) { int i; struct UMBREGION far *region = umbRegion; word *availBlock; word availBlocks = 0; /* Set the UMB link and malloc strategy */ dosSetUMBLinkState(1); dosSetAllocStrategy(0); if ((availBlock = malloc(AVAILBLOCKMAX * sizeof(*availBlock))) == 0) return err_out_of_memory; /* Call to force DOS to catenate any successive free memory blocks */ DosAlloc(0xffff); /* This loop sets up each UMB region as specified: * If the 'L' switch was present on the command line, any memory * region not listed there will be disabled for the program. * * If a minimal size was specified, the memory region will only be * available to the program if it contains a free memory block of * at least this size. If the 'S' switch was present, the memory * region will be shrunk to the minimal size. * * When the loop finishes, the array 'block' will contain the memory * handles of every free memory block that the program was not * allowed to access. * * The array 'availBlock' will contain the memory handles of every * free memory block that the program can use. */ for (i = 0; i < umbRegions; i++, region++) { struct MCB _seg *mcb; word startBlock = allocatedBlocks; int found_one = 0; for (mcbAssign(mcb, region->start) ; FP_SEG(mcb) < region->end && mcb->mcb_type == 'M' ; mcbNext(mcb)) { if (!mcb->mcb_ownerPSP) { /* Found a free memory block: allocate it */ word bl = DosAlloc(mcb->mcb_size); if (bl != FP_SEG(mcb) + 1) { /* Did we get the block we wanted? */ DOSfree(bl); for (i = 0; i < availBlocks; i++) DOSfree(availBlock[i]); free(availBlock); return err_mcb_chain; } if (region->access) /* /L option allows access to this region */ { if (region->minSize == 0xffff || /* no minimum size set --> use it */ (!optS && found_one) || /* a found previous block means to make this region available regardless of the size of this block; with an active /S option only one block per region is allowed. */ (!(optS && found_one) && mcb->mcb_size >= region->minSize)) { if (availBlocks >= AVAILBLOCKMAX) { DOSfree(bl); for (i = 0; i < availBlocks; i++) DOSfree(availBlock[i]); free(availBlock); return err_out_of_memory; } availBlock[availBlocks++] = bl; if (optS) DOSresize(bl, region->minSize); else if (allocatedBlocks > startBlock) { /* These _previously_ found blocks had been found too small, but must be made available now as this region is available */ memcpy(availBlock + availBlocks , block + startBlock , (allocatedBlocks - startBlock) * sizeof(*block)); availBlocks += allocatedBlocks - startBlock; allocatedBlocks = startBlock; } found_one = 1; continue; } } if (allocatedBlocks >= BLOCKMAX) { DOSfree(bl); for (i = 0; i < availBlocks; i++) DOSfree(availBlock[i]); free(availBlock); return err_out_of_memory; } block[allocatedBlocks++] = bl; /* no access to this block */ } } } /* Now, block[] contains the blocks that can't be used by the * program, and availBlock[] contains the blocks that can be used. * Those blocks will be released. */ for (i = 0; i < availBlocks; i++) DOSfree(availBlock[i]); free(availBlock); /* If the program is to be loaded in upper memory, set the malloc * strategy to 'first fit high', otherwise to 'first fit low'. */ dosSetAllocStrategy(upper_flag ? 0x80 : 0); return OK; } /* loadfix_prepare(): Allocates all memory up to 1000:0000. */ #if 0 static int loadfix_prepare(void) { struct MCB _seg *mcb; mcbAssign(mcb, umbRegion[0].start); dosSetAllocStrategy(0); while (FP_SEG(mcb) < 0x1000) { if (mcb->mcb_type != 'M' && mcb->mcb_type != 'Z') return err_mcb_chain; if (!mcb->mcb_ownerPSP) { word bl = DosAlloc(mcb->mcb_size); if (bl != FP_SEG(mcb) + 1) /* Did we get the block we wanted? */ { return err_mcb_chain; } block[allocatedBlocks++] = bl; if (bl + mcb->mcb_size > 0x1000) /* Don't allocate more than necessary */ DOSresize(bl, 0x1000 - bl); } mcbNext(mcb); } return OK; } #else /* loadfix_prepare(): Allocates all memory up to 1000:0000. */ static int loadfix_prepare(void) { unsigned bl; dosSetAllocStrategy(0x0); while((bl = DosAlloc(1)) != 0) { if(bl >= 0x1000) { DOSfree(bl); break; } dprintf(("loadfix: allocated 0x%04x\n",bl)); DOSresize(bl, 0x1000 - bl); if (allocatedBlocks >= BLOCKMAX) { DOSfree(bl); return err_out_of_memory; } block[allocatedBlocks++] = bl; } return OK; } #endif optScanFct(opt_lh) { (void)arg; switch(ch) { case 'S': return optScanBool(optS); case 'L': return optScanString(optL); } optErr(); return E_Useage; } /* parseArgs(): parse the command line * Only '/' is recognized as switch characters. * The first argument not starting with '/' will be * considered to be the filename. * * The LOADFIX command only accepts the '?' switch. */ static int parseArgs(char *cmdline, char **fnam, char **rest) { char *c; assert(fnam); assert(rest); if(leadOptions(&cmdline, loadfix_flag? 0: opt_lh, 0) != E_None) return err_silent; if((c = optL) != 0) { int i, r; /* If the /L option is present, we must not deallocate the context */ swapContext = FALSE; /* Disable access to all UMB regions not listed here */ for (i = 1; i < umbRegions; i++) umbRegion[i].access = 0; r = 0; do { dword region_minSize = 0xffff; /* flag value, indicating no minsize was specified */ int region_number = (int)strtol(c, &c, 10); if (*c == ',') { long larg; c++; if ((larg = strtol(c, &c, 10)) != -1L) region_minSize = topara(larg); } if (region_number >= umbRegions) displayString(TEXT_ERROR_REGION_WARNING, region_number); else { if (!r && !region_number) upper_flag = 0; r++; assert(region_minSize < 0x10000ul); umbRegion[region_number].minSize = (unsigned)region_minSize; umbRegion[region_number].access = 1; } } while (*c++ == ';'); if(c[-1]) cmdline = ""; /* to cause an error later */ } /* does a file name follow? */ if (!*cmdline) return err_invalid_parms; if (optS && !optL) return err_invalid_parms; /* The next argument is the file name. The rest of the command line * are passed as parameters to the new program. */ if((*fnam = unquote(cmdline, c = skip_word(cmdline))) == 0) return err_out_of_memory; *rest = skipdm(c); return OK; } #endif ================================================ FILE: shell/makefile ================================================ # $Id$ # # Makefile for the FreeDOS kernel's command interpreter # # $Log$ # Revision 1.11 2003/08/03 16:00:57 skaus # bugfix: /F (AutoFail) for the XMS_Swap variant # # Revision 1.10 2002/05/11 22:50:32 skaus # v0.83 Beta 40: # bugfix: ^Break detection after XMS-Swapping # # Revision 1.9 2002/05/11 22:10:40 skaus # v0.83 Beta 40: # bugfix: ^Break detection after XMS-Swapping # # Revision 1.8 2002/05/11 20:10:59 skaus # bugfix: ^Break detection after XMS-Swapping # # Revision 1.7 2002/04/23 16:34:51 skaus # chg: BUILD.BAT to handle XMS-Swap better # # Revision 1.6 2002/04/03 01:10:31 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.5 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.4 2002/04/02 20:58:13 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.3 2002/04/02 18:09:31 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.2 2001/06/10 17:17:24 skaus # bugfix: Single point of configuration CONFIG.MAK/.H # # Revision 1.1 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # # .INCLUDE : ../_config.mk # Sources of this make target SRC = batch.c cmdtable.c command.c dummies.asm expalias.c init.c kswap.c \ loadhigh.c module.c redir.c ver.c OBJ = batch.obj cmdtable.obj command.obj dummies.obj expalias.obj init.obj \ kswap.obj loadhigh.obj module.obj redir.obj ver.obj HDR = ..\config.h ..\include/batch.h ..\include/cmdline.h \ ..\include/command.h ..\include/context.h ..\include/crossjmp.h \ ..\include/cswap.h ..\include/datefunc.h ..\include/debug.h \ ..\include/keys.h ..\include/kswap.h ..\include/misc.h \ ..\include/module.h ..\include/mux_ae.h ..\include/nls.h \ ..\include/openf.h ..\include/res.h ..\include/resource.h \ ..\include/timefunc.h ..\include\large.inc ..\include\model.inc \ ..\include\small.inc XMS_SWAP_PRE_OBJ = cb_catch.obj xms_crit.obj xms_brk.obj cswap.obj XMS_SWAP_ADD_OBJ = cswapc.obj .IF $(XMS_SWAP) == $(NULL) SRC += cb_catch.asm OBJ += cb_catch.obj .ELSE SRC += cswap.asm cswapc.c xms_crit.asm xms_brk.asm cb_catch.asm HDR += ../include/cswapc.h OBJ += $(XMS_SWAP_ADD_OBJ) PRE_OBJ = $(XMS_SWAP_PRE_OBJ) .ENDIF # Default target all: com.exe dist : makefile.mak xms-swap.mak %.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist ### Utils are required by build process .INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl .IF $(THISMAKE) == $(LASTMAKE) verscheck :; .ELSE verscheck : @+-echo Changed Make parameters, already made files invalid! +-echo LASTMAKE = $(THISMAKE) >lastmake.mk $(RUNMAKE) clobber .IF $(CFG) $(RUNMAKE) $(CFG) .ENDIF .ENDIF __errl: @+-if exist errlist del errlist >nul -ctags *.c ..\lib\*.c ..\cmd\*.c \freedos\src\lib\suppl\*.c com.exe ?= _OBJS := $(PRE_OBJ) $(OBJ:s/c0.obj//) # STD_OBJ !:= C0.OBJ com.exe com.map .UPDATEALL : $(PRE_OBJ) $(OBJ) ../cmd/cmds.lib ../lib/freecom.lib $(MAK_EXE) #MAKEDEP START expalias.obj : expalias.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/context.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h command.obj : command.c \ ../config.h ../context.h_c ../err_fcts.h ../include/batch.h \ ../include/cmdline.h ../include/command.h ../include/crossjmp.h \ ../include/cswap.h ../include/datefunc.h ../include/debug.h \ ../include/kswap.h ../include/misc.h ../include/mux_ae.h \ ../include/nls.h ../include/openf.h ../include/timefunc.h ../strings.h module.obj : module.c \ ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/kswap.h ../include/misc.h \ ../include/module.h ../include/res.h ../include/resource.h \ ../include/timefunc.h kswap.obj : kswap.c \ ../config.h ../context.h_c ../err_fcts.h ../include/command.h \ ../include/context.h ../include/datefunc.h ../include/debug.h \ ../include/kswap.h ../include/misc.h ../include/timefunc.h ver.obj : ver.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h init.obj : init.c \ ../config.h ../context.h_c ../err_fcts.h ../include/cmdline.h \ ../include/command.h ../include/context.h ../include/cswap.h \ ../include/datefunc.h ../include/debug.h ../include/keys.h \ ../include/kswap.h ../include/misc.h ../include/module.h \ ../include/timefunc.h ../strings.h cmdtable.obj : cmdtable.c \ ../config.h ../include/command.h ../include/datefunc.h \ ../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h loadhigh.obj : loadhigh.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h ../strings.h batch.obj : batch.c \ ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \ ../include/command.h ../include/datefunc.h ../include/debug.h \ ../include/misc.h ../include/timefunc.h \ /freedos/src/include/../include/dfn.h dummies.obj : dummies.asm \ .\..\include\large.inc .\..\include\model.inc .\..\include\small.inc redir.obj : redir.c \ ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \ ../include/datefunc.h ../include/debug.h ../include/misc.h \ ../include/timefunc.h DYNSOURCES = #MAKEDEP STOP cswapc.c : ../include/cswap.h ../include/misc.h xms_crit.asm : ../criter/criter.asm clobber : clean $(RM) $(RMFLAGS) *.com *.cln makefile.mak com.exe *.cfg clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist .IF $(XMS_SWAP) == $(NULL) makefile.mak : makefile command.m1 command.m2 +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 $@ ALL_OBJ = $(XMS_SWAP_ADD_OBJ) $(OBJ:s/cb_catch.obj//) xms-swap.mak : makefile command.m1 command.m2 +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 $@ .ENDIF ================================================ FILE: shell/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak ../strings.h TOP = .. !include "$(TOP)/config.mak" all: command.exe OBJ1 = $(OBJC0) cb_catch.obj termhook.obj !if $(XMS_SWAP)0 == 0 OBJ2 = dummies.obj !else OBJ2 = xms_crit.obj\ xms_brk.obj\ xms_2e.obj\ cswap.obj\ cswapc.obj !endif OBJ3 = batch.obj\ cmdtable.obj\ command.obj\ expalias.obj\ init.obj\ kswap.obj\ loadhigh.obj\ module.obj OBJ4 = redir.obj\ ver.obj LIBS = ..$(DIRSEP)cmd$(DIRSEP)cmds.lib ..$(DIRSEP)lib$(DIRSEP)freecom.lib \ ..$(DIRSEP)strings$(DIRSEP)strings.lib \ $(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib command.rsp : $(ECHOTODEP) makefile.mak $(RMFILES) command.rsp $(ECHOTO) command.rsp $(OBJ1)+ $(ECHOTO) command.rsp $(OBJ2)+ $(ECHOTO) command.rsp $(OBJ3)+ $(ECHOTO) command.rsp $(OBJ4) $(ECHOTO) command.rsp command.exe $(ECHOTO) command.rsp command.map $(ECHOTO) command.rsp $(LIBS)+ $(ECHOTO) command.rsp $(LIBC) command.exe : $(CFG) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) $(LD_RSP) $(LD) ================================================ FILE: shell/module.c ================================================ /* $Id$ * Special FreeCOM defuinitions for the module management * * 2000/07/12 ska * started */ #include "../config.h" #include "mcb.h" #include "suppl.h" #include "../include/command.h" #include "../include/debug.h" #include "../include/module.h" #include "../include/res.h" #include "../include/kswap.h" #include "../include/misc.h" #ifdef FREECOM_NEED_MODULES static int loadModule (res_majorid_t major, res_minorid_t minor, unsigned long length, int fd, void *const arg) { word segm; (void)major; if(length > 0xfffful) { dprintf(("[CRITER resource too large.]\n")); return 0; } switch(minor) { case 0x00: /* CRITER autofail */ if(!autofail) break; dprintf(("[INIT: Loading AutoFail context]\n")); goto loadMod; case 0x03: /* CRITER code & strings */ if(autofail) break; dprintf(("[INIT: Loading Interactive context]\n")); loadMod: /* If we reach here and swapOnExec == ERROR --> kernel does not allow swapping <-> each instance is loading its own context <-> the block is loaded is not detached from this instance */ segm = allocPermBlk((unsigned)length, 0x82); if(!segm) { dprintf(("[Out of memory loading CRITER module.]\n")); return 0; } if(farread(fd, MK_FP(segm, 0), (unsigned)length) != (unsigned)length) { dprintf(("[Error reading CRITER module.]\n")); freeSysBlk(segm); return 0; } registerCriterRepeatCheckAddr(MK_FP(segm, peekw(segm, length - 2))); *(word *)arg = segm; return 1; /* stop enumRes() */ #ifdef DEBUG default: dprintf(("Error: Unsupported minor resource ID: %u\n" , minor) ); break; #endif } return 0; /* Other minor IDs are happily ignored */ } /* Returns the pointer to the context pointer of the Critical Error handler and, if not loaded so far, loads it */ kswap_p modContext(void) { word segm; segm = 0; enumResources(RES_ID_CRITER, loadModule, &segm); #ifdef DEBUG if(segm) dprintf(("[CRITER loaded to segment 0x%04x.]\n", segm)); #endif return (kswap_p)MK_SEG_PTR(kswap_t, segm); } #endif ================================================ FILE: shell/redir.c ================================================ /* $Id$ * REDIR.C * * Comments: * * 12/15/95 (Tim Norman) * started. * * 12 Jul 98 (Hans B Pufal) * - Rewrote to make more efficient and to conform to new command.c and * batch.c processing. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 1998/10/27 ska * - bugfix: get_redirection() failed for non-paired quotes * - changed: joined to loop for checking for pipes & redirections * - changed: allocate the filename of redirection here to make the * allocated space fit tightly */ #include "../config.h" #include #include #include #include #include #include #include "../include/cmdline.h" #include "../include/command.h" #include "../err_fcts.h" static int is_redir(char c) { return (c == '<') || (c == '>') || (c == '|'); } int get_redirection(char *s, char **ifn, char **ofn, int *ofatt) { /* * Gets the redirection info from the command line and copies the * file names into ifn and ofn removing them from the command line. * The names are allocated here and passed back to the caller, on * malloc() failure, -1 is returned. These names are trimmed, * meaning they do not contain any leading or trailing whitespaces. * * Converts remaining command line into a series of null terminated * strings defined by the pipe char '|'. Each string corresponds * to a single executable command. A double null terminates the * command strings. * * Check for, but do not implement, output append redirect. * * Return number of command strings found. * */ int num = 1; int ch; char *dp = s; char *sp = s; assert(s); assert(ifn); assert(ofn); assert(ofatt); /* find and remove all the redirections first */ while ((ch = *dp++ = *sp++) != 0) switch (ch) { case '^': /* escape special character */ if (is_redir(*sp)) dp[-1] = *sp++; break; case '"': /* No redirects inside quotes */ /* case '\'': single quotes don't quote ska*/ { char *p; int len; /* If there is no closing quote, then go to end of line. */ if ((p = strchr(sp, ch)) == 0) { p = sp + strlen(sp) - 1; } /* closing quote found, move that area */ /* need memmove() because both areas overlap each other */ memmove(dp, sp, len = p - sp + 1); dp += len; sp += len; } break; case '<': case '>': { /* MS-DOS ignores multiple redirection symbols and uses the last */ /* redirection, so we'll emulate that and not check */ char **op = (ch == '<') ? ifn : ofn; char *p; if ((ch == '>') && (*sp == '>')) /* Append request ? */ { *ofatt = O_CREAT | O_APPEND | O_WRONLY; sp++; } p = sp = ltrimcl(sp); while (*sp && !is_redir(*sp) && !isargdelim(*sp)) ++sp; free(*op); /* ignore any previous one */ ch = *sp; *sp = '\0'; if ((*op = strdup(p)) == 0) { /* out of mem */ error_out_of_memory(); return -1; } *sp = ch; --dp; /* ignore the already copied '<' or '>' */ } break; case '|': dp[-1] = '\0'; /* overwrite the already copied '|' */ ++num; break; } /* end switch */ return num; } ================================================ FILE: shell/termhook.asm ================================================ ; File: ; termhook.asm ; Description: ; command.com termination hook ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version ; 2, or (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ; the GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public ; License along with this program; see the file COPYING. If not, ; write to the Free Software Foundation, 675 Mass Ave, ; Cambridge, MA 02139, USA. ; ; %include "../include/model.inc" %include "../include/stuff.inc" segment _TEXT cglobal termAddr termAddr: terminationAddressOffs DW 0 terminationAddressSegm DW 0 cextern canexit cglobal myPID myPID DW 0 cglobal origPPID origPPID DW 0 ;; central PSP:0xa hook <-> may be called in every circumstance cglobal terminateFreeCOMHook terminateFreeCOMHook: %ifndef XMS_SWAP dec BYTE [canexit] %endif mov ax, cs ; setup run environment (in this module) mov ds, ax %ifdef XMS_SWAP extern localStack mov ss, ax mov sp, localStack ; Next time we hit here it's != 1 --> no zero flag --> I_AM_DEAD status dec BYTE [canexit] %endif jnz I_AM_DEAD mov ax, [myPID] ; our own PSP [in case we arrived here mov es, ax ; in some strange ways] ; Make sure the current PSP hasn't patched to nonsense already mov bx, ax mov ah, 50h ; Set PSP int 21h ; Reset old termination address mov ax, [terminationAddressOffs] mov [es:0ah], ax mov ax, [terminationAddressSegm] mov [es:0ch], ax ; Drop our "Shell" privileges mov ax, [origPPID] ; original parent process ID mov [es:16h], ax ; Kill the XMS memory block %ifdef XMS_SWAP extern xms_kill call xms_kill %endif ; Now, DOS-4C should proceed correctly mov ax,04cffh ; and die ... int 21h I_AM_DEAD: ; process 0 can't terminate ... mov dx, dead_loop_string mov ah, 9 int 21h I_AM_DEAD_loop: int3 sti hlt jmp short I_AM_DEAD_loop dead_loop_string DB 13,10,7,'Cannot terminate permanent FreeCOM instance' DB 13,10,'System halted ... reboot or power off now $' ================================================ FILE: shell/ver.c ================================================ /* $Id$ * VER.C * * 06/30/98 (Rob Lake) * rewrote ver command to accept switches, now ver alone prints * copyright notice only. * * 27-Jul-1998 (John P Price ) * - added config.h include * * 30-Jul-1998 (John P Price ) * - added text about where to send bug reports and get updates. * * 13-Sep-1998 (John P Price ) * - change /r to print info. /d shows redistribution info now. * * 30-Jan-1999 (John P Price ) * - changed /r to show FreeDOS kernel version * * 1-Apr-2000 0.79 Henry Voigt * bugfix: ver.c : options uninitilized * * 2000/06/22 ska * new version: v0.79b * * 2000/12/10 ska * new minor version: v0.80 * * 2001/02/16 ska * bugfix: VER (without option) displays too much information * chg: using strings (except FreeCOM's own name) */ #include "../config.h" #include #include #include "../include/command.h" #include "../include/cmdline.h" #include "../err_fcts.h" #include "../strings.h" #include "../version.h" const char shellver[] = FREECOM_VERSION " - " #if defined(__BORLANDC__) "BORLANDC" #elif defined(__TURBOC__) "TURBOC" #elif defined(__WATCOMC__) "WATCOMC" #elif defined(__GNUC__) "GNUC" #endif #ifdef FEATURE_XMS_SWAP " - XMS_Swap" #endif ; static const char shelldate[] = __DATE__ " " __TIME__; const char shellname[] = "FreeCom"; #if 0 void short_version(void) { printf("\n%s version %s [%s]\n", shellname, shellver, shelldate); } #endif #ifdef INCLUDE_CMD_VER static int optR, optW, optD, optC; optScanFct(opt_ver) { (void)arg; switch(ch) { case 'R': return optScanBool(optR); case 'W': return optScanBool(optW); case 'D': return optScanBool(optD); case 'C': return optScanBool(optC); } optErr(); return E_Useage; } /* * display shell version info internal command. * * */ int cmd_ver (char * rest) { char **argv; int argc, opts, ec = E_None; #if 0 short_version(); #else printf("\n%s version %s [%s]\n", shellname, shellver, shelldate); #endif optR = optW = optD = optC = 0; if((argv = scanCmdline(rest, opt_ver, 0, &argc, &opts)) == 0) return 1; /* arguments are simply ignored */ if(optR) { /* version information */ unsigned int major, minor; IREGS regs; regs.r_ax = 0x3306; regs.r_bx = 0; intrpt(0x21, ®s); major = regs.r_bx & 255; minor = regs.r_bx >> 8; regs.r_ax = 0x3000; intrpt(0x21, ®s); if (major == 0) { major = regs.r_ax & 255; minor = regs.r_ax >> 8; } displayString(TEXT_MSG_VER_DOS_VERSION, major, minor); if ((regs.r_bx >> 8) == 0xfd && (regs.r_bx & 0xFF) == 0xff) { displayString(TEXT_MSG_VER_EARLY_FREEDOS); } else { unsigned char far * pstart; unsigned char far * pend; /* displayString(TEXT_MSG_VER_LATER_FREEDOS , regs.r_cx >> 8, regs.r_cx & 0xFF, regs.r_bx & 0xFF); , 2, 0, regs.r_bx & 0xFF ); */ regs.r_ax = 0x33FF; regs.r_dx = 0; intrpt( 0x21, ®s ); if (regs.r_dx) { pstart = MK_FP( regs.r_dx, regs.r_ax ); for (pend = pstart; *pend; ++ pend) /* empty loop body */; while (pend > pstart && (pend[-1] == ' ' || pend[-1] == 9 || pend[-1] == 10 || pend[-1] == 13)) { -- pend; } printf( "%.*Fs\n", pend - pstart, pstart); } } } if (optW) { /* Warranty notice */ displayString(TEXT_MSG_VER_WARRANTY); } if (optD) { /* Redistribution notice */ displayString(TEXT_MSG_VER_REDISTRIBUTION); } if (optC) { /* Developer listing */ displayString(TEXT_MSG_VER_DEVELOPERS); } freep(argv); return ec; } #endif ================================================ FILE: shell/wlinker.bat ================================================ @echo off ms2wlink %1 %2 %3 %4 %5 %6 %7 %8 %9 ,,,, > tmp.lnk echo op map,statics,verbose,stack=4k >> tmp.lnk call wlink @tmp.lnk del tmp.lnk ================================================ FILE: shell/xms_2e.asm ================================================ ; $Id$ ; Int2e handler for XMS Swap ; variant ; int process_input(int xflag, char *commandline) %if 1 %include "../include/model.inc" %include "../include/stuff.inc" segment _TEXT cglobal lowlevel_int_2e_handler lowlevel_int_2e_handler: mov ax, 0FFFFh iret %else segment _TEXT class=CODE extern _residentCS, _mySS, _mySP, _XMSsave, _XMSdriverAdress, _SwapTransientSize, _my2e_parsecommandline, SWAPXMSdirection, _SwapResidentSize %define callXMS call far [cs:_XMSdriverAdress] %define currentSegmOfFreeCOM _XMSsave+8 global myfar2e_parsecommandline myfar2e_parsecommandline: call _my2e_parsecommandline retf global _lowlevel_int_2e_handler _lowlevel_int_2e_handler: cld push si ; lss sp,[_mySP] mov ss,[cs:_mySS] mov sp,[cs:_mySP] ; mov cs,[_residentCS] ; mov ds,sp ; mov es,ds ; mov ds,ss mov ah,48h ; move into conventional memory mov bx,[cs:_SwapTransientSize] int 21h jc swaperr mov bx,ax sub bx,[cs:currentSegmOfFreeCOM] push bx mov [cs:currentSegmOfFreeCOM],ax call SWAPXMSdirection mov ah,0bh mov si,_XMSsave callXMS ; call SWAPXMSdirection pop bx cmp ax,1 jnz swaperr ; mov ax,[_mySS] ; add ax,bx ; mov ss,ax ; mov sp,[_mySP] %if 0 mov ax,[_mySS] sub ax,10 mov ss,ax mov sp,[_mySP] %endif ; calling stuff here ; push es push ds pop si push si mov ds,sp ; push word 1 ; call _process_input call far [myfar2e_parsecommandline] %if 0 push ax mov ah,0bh ; move into XMS again mov si,_XMSsave callXMS call SWAPXMSdirection pop ax %endif jmp finish swaperr: mov ax,0FFFFh finish: iret %endif ================================================ FILE: shell/xms_brk.asm ================================================ ; $Id$ ; Criter and ^Break handler for external programs for XMS Swap ; variant %include "../include/model.inc" %include "../include/stuff.inc" segment _TEXT cglobal lowlevel_cbreak_handler lowlevel_cbreak_handler: %include "../criter/dmy_cbrk.asm" ================================================ FILE: shell/xms_crit.asm ================================================ ; $Id$ ; Criter and ^Break handler for external programs for XMS Swap ; variant %include "../include/model.inc" segment _TEXT ;; If the include is in here, NASM locks up, suck all CPU ; global _lowlevel_cbreak_handler ;_lowlevel_cbreak_handler: ;%include "../criter/dmy_cbrk.asm" %define XMS_SWAP_CRITER %define NO_RESOURCE_BLOCK %include "../criter/criter.asm" ================================================ FILE: strings/CHANGED ================================================ add: EXIT: unless loaded with /P add: useage example into FOR ren: TEXT_ERROR_BAD_VERABLE into TEXT_ERROR_BAD_VARIABLE ================================================ FILE: strings/DEFAULT.err ================================================ # $Id$ # # Critical error national customization file # # Language: English # Codepage: ASCII (7bit) / any codepage # Author: FreeCOM maintainer # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parentheses. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Error %1 drive %A: %2 area: %3 S3 CHAR_DEVICE: Error %1 device %A: %3 ## kind of operation S0 READ: reading from S1 WRITE: writing to ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: root S7 DATA: data ## action strings S8 IGNORE: (I)gnore S9 RETRY: (R)etry S10 ABORT: (A)bort S11 FAIL: (F)ail ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Unknown error code S15 0: write-protection violation attempted 1: unknown unit for driver 2: drive not ready 3: unknown command given to driver 4: data error (bad CRC) 5: bad device driver request structure length 6: seek error 7: unknown media type 8: sector not found 9: printer out of paper 10: write fault 11: read fault 12: general failure 13: sharing violation 14: lock violation 15: invalid disk change 16: FCB unavailable 17: sharing buffer overflow 18: code page mismatch 19: out of input 20: insufficient disk space ================================================ FILE: strings/DEFAULT.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: English # Codepage: ASCII (7bit) / any codepage # Author: FreeCOM maintainer # Changelog by W. Spiegl (2024-12-21). # TEXT_CMDHELP_IF: added /I string==STRING # TEXT_CMDHELP_ECHO: added ECHO. # TEXT_CMDHELP_SHIFT: fixed (%0) to be (%%0). # Changelog by W. Spiegl (2024-10-15): # "FOR - Example: replaced %% by %%%%" # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retrieve the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. Use a double %, %% to display a %. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carriage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interpret a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitrary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readability of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Invalid switch. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Invalid switch. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Ill-formed option: '%s' . :TEXT_ERROR_OPT_ARG#0% Option '%s' can not have an argument . :TEXT_ERROR_OPT_NOARG#0% Option '%s' must have an argument . :TEXT_INVALID_NUMBER#0% Invalid number specified in '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Missing closing quote: %c . :TEXT_ERROR_TEMPFILE Can not create temporary file . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Too many parameters. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Too many parameters. . :TEXT_ERROR_INVALID_PARAMETER#0% Invalid parameter. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Path not found. . :TEXT_ERROR_FILE_NOT_FOUND File not found. . :TEXT_ERROR_SFILE_NOT_FOUND#0% File not found. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Required parameter missing. . :TEXT_ERROR_INVALID_DRIVE#0% Invalid drive %c:. . :TEXT_ERROR_BADCOMMAND#2% Bad command or filename - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Out of memory error. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Allocation of DOS memory failed. . :TEXT_ERROR_CANNOTPIPE Cannot pipe! Cannot open temporary file! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Line #%ld in batchfile '%s' too long. . :TEXT_ERROR_BFILE_VANISHED#0% Batchfile '%s' not found. . :TEXT_ERROR_BFILE_LABEL#0% Batchfile '%s' does not contain label '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s failed for '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Can not set environment variable '%s'. Environment full? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Environment variable '%s' not found. . :TEXT_ERROR_NO_ENVIRONMENT No environment. Maybe memory short. Specify /E option. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Can not set alias '%s'. Alias space full? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' not found. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 No alias space. Maybe memory short. . :TEXT_ERROR_SYNTAX_STR#0% Syntax error. - '%s' . :TEXT_ERROR_SYNTAX Syntax error. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Filename too long. - '%s' . :TEXT_ERROR_SELFCOPY#0% Cannot copy '%s' to itself . :TEXT_ERROR_COMMAND_TOO_LONG Command line too long after alias expansion! . :TEXT_ERROR_LINE_TOO_LONG Commandline longer than 125 characters. . :TEXT_ERROR_HISTORY_SIZE#1% Invalid history size '%s'. . :TEXT_HISTORY_EMPTY#1 Command line history empty. . :TEXT_ERROR_BAD_MCB_CHAIN MCB chain corrupt, or MS-DOS incompatible system. . :TEXT_ERROR_UNDEFINED_ERROR#0% Undefined error %d. . :TEXT_ERROR_REGION_WARNING#0% Illegal memory region %d - ignored. . :TEXT_ERROR_ON_OR_OFF Must specify ON or OFF. . :TEXT_ERROR_BAD_VARIABLE Bad variable specification. . :TEXT_ERROR_IN_MISSING#1 FOR: IN missing. . :TEXT_ERROR_MISSING_PARENTHESES#1 One or both parentheses missing. . :TEXT_ERROR_DO_MISSING#1 FOR: DO missing. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: No command after DO statement. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Can not redirect input from file '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Can not redirect output to file '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Empty redirection. . :TEXT_ERROR_INVALID_DATE Invalid date. . :TEXT_ERROR_INVALID_TIME Invalid time. . :TEXT_ERROR_NO_GOTO_LABEL No label specified for GOTO. . :TEXT_CTTY_NOTIMPLEMENTED The CTTY command has been excluded from this COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% Invalid or no read-write device '%s'. . :TEXT_ERROR_CTTY_DUP#0% Failed to change file descriptors to TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L not implemented yet. . :TEXT_ERROR_U_NOTIMPLEMENTED /U not implemented yet. . :TEXT_ERROR_WRITING_DEST Error writing to destination. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Unable to open source. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Unable to open file '%s' . :TEXT_ERROR_READ_FILE#0% Unable to read from file '%s' . :TEXT_ERROR_WRITE_FILE#0% Unable to write to file '%s' . :TEXT_ERROR_LEADING_PLUS The concatenation character '+' cannot lead the arguments. . :TEXT_ERROR_TRAILING_PLUS The concatenation character '+' cannot trail the arguments. . :TEXT_ERROR_NOTHING_TO_DO Nothing to do. . :TEXT_ERROR_COPY COPY failed . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: missing filename . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: missing number . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: invalid number . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Missing command . :TEXT_NOT_IMPLEMENTED_YET Sorry...not implemented yet. . :TEXT_FAILED_LOAD_STRINGS Failed to load messages into memory. . :TEXT_MSG_NOTIMPLEMENTED The /MSG option has been excluded from this COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u items displayed. . :TEXT_CORRUPT_COMMAND_LINE Corrupt command line. This is an internal error and is related to the system COMMAND.COM runs in. Please report this error. . :TEXT_QUOTED_C_OR_K#1 The /C and /K options cannot be quoted, they are ignored. . :TEXT_INIT_FULLY_QUALIFIED#1% The path to COMMAND.COM must be fully qualified! That means including drive letter and beginning with a backslash. For example: C:\\FDOS COMMAND.COM assumes this path now: %s . :TEXT_ERROR_RESTORE_SESSION The session information could not be restored, any local settings are lost. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_SAVE_SESSION The current information cannot be preserved during the call of the program. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_CWD_FAILED#1% Drive %c: not responding. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swapping failed: Aliases allocate too much memory. . :TEXT_ERROR_KSWAP_ALLOCMEM Swapping failed: Cannot allocate far memory. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Out of alias space. . :TEXT_ERROR_ALIAS_NO_SUCH#1% No such alias: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Failed to insert alias. . :TEXT_ALIAS_INVALID_NAME#1% Invalid alias name '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Cannot load Context module or Critical Error handler. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Context out of memory. If this error persists, consider to increase some internal buffer, such as history, directory stack etc. . :TEXT_ERROR_CONTEXT_LENGTH#1% Size of context totals %lu bytes exceeding maximal limit. Resizing context to %u bytes. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Failed to add status information into context. This error may indicate memory corruption or an incorrectly determined minimum size of the context. Please inform the maintainer of FreeCOM at: freedos-devel@lists.sourceforge.net mailing list. . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 The context is missing after swap. The context is re-created, but all aliases etc. are lost. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Permission denied . :TEXT_ERROR_NO_SUCH_FILE#1% %s: No such file or directory . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Unknown error . # # Informational messages # :TEXT_MSG_PAUSE#1 Press any key to continue . . .\ . :TEXT_MSG_HISTORY_SIZE#0% History size is %d bytes. . :TEXT_MSG_DOSKEY DOSKEY features are already enabled in the shell. . :TEXT_MSG_ECHO_STATE#0% ECHO is %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY is %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG output is %s. . :TEXT_MSG_FDDEBUG_TARGET#0% DEBUG output is printed to '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK is %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR is %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN Complete is %s . :TEXT_MSG_CURRENT_DATE#0% Current date is %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Enter new date (mm%sdd%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Enter new date (dd%smm%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Enter new date ([cc]yy%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME#0% Current time is %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Enter new time: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% YyNn{CR}{LF}{CBREAK} aabb b b b All files in '%s' will be deleted! Are you sure (Y/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 YyNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Yes=ENTER, No=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% YyNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break pressed.\r Terminate batch file '%s' (Yes/No/All) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b Overwrite '%s' (Yes/No/All/Quit) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b Append to '%s' (Yes/No/All/Quit) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b Delete '%s' (Yes/No/All/Quit) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Directory stack empty. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Volume in drive %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% is %s . :TEXT_DIR_HDR_VOLUME_NONE has no label . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Volume Serial Number is %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s file(s)\ . :TEXT_DIR_FTR_BYTES#0% %12s bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Total files listed: . :TEXT_DIR_FTR_DIRS#1% %10s dir(s)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s bytes free . :TEXT_DIR_DIRECTORY#0% Directory of %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Directory of %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 No search path defined. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Sun\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Mon\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Tue\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Wed\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Thu\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Fri\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sat\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 no file removed. . :TEXT_MSG_DEL_CNT_FILES_1#1 one file removed. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u files removed. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Internal commands available: . :TEXT_MSG_SHOWCMD_FEATURES Features available: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliases] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [enhanced input] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [history] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [filename completion] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [swapping] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start logging] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [last dir] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [long filenames] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS swap] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [default to swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [installable commands] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [directory stack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM debugging] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Press F8 for trace mode, or F5 to bypass %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Bypassing '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS version %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS kernel (build 1933 or prior) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS kernel version %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2005 Tim Norman and others. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Send bug reports to freedos-devel@lists.sourceforge.net. Updates are available from http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2005 Tim Norman and others. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Send bug reports to freedos-devel@lists.sourceforge.net. Updates are available from http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS The FreeDOS Command Shell developed by many developers, please refer to the enclosed HISTORY.TXT file. Send bug reports to freedos-devel@lists.sourceforge.net. Updates are available from http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r The shell is about to be terminated, though, this is\r forbidden (usually by enabling the "/P" option).\r You must reboot the system or, if this shell runs in\r a multitasking environment, terminate this process/task manually.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM executable not found. You must specify the complete path to COMMAND.COM as the first argument of COMMAND, for instance: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Environment segment : max %5u bytes; free %5u bytes . :TEXT_MEMORY_CONTEXT#1% Context segment : max %5u bytes; free %5u bytes . :TEXT_MEMORY_HEAP#1% Heap : free %5lu bytes . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliases : limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistory : limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tDirectory stack: limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_LASTDIR#1% \tLast dir cache : used %5u bytes, %5u items . :TEXT_MEMORY_CTXT_BATCH#1% \tBatch nesting : used %5u bytes, %5u items . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : used %5u bytes, %5u items . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Failed to acquire current code page from system. . :TEXT_ERROR_SET_CODEPAGE#1 Failed to change current code page. . :TEXT_DISPLAY_CODEPAGE#1% The current codepage is %u. The system codepage (properly) is: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Displays, sets, or removes aliases. ALIAS [variable[=][string]] variable Specifies the alias name. string Specifies a series of characters to assign to the alias. Type ALIAS without parameters to display the current aliases. . :TEXT_CMDHELP_BEEP Make a beep sound. . :TEXT_CMDHELP_BREAK Sets or clears extended CTRL+C checking. BREAK [ON | OFF] Type BREAK without a parameter to display the current BREAK setting. . :TEXT_CMDHELP_CALL#1 Calls one batch program from another. CALL [/S | /N] [/Y] [drive:][path]filename [batch-parameters] batch-parameters Specifies any command-line information required by the batch program. /S enforces, /N denies swapping of FreeCOM. /Y enables tracemode during execution of the command. . :TEXT_CMDHELP_CD Displays the name of or changes the current directory. CHDIR [drive:][path] CHDIR[..] CD [drive:][path] CD[..] CD - .. Specifies that you want to change to the parent directory. - If "last directory" feature is enabled, change to last directory. Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory. See also: CDD . :TEXT_CMDHELP_CDD Displays the name of or changes the current directory and drive. CDD [drive:][path] CDD[..] .. Specifies that you want to change to the parent directory. - If "last directory" feature is enabled, change to last directory. If drive: is specified, the current working drive is changed; this is the only different to "CHDIR". Type CD without parameters to display the current drive and directory. . :TEXT_CMDHELP_CHCP Displays or sets the active code page number. CHCP [nnn] nnn Specifies a code page number. Type CHCP without a parameter to display the active code page number. . :TEXT_CMDHELP_CLS Clears the screen. CLS . :TEXT_CMDHELP_COMMAND Starts a new copy of the FreeDOS command shell. COMMAND [[drive:]path] [device] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] command]] [drive:]path Specifies the directory containing COMMAND.COM. device Specifies the device to use for command input and output. /E:nnnnn Sets the initial environment size to nnnnn bytes. (nnnnn should be between 256 and 32,768). /L:nnnn Specifies internal buffers length (requires /P as well). (nnnn should be between 128 and 1,024). /U:nnn Specifies the input buffer length (requires /P as well). (nnn should be between 128 and 255). /P Makes the new command shell permanent (can't exit). /MSG Stores all error messages in memory (requires /P as well). /LOW Forces the command shell to keep its resident data in low memory. /Y Steps through the batch program specified by /C or /K. /C command Executes the specified command and returns. /K command Executes the specified command and continues running. . :TEXT_CMDHELP_COPY Copies one or more files to another location. COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] [/V] [/Y | /-Y] source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format). . :TEXT_CMDHELP_CTTY Changes the terminal device used to control your system. CTTY device device The terminal device you want to use, such as COM1. . :TEXT_CMDHELP_DATE#1 Displays or sets the date. DATE [/D] [date] Type DATE without parameters to display the current date setting and a prompt for a new one. Press ENTER to keep the same date. /D prevents DATE to become interactive. . :TEXT_CMDHELP_DEL#2 Deletes one or more files. DEL [drive:][path]filename [/P] [/V] ERASE [drive:][path]filename [/P] [/V] [drive:][path]filename Specifies the file(s) to delete. Specify multiple files by using wildcards. /P Prompts for confirmation before deleting each file. /V Displays all deleted files. . :TEXT_CMDHELP_DIR#4 Displays a list of files and subdirectories in a directory. DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sortorder]] [/S] [/B] [/L] [drive:][path][filename] Specifies drive, directory, and/or files to list. (Could be enhanced file specification or multiple filespecs.) /P Pauses after each screenful of information. /W Uses wide list format. /A Displays files with specified attributes. (Defaults to /ADHSRA) attributes D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not /O List by files in sorted order. sortorder N By name (alphabetic) S By size (smallest first) E By extension (alphabetic) D By date & time (earliest first) G Group directories first - Prefix to reverse order U Unsorted Defaults to /ONG /S Displays files in specified directory and all subdirectories. /B Uses bare format (no heading information or summary). /L Uses lowercase. /Y or /4 Display 4-digit year. Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W. . :TEXT_CMDHELP_DOSKEY#1 The external DOSKEY utility had been incorporated into FreeCOM. Use cursor UP,& DOWN keys to recall the history and HISTORY to display it. Use cursor LEFT,& RIGHT and the END and HOME keys to navigate within the command line and toggle INSERT between overstrike and insert mode. Use the TAB key to complete the current word as filename; use it twice to show all matching files. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edits command lines, recalls command lines, and creates macros DOSKEY [/switch ...] [macroname=[text]] /BUFSIZE:size Sets size of macro and command buffer (default:512) /ECHO:on|off Enables/disables echo of macro expansions (default:on) /FILE:file Specifies file containing a list of macros /HISTORY Displays all commands stored in memory /INSERT Inserts new characters into line when typing /KEYSIZE:size Sets size of keyboard type-ahead buffer (default:15) /LINE:size Sets maximum size of line edit buffer (default:128) /MACROS Displays all DOSKey macros /OVERSTRIKE Overwrites new characters onto line when typing (default) /REINSTALL Installs a new copy of DOSKey macroname Specifies a name for a macro you create text Specifies commands you want to assign to the macro UP,DOWN arrows recall commands Esc clears current command F7 displays command history Alt+F7 clears command history [chars]F8 searches for command beginning with [chars] F9 selects a command by number Alt+F10 clears macro definitions The following are special codes you can use in DOSKey macro definitions: $T Command separator: allows multiple commands in a macro $1-$9 Batch parameters: equivalent to %1-%9 in batch programs $* Symbol replaced by everything following macro name on the command line . :TEXT_CMDHELP_ECHO Displays messages, or turns command-echoing on or off. ECHO [ON | OFF] ECHO [message] ECHO. ECHO. displays an empty line (only in batch files) Type ECHO without parameters to display the current echo setting. . :TEXT_CMDHELP_EXIT Quits the FreeDOS command shell unless loaded with /P. EXIT . :TEXT_CMDHELP_FOR Runs a specified command for each file in a set of files. FOR %%variable IN (set) DO command [command-parameters] %%variable Specifies a replaceable parameter. (set) Specifies a set of one or more files. Wildcards may be used. command Specifies the command to carry out for each file. command-parameters Specifies parameters or switches for the specified command. To use the FOR command in a batch program, specify %%%%variable instead of %%variable. For example: FOR %%%%f IN (---start--- a*.* ---end---) DO ECHO - %%%%f - . :TEXT_CMDHELP_GOTO Directs the command shell to a labelled line in a batch program. GOTO label label Specifies a text string used in the batch program as a label. You type a label on a line by itself, beginning with a colon. . :TEXT_CMDHELP_HISTORY#1 History command. HISTORY [size] Without "size" the current contents of the command line history buffer is displayed. With the size, the size of the history buffer is changed. . :TEXT_CMDHELP_IF Performs conditional processing in batch programs. IF [NOT] ERRORLEVEL number command IF [NOT] string1==string2 command IF [NOT] EXIST filename command IF /I string==STRING NOT Specifies that the command shell should carry out the command only if the condition is false. ERRORLEVEL number Specifies a true condition if the last program run returned an exit code equal to or greater than the number specified. command Specifies the command to carry out if the condition is met. string1==string2 Specifies a true condition if the specified text strings match. EXIST filename Specifies a true condition if the specified filename exists. /I string==STRING Ignores uppercase / lowercase . :TEXT_CMDHELP_LFNFOR Enables/Disables long filenames within the FOR command or filename completion. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Type LFNFOR or LFNFOR COMPLETE without a parameter to display the current LFNFOR setting. . :TEXT_CMDHELP_LH Loads a program into the upper memory area. LOADHIGH [drive:][path]filename [parameters] LOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...] [/S]] [drive:][path]filename [parameters] /L:region1[,minsize1][;region2[,minsize2]]... Specifies the region(s) of memory into which to load the program. Region1 specifies the number of the first memory region; minsize1 specifies the minimum size, if any, for region1. Region2 and minsize2 specify the number and minimum size of the second region, if any. You can specify as many regions as you want. /S Shrinks a UMB to its minimum size while the program is loading. [drive:][path]filename Specifies the location and name of the program. . :TEXT_CMDHELP_LOADFIX Loads a program above the first 64K of memory, and runs the program. LOADFIX [drive:][path]filename Use LOADFIX to load a program if you have received the message "Packed file corrupt" when trying to load it in low memory. . :TEXT_CMDHELP_MD Creates a directory. MKDIR [drive:]path MD [drive:]path . :TEXT_CMDHELP_PATH Displays or sets a search path for executable files. PATH [[drive:]path[;...]] PATH ; Type PATH ; to clear all search-path settings and direct the command shell to search only in the current directory. Type PATH without parameters to display the current path. . :TEXT_CMDHELP_PAUSE Suspends processing of a batch program and displays the message: "Press any key to continue...." or an optional specified message. PAUSE [message] . :TEXT_CMDHELP_PROMPT Changes the command prompt. PROMPT [text] text Specifies a new command prompt. Prompt can be made up of normal characters and the following special codes: $Q = (equal sign) $$ $ (dollar sign) $T Current time $D Current date $P Current drive and path $V the FreeDOS command shell version number $N Current drive $G > (greater-than sign) $L < (less-than sign) $B | (pipe) $H Backspace (erases previous character) $E Escape code (ASCII code 27) $_ Carriage return and linefeed Type PROMPT without parameters to reset the prompt to the default setting. . :TEXT_CMDHELP_PUSHD Pushes current directory onto the directory stack, with the option to change current working directory. PUSHD [[drive:]path] Where [drive:]path is a path to which you wish to change. . :TEXT_CMDHELP_POPD Pops a directory off of the directory stack, and changes to it. POPD [*] The '*' parameter clears the directory stack. . :TEXT_CMDHELP_DIRS Displays the contents of the directory stack. DIRS . :TEXT_CMDHELP_RD Removes (deletes) an empty directory. RMDIR [drive:]path RD [drive:]path . :TEXT_CMDHELP_REM Records comments (remarks) in a batch file or CONFIG.SYS. REM [comment] . :TEXT_CMDHELP_REN Renames a file/directory or files/directories. RENAME [drive:][path][directoryname1 | filename1] [directoryname2 | filename2] REN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2] Note that you cannot specify a new drive or path for your destination. Use the MOVE command for that purpose. . :TEXT_CMDHELP_SET#1 Displays, sets, or removes environment variables. SET [/C] [/P] [/E] [/U] [variable[=[string]]] variable Specifies the environment-variable name. string Specifies a series of characters to assign to the variable. * If no string is specified, the variable is removed from the environment. Type SET without parameters to display the current environment variables. Type SET VAR to display the value of VAR /C forces to keep the case of the variable; by default the variable is uppercased, if it is not located in the environment already, otherwise the case is retained. /P prompt the user with string, and assigns the user input to the variable. /E sets the given variable to the first line of output of the command pointed to by [string]. /U changes the case of [string] to uppercase. . :TEXT_CMDHELP_SHIFT#1 Changes the position of replaceable parameters in a batch file. SHIFT [DOWN] DOWN shifts the argument window toward the beginning (%%0); otherwise toward the end. . :TEXT_CMDHELP_TIME#1 Displays or sets the system time. TIME [/T] [time] Type TIME with no parameters to display the current time setting and a prompt for a new one. Press ENTER to keep the same time. /T prevents TIME from becoming interactive. . :TEXT_CMDHELP_TRUENAME Displays the full path name of the path specified. TRUENAME [drive:][path][filename] . :TEXT_CMDHELP_TYPE Displays the contents of text files. TYPE [drive:][path]filename . :TEXT_CMDHELP_VER Displays the FreeDOS command shell version and other information. VER [/R] [/W] [/D] [/C] /R Shows kernel version and other information. /W FreeDOS command shell warranty. /D FreeDOS command shell redistribution information. /C FreeDOS command shell contributors. . :TEXT_CMDHELP_VERIFY Tells the FreeDOS file system whether to verify that your files are written correctly to a disk. VERIFY [ON | OFF] Type VERIFY without a parameter to display the current VERIFY setting. . :TEXT_CMDHELP_FDDEBUG If debugging is compiled into FreeDOS, this command will turn debug output on or off, or tell you if it is on or off. FDDEBUG [ON | OFF | file] Type FDDEBUG without a parameter to display the current debug output setting. If a file is specified, all debug output is redirected into that file; the output is appended to the file, if it already exists. The special names "stdout" and "stderr" may be used to redirect the output to the standard output or standard error stream. . :TEXT_CMDHELP_VOL Displays the disk volume label and serial number, if they exist. VOL [drive:] . :TEXT_CMDHELP_QUESTION#1 Displays a list of commands and features available with in the shell. ? ?command [argument] The first variant displays any available internal command and feature. The second one will prompt whether or not to execute the specified command as if trace mode would be active. . :TEXT_CMDHELP_WHICH Searches and displays the executable file for each specified command. WHICH command... . :TEXT_CMDHELP_MEMORY#1 Displays the internal memory used by FreeCOM internally. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 The COPY destination must not contain plus ('+') characters. . :TEXT_DELETE_FILE#1% Deleting file "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Unable to write to file '%s'; probably disc full? (%lu bytes required) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% copied %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% copied %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM cannot be a device: "%s" . :TEXT_ERROR_FCOM_INVALID#0% This file is no valid FreeCOM or of an incompatible version: %s . :TEXT_ERROR_LOADING_STRINGS Failed to load the strings resource into memory, the location pointed to in %COMSPEC% seems to be invalid. Please specify another location of FreeCOM to try to load the strings from, e.g.: C:\\COMMAND.COM or just hit enter to cancel to load the strings. . :TEXT_TERMINATING Terminating now. . :TEXT_HIDDEN_CRITER#0% %u Critical Error requests suppressed. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Exit code (ERRORLEVEL): %u, reason: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS API error\ . :TEXT_EXIT_REASON_0 terminated normally\ . :TEXT_EXIT_REASON_1 terminated by ^Break\ . :TEXT_EXIT_REASON_2 terminated by critical error\ . :TEXT_EXIT_REASON_3 gone resident\ . :TEXT_ERROR_EXE_CORRUPT EXE file corrupt\ . ================================================ FILE: strings/depend.mk ================================================ strings .SEQUENTIAL : utils strings_dir strings_dir .SETDIR=strings : @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += strings_clean strings_clean .SETDIR=strings : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += strings_clobber strings_clobber .SETDIR=strings : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += strings_dist strings_dist .SETDIR=strings : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: strings/dutch.err ================================================ # No translations. Dummy file. See the DEFAULT.err file ================================================ FILE: strings/dutch.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Dutch # Author: Bernd Blaauw, bblnews@hotmail.com # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the # question mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH Ongeldige schakeloptie. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH Ongeldige schakeloptie. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION Slecht-gevormde optie: '%s' . :TEXT_ERROR_OPT_ARG Optie '%s' kan geen parameter hebben . :TEXT_ERROR_OPT_NOARG Optie '%s' dient een parameter te hebben . :TEXT_INVALID_NUMBER Ongeldig nummer opgegeven in '%s' . :TEXT_ERROR_CLOSE_QUOTE Sluit-quote-teken mist ("): %c . :TEXT_ERROR_TEMPFILE Kan geen tijdelijk bestand aanmaken . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Te veel parameters. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Te veel parameters. . :TEXT_ERROR_INVALID_PARAMETER Ongeldige parameter. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Pad niet gevonden. . :TEXT_ERROR_FILE_NOT_FOUND Bestand niet gevonden. . :TEXT_ERROR_SFILE_NOT_FOUND Bestand niet gevonden. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING Vereiste parameter ontbreekt. . :TEXT_ERROR_INVALID_DRIVE Ongeldige schijf %c:. . :TEXT_ERROR_BADCOMMAND#2 Ongeldige opdracht of bestandsnaam - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Geheugengebrek-fout. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Toewijzing van DOS geheugen is mislukt. . :TEXT_ERROR_CANNOTPIPE Kan geen pijp maken! Kan tijdelijk bestand niet openen! . :TEXT_ERROR_LONG_LINE_BATCHFILE Regel #%ld in batch-bestand '%s' is te lang. . :TEXT_ERROR_BFILE_VANISHED Batch-bestand '%s' niet gevonden. . :TEXT_ERROR_BFILE_LABEL Batch-bestand '%s' draagt niet het label '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s mislukt voor '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR Kan omgevingsvariable '%s' niet aanmaken. Omgevingsruimte vol? . :TEXT_ERROR_ENV_VAR_NOT_FOUND Omgevingsvariabele '%s' niet gevonden. . :TEXT_ERROR_NO_ENVIRONMENT Geen omgevingsruimte. Wellicht geheugentekort. Geef de /E optie op. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 Kan alias '%s' niet maken. Alias ruimte vol? . :TEXT_ERROR_ALIAS_NOT_FOUND#1 Alias '%s' niet gevonden. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Geen alias ruimte. Waarschijnlijk geheugen tekort. . :TEXT_ERROR_SYNTAX_STR Syntax fout. - '%s' . :TEXT_ERROR_SYNTAX Syntax fout. . :TEXT_ERROR_FILENAME_TOO_LONG Bestandsnaam te lang. - '%s' . :TEXT_ERROR_SELFCOPY Kan '%s' niet naar zichzelf kopieren . :TEXT_ERROR_COMMAND_TOO_LONG Opdrachtregel te lang na ALIAS uitbreiding! . :TEXT_ERROR_LINE_TOO_LONG Regel te lang. Kan opdracht niet uitvoeren. . :TEXT_ERROR_HISTORY_SIZE#1 Ongeldige geschiedenisgrootte '%s'. . :TEXT_HISTORY_EMPTY#1 Geschiedenis van opdrachtregel is leeg. . :TEXT_ERROR_BAD_MCB_CHAIN MCB keten corrupt, of MS-DOS incompatibel systeem. . :TEXT_ERROR_UNDEFINED_ERROR Ongedefinieerde fout %d. . :TEXT_ERROR_REGION_WARNING Illegaal geheugenmemorybereik %d - achterwege gelaten. . :TEXT_ERROR_ON_OR_OFF U dient ON of OFF op te geven. . :TEXT_ERROR_BAD_VARIABLE Slechte variabele definitie. . :TEXT_ERROR_IN_MISSING#1 FOR: IN ontbreekt. . :TEXT_ERROR_MISSING_PARENTHESES#1 Een of beide haakjes missen "(" ")". . :TEXT_ERROR_DO_MISSING#1 FOR: DO ontbreekt. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: geen opdracht na DO statement opgegeven. . :TEXT_ERROR_REDIRECT_FROM_FILE Kan invoer van bestand '%s' niet omleiden. . :TEXT_ERROR_REDIRECT_TO_FILE Kan uitvoer niet omleiden naar bestand '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Lege omleiding. . :TEXT_ERROR_INVALID_DATE Ongeldige datum. . :TEXT_ERROR_INVALID_TIME Ongeldige tijd. . :TEXT_ERROR_NO_GOTO_LABEL Geen label opgegeven voor opdracht GOTO. . :TEXT_CTTY_NOTIMPLEMENTED De CTTY opdracht is uit deze versie van COMMAND.COM weggelaten. . :TEXT_ERROR_NORW_DEVICE Apparaat '%s' is een ongeldig of niet leesbaar/schrijfbaar apparaat. . :TEXT_ERROR_CTTY_DUP Het veranden van de bestandsbeschrijvingen naar TTY '%s' is mislukt. . :TEXT_ERROR_L_NOTIMPLEMENTED /L is nog niet geimplementeerd. . :TEXT_ERROR_U_NOTIMPLEMENTED /U is nog niet geimplementeerd. . :TEXT_ERROR_WRITING_DEST Fout bij het schrijven naar de bestemming. . :TEXT_ERROR_CANNOT_OPEN_SOURCE Niet in staat om de bron te openen. - '%s' . :TEXT_ERROR_OPEN_FILE Niet in staat om bestand '%s' te openen . :TEXT_ERROR_READ_FILE Niet in staat om te lezen van bestand '%s' . :TEXT_ERROR_WRITE_FILE Niet in staat om te schrijven naar bestand '%s' . :TEXT_ERROR_LEADING_PLUS Het concatenatieteken '+' kan niet geplaatst worden voor de argumenten. . :TEXT_ERROR_TRAILING_PLUS Het concatenatie teken '+' kan niet achter de argumenten geplaatst worden. . :TEXT_ERROR_NOTHING_TO_DO Er valt niets te doen. . :TEXT_ERROR_COPY Kopieren is mislukt . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: ontbrekende bestandsnaam . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: ontbrekend getal . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: ongeldig nummer . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: uit te voeren opdracht ontbreekt . :TEXT_NOT_IMPLEMENTED_YET Sorry...nog niet geimplementeerd. . :TEXT_FAILED_LOAD_STRINGS Het laden van de berichten in het systeemgeheugen is mislukt. . :TEXT_MSG_NOTIMPLEMENTED De /MSG optie is weggelaten uit deze COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1 %u items weergegeven. . :TEXT_CORRUPT_COMMAND_LINE Corrupte opdrachtregel. Dit is een interne fout en heeft te maken met het systeem waarop COMMAND.COM draait. Rapporteer deze fout alstublieft. . :TEXT_QUOTED_C_OR_K#1 De /C en /K opties kunnen niet gequote worden, en worden genegeerd. . :TEXT_INIT_FULLY_QUALIFIED#1 Het pad naar COMMAND.COM dient volledig opgegeven te worden! Dat betekent inclusief schijfletter en beginnend met een backslash. Bijvoorbeeld: C:\\FDOS COMMAND.COM veronderstelt nu als pad: %s . :TEXT_ERROR_RESTORE_SESSION De sessie-informatie kon niet hersteld worden, en alle lokale instellingen zijn verloren gegaan. Kijk alstublieft bij bovenstaande foutberichten voor de oorzaak van dit probleem. . :TEXT_ERROR_SAVE_SESSION De huidige gegevens konden niet behouden blijven gedurende de aanroep van het programma. Kijk alstublieft bij bovenstaande foutberichten voor de oorzaak van dit probleem. . :TEXT_ERROR_CWD_FAILED Schijf %c: reageert niet, of er is een gebrek aan intern geheugen. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swappen mislukt: Aliassen hebben teveel geheugenruimte toegewezen gekregen. . :TEXT_ERROR_KSWAP_ALLOCMEM Swappen mislukt: Kan geen ver/afgelegen geheugen toewijzen. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Geen ALIAS ruimte meer. . :TEXT_ERROR_ALIAS_NO_SUCH#1 Geen dergelijke alias aanwezig: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Toevoegen van alias is mislukt. . :TEXT_ALIAS_INVALID_NAME#1 Ongeldige aliasnaam '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Kan Context module of Kritieke Fouten afhandeling niet laden. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Context geheugentekort. Als u deze fout blijft houden, overweeg dan om een interne buffer, zoals geschiedenis, directory stack, etc te verhogen. . :TEXT_ERROR_CONTEXT_LENGTH#1 Grootte van context is in totaal %lu bytes en overschrijdt de maximale limiet. Context wordt aangepast tot %u bytes. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 De poging om status-informatie aan de context toe te voegen is mislukt. Deze fout kan geheugencorruptie of een onjuist vastgestelde minimumgrootte van de context aangeven. Informeer alstublieft de beheerder van FreeCOM op: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 De context ontbreekt na swap. De context wordt opnieuw aangemaakt, maar alle aliassen en dergelijke gaan hierbij verloren. . # # Informational messages # :TEXT_MSG_PAUSE#1 Druk op een toets zoals bv spatie om door te gaan . . .\ . :TEXT_MSG_HISTORY_SIZE Geschiedenis grootte is %d bytes. . :TEXT_MSG_DOSKEY DOSKEY mogelijkheden zijn al in werking in de schil. . :TEXT_MSG_ECHO_STATE ECHO staat ingesteld op %s . :TEXT_MSG_VERIFY_STATE VERIFY staat ingesteld op %s . :TEXT_MSG_FDDEBUG_STATE DEBUG uitvoer staat ingesteld op %s. . :TEXT_MSG_FDDEBUG_TARGET DEBUG uitvoer wordt geprint naar '%s'. . :TEXT_MSG_BREAK_STATE BREAK staat ingesteld op %s . :TEXT_MSG_CURRENT_DATE De huidige datum is %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Geef nieuwe datum op (mm%sdd%sjjjj): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Geef nieuwe datum op (dd%smm%sjjjj): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Geef nieuwe datum op (jjjj%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME Het is nu %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Geef nieuwe tijd op: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 JjNn{CR}{LF}{CBREAK} aabb b b b Alle bestanden in '%s' zullen worden verwijderd! Weet u dit zeker (J/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 JjNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Ja=ENTER, Nee=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 JjNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break of Control-C ingedrukt.\r Wilt u batchbestand '%s' be-eindigen (Ja/Nee/Alles) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 JjNnAaSs{BREAK}{ENTER}{ESC} aabbccdd d a b Wilt u '%s' overschrijven (Ja/Nee/Alles/Stoppen) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 JjNnAaSs{BREAK}{ENTER}{ESC} aabbccdd d a b Bestand '%s' verwijderen (Ja/Nee/Alles/Stoppen) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Directory stack leeg. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 Volume van drive %c \ . :TEXT_DIR_HDR_VOLUME_STRING is %s . :TEXT_DIR_HDR_VOLUME_NONE heeft geen label . :TEXT_DIR_HDR_SERIAL_NUMBER Volume Serienummer is %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s bestand(en)\ . :TEXT_DIR_FTR_BYTES %12s bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Totaal aantal genoemde bestanden: . :TEXT_DIR_FTR_DIRS#1 %10s dir(s)\ . :TEXT_DIR_FTR_BYTES_FREE %15s bytes vrij . :TEXT_DIR_DIRECTORY Directory van %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Directory van %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH PATH=%s . :TEXT_MSG_PATH_NONE#1 Geen zoekpad gedefinieerd. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Zo\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Ma\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Di\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Woe\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Do\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Vr\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Za\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 geen bestand verwijderd. . :TEXT_MSG_DEL_CNT_FILES_1#1 Een bestand verwijderd. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u bestanden verwijderen. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Interne beschikbare opdrachten: . :TEXT_MSG_SHOWCMD_FEATURES Beschikbare voorzieningen: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliassen] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [uitgebreide invoer] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [geschiedenis] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [bestandsnaam aanvulling] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [swapping] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start loggen] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [laatste directory] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS swap] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [default to swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [installeerbare commando's] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [directory stack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM debugging] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Druk op F8 voor traceermodus, of op F5 om %s te omzeilen... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC '%s' wordt omzeild. . :TEXT_MSG_VER_DOS_VERSION DOS versie %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS kernel (bouwversie 1933 of eerder) . :TEXT_MSG_VER_LATER_FREEDOS FreeDOS kernel versie %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman en anderen. Dit programma wordt verspreid in de hoop dat het bruikbaar zal zijn, maar ZONDER ENIGE GARANTIE; zelfs zonder de veronderstelde garantie op MERCHANTABILITY of BRUIKBAARHEID VOOR EEN BEPAALDE DOEL(STELLING). Raadpleeg de GNU General Public License (GPL) voor meer details hierover. Stuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net. Nieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman en anderen. Dit programma is vrije programmatuur; u kunt het herverpreiden en/of wijzigen met inachtneming van de voorwaarden van de GNU General Public License zoals die beschikbaar wordt gesteld door de Free Software Foundation; of versie 2 van de Licentie, of (zo u wilt) enige latere versie. Stuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net. Nieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS De FreeDOS opdrachtverwerker is ontwikkeld door vele ontwikkelaars, zie het bijgevoegde HISTORY.TXT bestand. Stuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net. Nieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r De opdrachtverwerker staat op het punt beeindigd te worden, ook al\r is dit niet toegestaan (meestal door de "/P" optie te gebruiken).\r U dient het systeem te herstarten, of, als deze schil draait in een\r multitasking omgeving, dit proces/deze taak handmatig te beeindigen.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM uitvoerbaar bestand niet gevonden. U dient het complete pad naar COMMAND.COM op te geven als eerste argument van COMMAND.COM, bijvoorbeeld: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1 Omgevings-segment : max %5u bytes; beschikbaar %5u bytes . :TEXT_MEMORY_CONTEXT#1 Context segment : max %5u bytes; beschikbaar %5u bytes . :TEXT_MEMORY_HEAP#1 Heap : beschikbaar %5lu bytes . :TEXT_MEMORY_CTXT_ALIAS#1 \tAliassen : limiet %5u bytes, huidig %5u bytes, %5u items . :TEXT_MEMORY_CTXT_HISTORY#1 \tHistory : limiet %5u bytes, huidig %5u bytes, %5u items . :TEXT_MEMORY_CTXT_DIRSTACK#1 \tDirectory stack: limiet %5u bytes, huidig %5u bytes, %5u items . :TEXT_MEMORY_CTXT_LASTDIR#1 \tLaatste directory cache : gebruikt %5u bytes, %5u items . :TEXT_MEMORY_CTXT_BATCH#1 \tBatch nesten : gebruikt %5u bytes, %5u items . :TEXT_MEMORY_CTXT_SWAPINFO#1 \tSwapinfo : gebruikt %5u bytes, %5u items . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Het opvragen van de huidige codepagina is niet gelukt. . :TEXT_ERROR_SET_CODEPAGE#1 Het veranderen van de huidige codepagina is niet gelukt. . :TEXT_DISPLAY_CODEPAGE#1 De huidige codepagina is %u. De (correcte) systeem-codepagina is: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Toont, maakt, of verwijdert aliassen. ALIAS [variabele[=][tekenreeks]] variabele is de te gebruiken alias-naam. tekenreeks een aantal op te geven letters die toegewezen worden aan de alias. Typ ALIAS zonder parameters om de huidige aliassen te tonen. . :TEXT_CMDHELP_BEEP Maak een klikgeluid. . :TEXT_CMDHELP_BREAK Zet uitgebreide CTRL+C controle aan of uit. BREAK [ON | OFF] Typ BREAK zonder parameters om de huidige instelling te tonen. . :TEXT_CMDHELP_CALL#1 Roept tijdelijk een batchprogramma vanuit een ander batchprogramma aan. CALL [/S | /N] [drive:][pad]bestandsnaam [batch-parameters] batch-parameters Duidt mogelijke opdrachtregel-informatie aan die het batchprogramma kan vereisen. /S forceert, /N weigert het swappen van FreeCOM. . :TEXT_CMDHELP_CD Toont de naam van de huidige directory of verandert deze. CHDIR [drive:][pad] CHDIR[..] CD [drive:][pad] CD[..] CD - .. Duidt aan dat u naar de bovenliggende directory wilt gaan. - springt, indien "laatste directory" optie is aangezet, naar de laatst onthouden directory. Typ CD drive: om de huidige directory in de opgegeven schijf weer te geven. Typ CD zonder parameters om de huidige schijf en directory weer te geven. Zie ook: CDD . :TEXT_CMDHELP_CDD Toont de naam van de huidige schijf en directory of verandert deze. CDD [drive:][pad] CDD[..] .. Geeft aan dat u naar de bovenliggende directory wilt gaan. - springt, indien "laaatste directory" optie is aangezet, naar de laatste onthouden directory. Indien drive: opgegeven is, wordt de huidige werkdirectory veranderd; dit is het enige waarmee "CDD" zich onderscheidt van "CHDIR". Typ CDD zonder parameters om de huidige schijf en directory weer te geven. . :TEXT_CMDHELP_CHCP Geeft het nummer van de actieve codepagina weer of verandert deze. CHCP [nnn] nnn Duidt het nummer van een codepagina aan. Typ CHCP zonder parameter om het nummer van de actieve codepagina te tonen. . :TEXT_CMDHELP_CLS Wist de scherminhoud. CLS . :TEXT_CMDHELP_COMMAND Start een nieuwe kopie van de FreeDOS opdrachtschil. COMMAND [[drive:]pad] [apparaat] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] opdracht]] [drive:]pad Duidt de directory aan waarin COMMAND.COM zich bevindt. device Duidt het voor in- en uitvoer te gebruiken apparaat aan. /E:nnnnn Stelt de aanvankelijke omgevingsgrootte in op nnnnn bytes. (nnnnn dient een waarde tussen 256 en 32.768 te zijn). /L:nnnn Duidt de interne bufferlengte aan (vereist eveneens /P ). (nnnn dient te liggen tussen 128 en 1.024). /U:nnn Duidt de invoer-bufferlengte aan (vereist ook /P ). (nnn dient te liggen tussen 128 and 255). /P Maakt de nieuwe opdrachtschil permanent (niet te verlaten). /MSG Bewaart alle foutmeldingen in het systeemgeheugen (vereist /P). /LOW Forceert plaatsing van residente data in het lage geheugen. /Y Stapt per regel door het mbv /C or /K opgegeven batbestand. /C opdracht Voert de opgegeven opdracht uit en komt weer terug. /K opdracht Voert de opgegeven opdracht uit en blijft draaien. . :TEXT_CMDHELP_COPY Kopieert een of meer bestanden naar een andere locatie. COPY [/A | /B] bron [/A | /B] [+ bron [/A | /B] [+ ...]] [bestemming [/A | /B]] [/V] [/Y | /-Y] bron Duidt de te kopieren bestand(en) aan. /A Geeft een ASCII tekstbestand aan. /B Geeft een binair bestand aan. bestemming Duidt de bestemming en/of naam aan voor het nieuwe bestand(en). /V Verifieert dat bestanden wel juist geschreven zijn. /Y Onderdrukt het vragen naar of u een bestaand (bestemmings-) bestand wilt overschrijven door uw kopieeractie. /-Y Vraagt of u het doelbestand wilt overschrijven De schakeloptie /Y mag alvast ingesteld worden in de COPYCMD omgevings- variabele. Dit kan genegeerd worden door /-Y op de opdrachtregel. Geef, om bestanden achter elkaar te plakken (laatste bestand achteraan), slechts een bestemmingsbestand op, maar meerdere bestanden als bron (gebruikmakend van jokertekens of bestand1+bestand2+bestand3 formaat). . :TEXT_CMDHELP_CTTY Verandert het terminal apparaat dat gebruikt wordt om uw pc te bedienen. CTTY apparaat apparaat Het te gebruiken terminal apparaat, zoals bijvoorbeeld COM1. . :TEXT_CMDHELP_DATE#1 Toont de datum of stelt deze in. DATE [/D] [datum] Typ DATE zonder parameters om de huidige datum weer te geven en te vragen om een nieuwe. Druk op ENTER om de huidig ingestelde datum te behouden. /D voorkomt dat DATE u vraagt om een nieuwe datum op te geven. . :TEXT_CMDHELP_DEL#2 Verwijdert een of meer bestanden. DEL [drive:][pad]bestandsnaam [/P] ERASE [drive:][pad]bestandsnaam [/P] [drive:][pad]bestandnaam Duidt de te verwijderen bestand(en) aan. Geef meer bestanden op door jokertekens (*, ?) te gebruiken. /P Vraagt u steeds om bevestiging alvorens elk bestand afzonderlijk te verwijderen. /V Toont alle verwijderde bestanden . :TEXT_CMDHELP_DIR#4 Toont een lijst van bestanden en directories in een directory. DIR [drive:][pad][bestandsnaam] [/P] [/W] [/A[[:]attributen]] [/O[[:]sorteervolgorde]] [/S] [/B] [/L] [drive:][pad][bestandsnaam] Duidt de weer te geven schijf, directorie, en/of bestanden aan. (Kan uitgebreide bestandskeuze zijn of opgave meerdere bestanden.) /P Pauzeert na ieder volgeschreven scherm met informatie. /W Gebruikt het brede-lijst formaat. /A Toont bestanden met de door u opgegeven kenmerken. (standaard /ADHSRA) attributen D Directories R Alleen-lezen bestanden H Verborgen bestanden A Archiveringsbestanden S Systeembestanden - Voorkomt tonen op basis van het opgegeven attribuut /O Geef bestanden weer op gesorteerde volgorde sortorder N Op naam (alphabetisch) S Op grootte (smalste eerst) E Op extensie (alphabetisch) D Op datum en tijd (vroegste 1st) G Directories eerst groeperen - Prefix v. omgekeerde volgorde U Ongesorteerde Standaard /ONG /S Toont bestanden in de opgegeven en onderliggende directories /B Gebruik gestript formaat (geen extra informatie of opsomming). /L Toon bestandsnamen in kleine letters. /Y of /4 Geeft het jaartal viercijferig weer. Schakelopties mogen vooraf ingesteld worden in de DIRCMD omgevingsvariabele. Negeer deze vooraf ingestelde schakelopties door een optie te voorzien van een - (streepje) -- bijvoorbeeld /-W of /-P . :TEXT_CMDHELP_DOSKEY#1 Het losse programma DOSKEY zit ingebouwd in FreeCOM. Gebruik de pijltoetsen OMHOOG en OMLAAG om de geschiedenis terug te roepen en HISTORY om deze weer te geven. Gebruik de pijltoetsen LINKS en RECHTS en de toetsen END en HOME om te navigeren binnen de opdrachtregel en gebruik INSERT om te schakelen tussen de invoeg- en de overschrijfmodus(standaard). Gebruikt de TAB toets om het huidige woord als bestandsnaam aan te vullen; gebruik het tweemaal om alle gevonden bestanden te tonen. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Bewerkt opdrachtregels, roept opdrachtregels terug, en maakt macro's aan DOSKEY [/schakeloptie ...] [macronaam=[tekst]] /BUFSIZE:grootte Stelt grootte van macro en opdrachtbuffer in (standaard:512) /ECHO:on|off Stelt weergave van macro-expansie in of uit (default:ON) /FILE:bestand Duidt bestand met lijst van macro's aan /HISTORY Toont alle in geheugen opgeslagen opdrachten /INSERT Voegt nieuwe tekens tussen woorden in bij typen /KEYSIZE:grootte Bepaalt grootte v keyboard type-ahead buffer (standaard:15) /LINE:grootte Bepaalt max grootte van regelbewerkinsbuffer (standaard:128) /MACROS Geeft alle DOSKey macro's weer /OVERSTRIKE Overschrijft nieuwe tekens bij het typen (standaard) /REINSTALL Installeert een nieuwe kopie van DOSKey macronaam Duidt de voor de macro te gebruiken naam aan tekst Duidt de aan de macro toe te wijzen opdrachten aan OMHOOG,OMLAAG pijlen roepen opdrachten terug Esc wist het huidige commando F7 toont de lijst van reeds gegeven opdrachten Alt+F7 wist de hierboven genoemde opdrachtgeschiedenis [tekens]F8 zoekt naar opdrachten beginnend met [tekens] F9 selecteert een opdracht op geschiedenisnummer Alt+F10 wist alle macro definities De volgende tekens zijn speciale codes die u kunt gebruiken bij het opgeven van DOSKey macro definities: $T Opdracht-scheiding: staat meerder opdrachten in een regel toe $1-$9 Batch parameters: equivalent van %1-%9 in batch programma's $* Symbool dat vervangen wordt door alle volgende aan de macro opgegeven parameters op de opdrachtregel . :TEXT_CMDHELP_ECHO Geeft berichten weer, of zet opdracht-echo aan of uit. ECHO [ON | OFF] ECHO [bericht] Typ ECHO zonder parameters om de huidige instelling te laten zien. . :TEXT_CMDHELP_EXIT Stopt de FreeDOS opdrachtverwerkings-schil. EXIT . :TEXT_CMDHELP_FOR Voert de opgegeven opdracht uit voor elk bestand in een verzameling bestanden FOR %%variabele IN (verzameling) DO opdracht [opdrachtparameters] %%variabele Duidt een vervangbare parameter aan. (set) Duidt een verzameling bestanden aan(1+). Jokertekens toegestaan opdracht Voert de op elk bestand uit te voeren opdracht uit. opdrachtparameters Duidt parameters of schakelopties voor de opgegeven opdracht aan Om de opdracht FOR te gebruiken in een batchprogramma, moet u %%%%variabele opgeven in plaats van %%variable. . :TEXT_CMDHELP_GOTO Stuurt de opdrachtverwerker naar een gelabelde regel in een batchprogramma. GOTO label label Duidt een tekenreeks aan welke als label wordt gebruikt Een label is een woord op een regel voorafgegaan door een dubbele punt (":"). . :TEXT_CMDHELP_HISTORY#1 History opdracht. HISTORY [grootte] Zonder "grootte" wordt de huidige inhoud van de opdrachtregelhistorie- buffer weergegeven. Als grootte is aangegeven, wordt de historiebuffer op deze waarde ingesteld. . :TEXT_CMDHELP_IF Voert conditionele verwerking uit binnen batchprogramma's. IF [NOT] ERRORLEVEL nummer opdracht IF [NOT] reeks1==reeks2 opdracht IF [NOT] EXIST bestandsnaam opdracht NOT Geeft aan dat de opdrachtverwerker de opdracht alleen mag uit voeren als de voorwaarde vals/ongeldig is. ERRORLEVEL getal Duidt een bepaalde conditie aan als het laatst uitgevoerde programma een afsluitwaarde retourneert groter dan of gelijk aan het opgegeven getal. opdracht Duidt de uit te voeren opdracht uit indien aan de voorwaarde wordt voldaan. reeks1==reeks2 Duidt een geldige voorwaarde aan als de opgegeven tekenreeksen overeenkomen. EXIST bestandnaam Duidt een geldige voorwaarde aan als het opgegeven bestand bestaat. . :TEXT_CMDHELP_LH Laadt een programma in het upper memory area. LOADHIGH [drive:][pad]bestandsnaam [parameters] LOADHIGH [/L:gebied1[,mingrootte1][;regio2[,mingrootte2]...] [/S]] [drive:][pad]bestandsnaam [parameters] /L:regio1[,mingrootte1][;regio2[,mingrootte2]]... Duidt de geheugengebieden aan waarin u een programma wilt laden. Regio1 duidt het nummer van het eerste geheugengebied aan mingrootte1 duidt de minimale grootte, indien enige, voor regio1. aan. Regio2 en mingrootte2 duiden het nummer en minimale grootte van het tweede geheugengebied aan, indien opgegeven. U kunt zoveel gebieden opgeven als u wilt. /S Dwingt een UMB te krimpen naar minimale grootte terwijl het programma aan het laden is. [drive:][pad]bestandsnaam Duidt de locatie en naam van het programma aan . :TEXT_CMDHELP_LOADFIX Laadt een programma boven de eerste 64K geheugen, en voert het programma uit. LOADFIX [drive:][pad]bestandsnaam Gebruik LOADFIX om een programma te laden indien u het bericht "Packed file corrupt" hebt gekregen terwijl u het programma poogde te laden in het lage systeemgeheugen. . :TEXT_CMDHELP_MD Maakt een directory. MKDIR [drive:]pad MD [drive:]pad . :TEXT_CMDHELP_PATH Toont of stelt het zoekpad voor uitvoerbare bestanden in. PATH [[drive:]pad[;...]] PATH ; Typ PATH ; om alle zoekpad instellingen te wissen en om de opdrachtschil te dwingen alleen te zoeken in de huidige directory. Typ PATH zonder parameters om het huidige pad weer te geven. . :TEXT_CMDHELP_PAUSE Onderbreekt het verwerken van een batchprogramma tijdelijk en toont het bericht: "Druk op een toets om door te gaan...." of een eigen melding. PAUSE [bericht] . :TEXT_CMDHELP_PROMPT Wijzigt de opdracht prompt . PROMPT [tekst] tekst De te gebruiken nieuwe opdrachtprompt. Prompt kan worden opgebouwd uit gewonen tekens en de volgende speciale codes: $Q = (is-teken) $$ $ (dollar teken) $T Huidige tijd $D Huidige datum $P Huidige schijf en pad $V Het versienummer van de FreeDOS opdrachtverwerker $N Huidige schijf(-letter) $G > (groter-dan teken) $L < (kleiner-dan teken) $B | (pijpsymbool) $H Backspace (wist vorige teken) $E Escape code (ASCII code 27) $_ Carriage return en linefeed Typ alleen PROMPT om de prompt in te stellen op de standaardinstellingen. . :TEXT_CMDHELP_PUSHD Gooit de huidige directorie op de directory stack, met de optie om de huidige werkdirectory te wijzigen. PUSHD [[drive:]pad] Waarbij [drive:]pad het pad waarna u wilt overschakelen is. . :TEXT_CMDHELP_POPD Gooit een directory van de directory stack, en schakelt ernaar over. POPD [*] De '*' parameter maakt de directory stack leeg. . :TEXT_CMDHELP_DIRS Toont de inhoud van de directory stack. DIRS . :TEXT_CMDHELP_RD Verwijdert een directory. RMDIR [drive:]pad RD [drive:]pad . :TEXT_CMDHELP_REM Legt commentaarberichten (opmerkingen) vast in een batchbestand of CONFIG.SYS REM [commentaarbericht] . :TEXT_CMDHELP_REN Hernoemt een bestand/directory of bestanden/directories. RENAME [drive:][pad][dirnaam1 | bestandnaam1] [directorynaam2 | bestandnaam2] REN [drive:][pad][dirnaam1 | bestandnaam1] [directorynaam2 | bestandnaam2] Merk op dat u geen nieuwe schijf of pad als bestemming kunt opgeven. Gebruik voor dat doeleinde de opdracht MOVE. . :TEXT_CMDHELP_SET#1 Toont, stelt in, of verwijdert omgevingsvariabelen. SET [/C] [variabele=[tekenreeks]] variabele Duidt de naam van de omgevingsvariabele aan. tekenreeks Een reeks karakters die u toewijst aan de variabele. * Als geen tekenreeks wordt opgegeven wordt de variabele gewist. Typ SET zonder parameters om de huidige omgevingsvariabelen weer te geven. /C dwingt om kleine letters te behouden; standaard wordt de naam van de variabele naar hoofdletters omgezet indien nog niet in de omgevingsruimte aanwezig. . :TEXT_CMDHELP_SHIFT#1 Verandert de positie van vervangbare parameters in een batchbestand. SHIFT [DOWN] DOWN schuift de argumenten volgorde vanaf het begin (%%0); anders naar het einde. . :TEXT_CMDHELP_TIME#1 Geeft de huidige tijd aan of stelt deze in. TIME [/T] [tijd] Typ TIME zonder parameters om de huidige tijd op te geven en om te vragen naar een nieuwe tijd. Druk op ENTER om dezelfde tijd te behouden. /T voorkomt dat TIME u vraagt een nieuwe tijd op te geven. . :TEXT_CMDHELP_TRUENAME Geeft de volledige padnaam weer van het opgegeven pad. TRUENAME [drive:][pad][bestandsnaam] . :TEXT_CMDHELP_TYPE Toont de inhoud van een tekstbestand. TYPE [drive:][pad]bestandsnaam . :TEXT_CMDHELP_VER Toont de versie van de FreeDOS opdrachtverwerker en andere informatie. VER [/R] [/W] [/D] [/C] /R Toont kernel versie en andere informatie. /W FreeDOS opdrachtverwerker garantiebepalingen. /D FreeDOS opdrachtverwerker verspreidingsinformatie. /C FreeDOS opdrachtverwerker medewerkers. . :TEXT_CMDHELP_VERIFY Vertelt het FreeDOS bestandssysteem of er uitgebreid gecontroleerd dient te worden of bestanden juist naar schijf zijn geschreven. VERIFY [ON | OFF] Typ VERIFY zonder parameters om de huidige instelling te tonen. . :TEXT_CMDHELP_FDDEBUG Als debuggen is gecompileerd binnen FreeDOS zal deze opdracht debug uitvoer aan of uitzetten, of u vertellen of deze aan of uit staat. FDDEBUG [ON | OFF | bestand] Typ FDDEBUG zonder parameters om de huidige instelling te zien. Als een bestand wordt opgegeven zal alle uitvoer naar dat bestand gestuurd worden; Als het bestand al bestaat, wordt de uitvoer eraan toegevoegd. De speciale namen "stdout" en "stderr" mogen gebruikt worden om de uitvoer te verwijzen naar de standaard uitvoer of standaard foutmeldingsstroom. . :TEXT_CMDHELP_VOL Toont het schijf volume label en serienummer indien deze bestaan. VOL [schijf:] . :TEXT_CMDHELP_QUESTION#1 Toont een lijst van opdrachten en voorzieningen beschikbaar binnenin de schil ? ?opdracht [argument] De eerste variant toont elke beschikbare interne opdracht en voorzieningen. De tweede zal u vragen of een opgegeven opdracht al dan niet moet worden uitgevoerd, net zoals dat gebeurt als traceer-modus actief is. . :TEXT_CMDHELP_WHICH Zoekt en toont het uitvoerbare bestand voor elke opgegeven opdracht. WHICH {opdracht} . :TEXT_CMDHELP_MEMORY#1 Geeft het binnen FreeCOM gebruikte interne systeemgeheugen aan MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 De eindbestemming van COPY mag geen plus-tekens ('+') bevatten. . :TEXT_DELETE_FILE#1 Bezig met verwijderen van bestand "%s". . ================================================ FILE: strings/english.err ================================================ # Dummy file as the English language is the default # However, can be used to include non-7bit-ASCII characters forbidden # in DEFAULT.err ================================================ FILE: strings/english.lng ================================================ # Dummy file as the English language is the default # However, can be used to include non-7bit-ASCII characters forbidden # in DEFAULT.lng ================================================ FILE: strings/finnish.err ================================================ # $Id$ # # Critical error national customization file # # Language: Finnish # Codepage: 850 # Author: Sampo Hippelinen # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Virhe %1 aseman %A: %2aluetta: %3 S3 CHAR_DEVICE: Virhe %1 laitetta %A: %3 ## kind of operation S0 READ: lukiessa S1 WRITE: kirjoittaessa ## kind of failed area of block devices S4 DOS: DOS- S5 FAT: FAT- S6 ROOT: juuri S7 DATA: tieto ## action strings S8 IGNORE: (O)hitus S9 RETRY: (U)usinta S10 ABORT: (L)opetus S11 FAIL: (V)irhe ## keys associated with the actions S14 (compacted) KEYS_IGNORE: oO KEYS_RETRY: uU KEYS_ABORT: lL KEYS_FAIL: vV ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Tuntematon virhekoodi S15 0: kirjoitussuojausvirhe 1: ajuri ei tunnista yksikk 2: asema ei valmis 3: ajuri ei tunnista komentoa 4: tietovirhe (CRC) 5: virheellinen laiteajuripyynttietueen koko 6: hakuvirhe 7: tunnistamaton tietovline 8: sektoria ei lydy 9: tulostimen paperi loppu 10: kirjoitusvirhe 11: lukuvirhe 12: yleinen virhe 13: yhteiskyttvirhe 14: lukitusvirhe 15: vr levynvaihto 16: tiedoston ohjauslohko ei kytettviss 17: yhteiskyttpuskurin ylivuoto 18: koodisivut eivt tsm 19: syte loppu 20: levytila ei riit ================================================ FILE: strings/finnish.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Finnish # Codepage: 850 # Author: Sampo Hippelinen # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #KkEe\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Virheellinen valitsin. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Virheellinen valitsin. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Vrnmuotoinen valitsin: '%s' . :TEXT_ERROR_OPT_ARG#0% Valitsimella '%s' ei kuulu olla argumenttia . :TEXT_ERROR_OPT_NOARG#0% Valitsimella '%s' pit olla argumentti . :TEXT_INVALID_NUMBER#0% Virheellinen luku valitsimelle '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Puuttuva loppulainausmerkki: %c . :TEXT_ERROR_TEMPFILE Vliaikaistiedoston luonti eponnistui . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Liikaa parametreja. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Liikaa parametreja. . :TEXT_ERROR_INVALID_PARAMETER#0% Virheellinen parametri. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Polkua ei lydy. . :TEXT_ERROR_FILE_NOT_FOUND Tiedostoa ei lydy. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Tiedostoa ei lydy. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Vaadittu parametri puuttuu. . :TEXT_ERROR_INVALID_DRIVE#0% Virheellinen asema %c:. . :TEXT_ERROR_BADCOMMAND#2% Komento tai tiedostonimi tuntematon - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Muisti loppu. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 DOS-muistin varausvirhe. . :TEXT_ERROR_CANNOTPIPE Putkivirhe! Vliaikaistiedoston avaus eponnistui! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Rivi #%ld komentojonossa '%s' liian pitk. . :TEXT_ERROR_BFILE_VANISHED#0% Komentojonoa '%s' ei lydy. . :TEXT_ERROR_BFILE_LABEL#0% Komentojonossa '%s' ei ole nimit '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s '%s' eponnistui. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Ei voitu asettaa ympristmuuttujaa '%s'. Ymprist tynn? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Ympristmuuttujaa '%s' ei lydy. . :TEXT_ERROR_NO_ENVIRONMENT Ymprist puuttuu. Muisti ehk vhiss. Kyt /E-valitsinta. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Aliasta '%s' ei voitu asettaa. Aliastila tynn? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Aliasta '%s' ei lydy. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Ei aliastilaa. Muisti ehk vhiss. . :TEXT_ERROR_SYNTAX_STR#0% Syntaksivirhe. - '%s' . :TEXT_ERROR_SYNTAX Syntaksivirhe. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Tiedostonimi liian pitk. - '%s' . :TEXT_ERROR_SELFCOPY#0% Ei voi kopioida '%s' itseens . :TEXT_ERROR_COMMAND_TOO_LONG Komentorivi liian pitk aliaslaajennuksineen! . :TEXT_ERROR_LINE_TOO_LONG Komentorivi yli 125 merkki pitk. . :TEXT_ERROR_HISTORY_SIZE#1% Historian koko '%s' virheellinen. . :TEXT_HISTORY_EMPTY#1 Komentorivihistoria tyhj. . :TEXT_ERROR_BAD_MCB_CHAIN Muistin ohjauslohkoketju virheellinen tai MS-DOS ei yhteensopiva. . :TEXT_ERROR_UNDEFINED_ERROR#0% Tuntematon virhe %d. . :TEXT_ERROR_REGION_WARNING#0% Muistialue %d virheellinen - ohitetaan. . :TEXT_ERROR_ON_OR_OFF Tytyy olla ON tai OFF. . :TEXT_ERROR_BAD_VARIABLE Virheellinen muuttujan mrittely. . :TEXT_ERROR_IN_MISSING#1 FOR: IN puuttuu. . :TEXT_ERROR_MISSING_PARENTHESES#1 Sulku tai molemmat sulut puuttuu. . :TEXT_ERROR_DO_MISSING#1 FOR: DO puuttuu. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: komento puuttuu DO:n perst. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Sytett ei voi ohjata tiedostosta '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Tulostetta ei voi ohjata tiedostoon '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Tyhj ohjaus. . :TEXT_ERROR_INVALID_DATE Virheellinen pivmr. . :TEXT_ERROR_INVALID_TIME Virheellinen aika. . :TEXT_ERROR_NO_GOTO_LABEL GOTO:lle ei mritelty nimit. . :TEXT_CTTY_NOTIMPLEMENTED Tm COMMAND.COM ei tue CTTY-komentoa. . :TEXT_ERROR_NORW_DEVICE#0% Puuttuva tai virheellinen siirrntlaite '%s'. . :TEXT_ERROR_CTTY_DUP#0% Tiedostokuvaajia ei voitu muuttaa TTY-laitteelle '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L ei viel toteutettu. . :TEXT_ERROR_U_NOTIMPLEMENTED /U ei viel toteutettu. . :TEXT_ERROR_WRITING_DEST Kirjoitus kohteeseen eponnistui. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Lhteen avaus eponnistui. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Ei voitu avata tiedostoa '%s' . :TEXT_ERROR_READ_FILE#0% Ei voitu lukea tiedostosta '%s' . :TEXT_ERROR_WRITE_FILE#0% Ei voitu kirjoittaa tiedostoon '%s' . :TEXT_ERROR_LEADING_PLUS Yhdistysmerkki '+' ei voi olla argumenttien edell. . :TEXT_ERROR_TRAILING_PLUS Yhdistysmerkki '+' ei voi olla argumenttien perss. . :TEXT_ERROR_NOTHING_TO_DO Ei mitn tehtv. . :TEXT_ERROR_COPY COPY eponnistui . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: tiedostonimi puuttuu . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: luku puuttuu . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: luku virheellinen . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: komento puuttuu . :TEXT_NOT_IMPLEMENTED_YET Ei viel toteutettu... pahoittelemme. . :TEXT_FAILED_LOAD_STRINGS Ei voitu ladata viestej muistiin. . :TEXT_MSG_NOTIMPLEMENTED Tm COMMAND.COM ei toteuta /MSG-valitsinta. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u kohdetta. . :TEXT_CORRUPT_COMMAND_LINE Komentorivi vioittunut. Sisinen virhe, joka johtuu jrjestelmst, jolla COMMAND.COM:ia ajetaan. Ilmoita tst virheest, kiitos. . :TEXT_QUOTED_C_OR_K#1 /C ja /K -valitsimet eivt tue lainausmerkkej, ohitetaan. . :TEXT_INIT_FULLY_QUALIFIED#1% COMMAND.COM:in polku tulee olla kokonaan mritetty! Sen tulee sislt aseman kirjain ja alkaa kenoviivalla. Esimerkki: C:\\FDOS COMMAND.COM olettaa polun nyt olevan: %s . :TEXT_ERROR_RESTORE_SESSION Istuntotietoja ei voitu palauttaa. Paikalliset asetukset menetetn. Yll olevat virheviestit kuvaavat ongelmaa. . :TEXT_ERROR_SAVE_SESSION Nykyisi tietoja ei voida silytt ohjelmaa kutsuessa. Yll olevat virheviestit kuvaavat ongelmaa. . :TEXT_ERROR_CWD_FAILED#1% Asema %c: ei vastaa. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Heittovaihto eponnistui: aliakset vievt liikaa muistia. . :TEXT_ERROR_KSWAP_ALLOCMEM Heittovaihto eponnistui: etmuistin varaus eponnistui. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Aliastila loppu. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Ei aliasta: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Aliaksen lisys eponnistui. . :TEXT_ALIAS_INVALID_NAME#1% Aliaksen nimi '%s' virheellinen. . :TEXT_ERROR_LOADING_CONTEXT#1 Kontekstimoduulin tai virheenksittelijn latausvirhe. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Kontekstilta loppui muisti. Jos virhe toistuu, harkitse sisisen puskurin tilan kasvatusta, kuten historian, hakemistopinon, tms. . :TEXT_ERROR_CONTEXT_LENGTH#1% Kontekstin yhteiskoko %lu tavua ylitt enimmisrajan. Kooksi asetetaan %u tavua. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Tilatiedon lukeminen kontekstiin eponnistui. Virhe voi johtua muistin vioittumisesta tai kontekstin vhimmiskoon vrin mrittelyst. Ilmoitathan FreeCOM:n yllpitjlle: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Konteksti puuttuu heittovaihdon jlkeen. Se luodaan uudelleen, mutta aliakset ym. menetetn. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Psy evtty . :TEXT_ERROR_NO_SUCH_FILE#1% %s: Tiedostoa tai hakemistoa ei lydy . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Tuntematon virhe . # # Informational messages # :TEXT_MSG_PAUSE#1 Paina mit tahansa nppint jatkaaksesi . . .\ . :TEXT_MSG_HISTORY_SIZE#0% Historian koko %d tavua. . :TEXT_MSG_DOSKEY DOSKEY on jo kytss tss kehotteessa. . :TEXT_MSG_ECHO_STATE#0% ECHO on %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY on %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG-tuloste on %s. . :TEXT_MSG_FDDEBUG_TARGET#0% DEBUG-tuloste sijaintiin '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK on %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR on %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN-tydennys on %s . :TEXT_MSG_CURRENT_DATE#0% Pivmr nyt on %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Syt uusi pivmr (kk%spp%s[vv]vv): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Syt uusi pivmr (pp%skk%s[vv]vv): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Syt uusi pivmr ([vv]vv%skk%spp): \ . :TEXT_MSG_CURRENT_TIME#0% Aika nyt on %s . :TEXT_STRING_PM#1 ip.\ . :TEXT_STRING_AM#1 ap.\ . :TEXT_MSG_ENTER_TIME#1 Syt uusi aika: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (K/E) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% KkEe{CR}{LF}{CBREAK} aabb b b b Kaikki tiedostot sijainnissa '%s' poistetaan! Oletko varma (K/E)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 KkEe{LF}{CR}{CBREAK}{ESC} aabb a a b b [Kyll=ENTER, Ei=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% KkEeAaLl{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break painettu.\r Lopetetaanko komentojono '%s' (Kyll/Ei/kAikki) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% KkEeAaLl{BREAK}{ENTER}{ESC} aabbccdd d a b Korvataanko '%s' (Kyll/Ei/kAikki/Lopeta) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% KkEeAaLl{BREAK}{ENTER}{ESC} aabbccdd d a b Liitetnk tiedostoon '%s' (Kyll/Ei/kAikki/Lopeta) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% KkEeAaLl{BREAK}{ENTER}{ESC} aabbccdd d a b Poistetaanko '%s' (Kyll/Ei/kAikki/Lopeta) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Hakemistopino tyhj. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Taltio asemassa %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% on %s . :TEXT_DIR_HDR_VOLUME_NONE nimetn . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Taltion sarjanumero on %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s tiedosto(a)\ . :TEXT_DIR_FTR_BYTES#0% %12s tavua . :TEXT_DIR_FTR_TOTAL_NUMBER Yhteens lueteltu: . :TEXT_DIR_FTR_DIRS#1% %10s hakemisto(a)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s tavua vapaana . :TEXT_DIR_DIRECTORY#0% Hakemisto: %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Hakemisto: %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Hakupolkua ei mritelty. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 su\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 ma\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 ti\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 ke\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 to\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 pe\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 la\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 mitn ei poistettu. . :TEXT_MSG_DEL_CNT_FILES_1#1 yksi tiedosto poistettu. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u tiedostoa poistettu. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Saatavilla olevat sisiset komennot: . :TEXT_MSG_SHOWCMD_FEATURES Saatavilla olevat toiminnallisuudet: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliakset] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [paranneltu syte] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [historia] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [tiedostonimen tydennys] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [heittovaihto] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [kynnistysloki] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [viime hakemisto] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [pitkt tiedostonimet] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [ytimen heittovaihto] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS-heittovaihto] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [heittovaihto oletuksena] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [asennettavat komennot] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [hakemistopino (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM-virheenkorjaus] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 F8 kynnist jljitystilan, F5 ohittaa %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Ohitetaan '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS-versio %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS-ydin (koontiversio 1933 tai vanhempi) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS-ydin versio %d.%d.%d . :TEXT_MSG_VER_WARRANTY (C) 1994-2005 Tim Norman ja muut. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Vikailmoitukset (englanniksi) osoitteeseen freedos-devel@lists.sourceforge.net. Pivitykset osoitteesta http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION (C) 1994-2005 Tim Norman ja muut. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Vikailmoitukset (englanniksi) osoitteeseen freedos-devel@lists.sourceforge.net. Pivitykset osoitteesta http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS FreeDOS-komentokehotteella on ollut monta kehittj, ks. sisllytetty HISTORY.TXT-tiedosto. Vikailmoitukset (englanniksi) osoitteeseen freedos-devel@lists.sourceforge.net. Pivitykset osoitteesta http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Komentokehote on sulkeutumassa, mutta sen ei pitisi\r (yleens "/P"-valitsimen takia).\r Kynnist jrjestelm uudelleen, tai jos kehote on moniajo-\r ympristss, lopeta tm tehtv tai prosessi manuaalisesti.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM-ohjelmaa ei lydy. COMMAND.COM:n koko polku tulee mritt COMMAND:n ensimmiseksi argumentiksi, esimerkiksi: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Ympristsegmentti : maks. %5u tavua; vapaa %5u tavua . :TEXT_MEMORY_CONTEXT#1% Kontekstisegmentti : maks. %5u tavua; vapaa %5u tavua . :TEXT_MEMORY_HEAP#1% Keko : %5lu tavua vapaana . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliakset : raja %5u tavua, kytss %5u tavua, %5u kohdetta . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistoria : raja %5u tavua, kytss %5u tavua, %5u kohdetta . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tHakemistopino : raja %5u tavua, kytss %5u tavua, %5u kohdetta . :TEXT_MEMORY_CTXT_LASTDIR#1% \tViime hak. -VM : kyt. %5u tavua, %5u kohdetta . :TEXT_MEMORY_CTXT_BATCH#1% \tKJ-siskkisyys: kyt. %5u tavua, %5u kohdetta . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tHV-tiedot : kyt. %5u tavua, %5u kohdetta . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Nykyist koodisivua ei voitu mritt. . :TEXT_ERROR_SET_CODEPAGE#1 Koodisivua ei voitu vaihtaa. . :TEXT_DISPLAY_CODEPAGE#1% Nykyinen koodisivu on: %u. Jrjestelmn (oikea) koodisivu on: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Nytt, asettaa tai poistaa aliaksia. ALIAS [muuttuja[=][merkkijono]] muuttuja Mritt aliaksen nimen. merkkijono Mritt aliaksen merkkijonon. ALIAS ilman parametreja nytt nykyiset aliakset. . :TEXT_CMDHELP_BEEP Soittaa merkkinen. . :TEXT_CMDHELP_BREAK Ottaa kyttn tai poistaa kytst laajennetun Ctrl+C-tarkistuksen. BREAK [ON | OFF] BREAK ilman parametreja nytt nykyisen BREAK-tilan. . :TEXT_CMDHELP_CALL#1 Kutsuu komentojonoa toisesta komentojonosta. CALL [/S | /N] [/Y] [asema:][polku]tiedostonimi [parametrit] parametrit Mritt kutsuttavan komentojonon vaatimat komentojonoparametrit. /S pakottaa ja /N est FreeCOM:n heittovaihdon. /Y ottaa jljitystilan kyttn kutsutulle komentojonolle. . :TEXT_CMDHELP_CD Nytt nykyisen hakemiston nimen tai vaihtaa hakemistoa. CHDIR [asema:][polku] CHDIR[..] CD [asema:][polku] CD[..] CD - .. Siirtyy ylhakemistoon. - Jos "viime hakemisto" on kytss, vaihtaa viime hakemistoon. CD asema: nytt mritetyn aseman nykyisen hakemiston. CD ilman parametreja nytt nykyisen aseman ja hakemiston. Katso mys: CDD . :TEXT_CMDHELP_CDD Nytt nykyisen aseman sek hakemiston tai vaihtaa asemaa sek hakemistoa. CDD [asema:][polku] CDD[..] .. Siirtyy ylhakemistoon. - Jos "viime hakemisto" on kytss, vaihtaa viime hakemistoon. Jos asema: mritetn, nykyist asemaa vaihdetaan; tm on ainoa ero "CHDIR"-komentoon. CDD ilman parametreja nytt nykyisen aseman ja hakemiston. . :TEXT_CMDHELP_CHCP Nytt nykyisen koodisivun numeron tai vaihtaa koodisivua. CHCP [nnn] nnn Mritt koodisivun numeron. CHCP ilman parametreja nytt nykyisen koodisivun numeron. . :TEXT_CMDHELP_CLS Tyhjent kuvaruudun. CLS . :TEXT_CMDHELP_COMMAND Aloittaa uuden FreeDOS-komentokehotteen. COMMAND [[asema:]polku] [laite] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] komento]] [asema:]polku Mritt COMMAND.COM-ohjelman sisltvn hakemiston. laite Asettaa kytettvn syte- ja tulostelaitteen. /E:nnnnn Asettaa ympristn aloituskoon olemaan nnnnn tavua. (nnnnn on oltava 256 ja 32 768 vlilt). /L:nnnn Asettaa sisisen puskurin koon (vaatii /P-valitsimen). (nnnnn on oltava 128 ja 1 024 vlilt). /U:nnn Asettaa sytepuskurin koon (vaatii /P-valitsimen). (nnnnn on oltava 128 ja 255 vlilt). /P Tekee kehotteesta pysyvn (est lopettamisen). /MSG Sil virheviestit muistiin (vaatii /P-valitsimen). /LOW Pakottaa komentokehotteen pitmn tytietonsa alamuistissa. /Y Suorittaa /C tai /K-valitsimen komentojonon vaiheittain. /C komento Suorittaa annetun komennon ja lopettaa. /K komento Suorittaa annetun komennon ja jatkaa suoritusta. . :TEXT_CMDHELP_COPY Kopioi yhden tai useamman tiedoston eri sijaintiin. COPY [/A | /B] lhde [/A | /B] [+ lhde [/A | /B] [+ ...]] [kohde [/A | /B]] [/V] [/Y | /-Y] lhde Mritt kopioitavat tiedostot. /A Ilmaisee, ett kyseess on ASCII-tekstitiedosto. /B Ilmaisee, ett kyseess on binritiedosto. kohde Mritt tiedostojen uuden sijainnin ja/tai uudet nimet. /V Tarkistaa, ett tiedostot kirjoitetaan oikein. /Y Est korvauskehotteen ja korvaa kaikki jo olemassa olevat kohdetiedostot lhdetiedostoilla. /-Y Kysyy kehotteella jokaiselle tiedostolle erikseen, tulisiko jo olemassa oleva kohdetiedosto korvata. COPYCMD-ympristmuuttuja saattaa mritell /Y-valitsimen. Jos tm asetus halutaan ohittaa, kyt valitsinta /-Y. Jos haluat liitt tiedostoja yhteen, mrit kohteeksi yksi tiedosto ja lhteeksi useampi (yleismerkeill tai muodossa tiedosto1+tiedosto2+tiedosto3). . :TEXT_CMDHELP_CTTY Vaihtaa jrjestelm ohjaavaa ptelaitetta. CTTY laite laite Haluamasi ptelaite, kuten COM1. . :TEXT_CMDHELP_DATE#1 Nytt tai asettaa pivmrn. DATE [/D] [date] DATE ilman parametreja tuo nyttn nykyisen pivmrn ja kehotteen uudesta pivmrst. Paina ENTER pitksesi saman pivmrn. /D est komentoa esittmst kehotteita. . :TEXT_CMDHELP_DEL#2 Poistaa yhden tai useamman tiedoston. DEL [asema:][polku]tiedostonimi [/P] [/V] ERASE [asema:][polku]tiedostonimi [/P] [/V] [asema:][polku]tiedostonimi Mritt poistettavat tiedostot. Useamman tiedoston voi mritt yleismerkeill. /P Varmistaa kehotteella ennen jokaisen tiedoston poistoa. /V Nytt kaikki poistetut tiedostot. . :TEXT_CMDHELP_DIR#4 Nytt hakemistossa olevat tiedostot ja alihakemistot. DIR [asema:][polku][tiedostonimi] [/P] [/W] [/A[[:]mritteet]] [/O[[:]jrjestys]] [/S] [/B] [/L] [asema:][polku][tiedostonimi] Mritt aseman, hakemiston ja/tai lueteltavat tiedostot. (Voi olla laajennettu mrittely tai monta mrittely.) /P Tauko jokaisen ruudullisen jlkeen. /W Kytt leve luettelomuotoa. /A Nytt tiedostot, joilla on tietyt mritteet. (Oletus /ADHSRA) mritteet D Hakemistot R Vain luku -tiedostot H Piilotiedostot A Arkistoitavat tiedostot S Jrjestelmtiedostot - Knteinen (l nyt, etuliite) /O Luettelee tiedostot annetussa jrjestyksess. jrjestys N Nimen mukaan (aakkosjrj.) S Koon mukaan (pienin ensin) E Tiedostoptteen mukaan D Vanhimmasta uusimpaan G Hakemistot ensin - Knteinen jrjestys (etuliite) U l lajittele Oletuksena /ONG /S Luettelee mys kaikissa alihakemistoissa olevat tiedostot. /B Kytt pelkistetty muotoa (ei otsaketietoa tai yhteenvetoa). /L Kytt pieni kirjaimia. /Y or /4 Nytt vuosiluvun nelinumeroisena. DIRCMD-ympristmuuttuja saattaa mritell valitsimia. Ne voidaan poistaa kytst sijoittamalla - (vliviiva) ennen valitsinta, kuten /-W. . :TEXT_CMDHELP_DOSKEY#1 Ulkoinen DOSKEY-tykalu on otettu osaksi FreeCOM:ia. Yl- ja alanuolinppimet selaavat historiaa ja HISTORY nytt sen. Vasemmat ja oikeat nuolinppimet sek HOME ja END siirtyvt komentorivin sisll ja INSERT vaihtaa pllekirjoitus- ja lisystilan vlill. Sarkainnppin tydent nykyisen sanan tiedostonimen; kahdesti painettuna se nytt luettelon lydetyist tiedostonimist. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Muokkaa komentorivej, muistaa niit ja luo makroja DOSKEY [/valitsin ...] [makro=[teksti]] /BUFSIZE:koko Asettaa makro- ja komentopuskurin koon (oletus:512) /ECHO:on|off Mritt makrolaajennusten kaiutustilan (oletus:on) /FILE:tiedosto Mritt makroja sisltvn tiedoston /HISTORY Nytt kaikki muistissa olevat komennot /INSERT Uusien merkkien lisys riville kirjoittaessa /KEYSIZE:koko Asettaa nppimistn nppilypuskurin koon (oletus:15) /LINE:koko Asettaa rivin muokkauspuskurin enimmiskoon (oletus:128) /MACROS Nytt kaikki DOSKey-makrot /OVERSTRIKE Kirjoitus rivill olevien merkkien plle (oletus) /REINSTALL Asentaa DOSKey:n uudelleen muistiin makro Mritt luotavan makron nimen teksti Mritt makroon kuuluvat komennot YLS,ALAS-nuolinppimet kyvt historiaa lpi Esc tyhjent komentorivin F7 nytt komentohistorian Alt+F7 tyhjent komentohistorian [teksti]F8 hakee tekstill alkavaa komentoa F9 hakee komentoa numerolla Alt+F10 poistaa kaikki makrot Seuraavia erityiskoodeja voi kytt DOSKeyn makrojen mritelmiss: $T Komentoerotin: makroissa voi olla useampi komento $1-$9 Parametrit: toimivat samoin kuin %1-%9 komentojonoissa $* Korvautuu tekstill, joka on makron nimen jlkeen komennossa . :TEXT_CMDHELP_ECHO Nytt viestej tai kytkee komentokaiutuksen plle tai pois. ECHO [ON | OFF] ECHO [viesti] ECHO ilman parametreja nytt nykyisen komentokaiutustilan. . :TEXT_CMDHELP_EXIT Lopettaa FreeDOS-komentokehotteen, ellei /P-valitsinta ole kytetty. EXIT . :TEXT_CMDHELP_FOR Suorittaa komennon jokaiselle tiedostolle tiedostoryhmss. FOR %%muuttuja IN (ryhm) DO komento [komento-parametrit] %%muuttuja Mritt tiedostomuuttujan nimen. (ryhm) Mritt ryhmn tiedostoja, yleismerkit sallittu. komento Mritt suoritettavan komennon. komento-parametrit Mritt komennon parametrit. Komentojonoissa FOR-komennon muuttuja on mriteltv kahdella prosenttimerkill, esimerkiksi %%%%muuttuja (eik %%muuttuja). Esimerkiksi: FOR %%f IN (---start--- a*.* ---end---) DO ECHO - %%f - . :TEXT_CMDHELP_GOTO Siirt komentojonon suorituksen annetun nimin kohdalle. GOTO nimi nimi Mritt komentojonossa olevan nimin, josta suoritus jatkuu. Nimi luodaan kirjoittamalla se omalle rivilleen kaksoispisteen pern. . :TEXT_CMDHELP_HISTORY#1 Nytt komentohistorian tai mritt sen koon. HISTORY [koko] Ilman parametreja komento nytt komentorivihistorian sislln. Jos koko annetaan, komentorivihistorian puskurin kokoa muutetaan. . :TEXT_CMDHELP_IF Suorittaa komennon ehdollisesti komentojonoissa. IF [NOT] ERRORLEVEL luku komento IF [NOT] mjono1==mjono2 komento IF [NOT] EXIST tnimi komento NOT Mritt, ett komento tulee suorittaa vain, jos ehto ei ole tosi (normaalisti toisinpin). ERRORLEVEL luku Mritt ehdon olevan tosi, jos edellisen ohjelman palauttama lopetuskoodi on suurempi tai yht kuin annettu luku. komento Mritt komennon, joka suoritetaan ehdollisesti. mjono1==mjono2 Mritt ehdon olevan tosi, jos annetut kaksi merkkijonoa ovat samat. EXIST tnimi Mritt ehdon olevan tosi, jos tiedosto on olemassa annetulla tiedostonimell. . :TEXT_CMDHELP_LFNFOR Ottaa kyttn tai poistaa kytst pitkt tiedostonimet FOR-komennolle ja tiedostonimien tydennykselle. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] LFNFOR tai LFNFOR COMPLETE ilman parametreja nytt nykyisen LFNFOR-tilan. . :TEXT_CMDHELP_LH Lataa ohjelman ylmuistiin. LOADHIGH [asema:][polku]tiedostonimi [parametrit] LOADHIGH [/L:alue1[,vkoko1][;alue2[,vkoko2]]...] [/S]] [asema:][polku]tiedostonimi [parametrit] /L:alue1[,vkoko1][;alue2[,vkoko2]]... Mritt muistialueet, joihin ohjelma ladataan. alue1 mritt muistialueen numeron ja vkoko1 mritt alueelle mahdollisen vhimmiskoon. alue2 ja vkoko2 mritt toisen alueen numeron ja vhimmiskoon. Alueiden lukumr ei ole rajoitettu. /S Pienent ylmuistilohkon (UMB) vhimmiskokoonsa ohjelman lataamisen ajaksi. [asema:][polku]tiedostonimi Mritt ohjelman nimen ja sijainnin. . :TEXT_CMDHELP_LOADFIX Lataa ohjelman muistin ensimmisen 64 kilotavun ylpuolelle ja ajaa sen. LOADFIX [asema:][polku]tiedostonimi Jos ohjelma tulostaa virheen pakatun tiedoston vioittumisesta alamuistista ajettaessa, voit kokeilla ajaa sen LOADFIX-komennolla. . :TEXT_CMDHELP_MD Luo hakemiston. MKDIR [asema:]polku MD [asema:]polku . :TEXT_CMDHELP_PATH Nytt tai asettaa ohjelmatiedostojen hakupolun. PATH [[asema:]polku[;...]] PATH ; PATH ; tyhjent hakupolkuluettelon, jolloin komentokehote hakee ohjelmia vain nykyisest hakemistosta. PATH ilman parametreja nytt nykyiset hakupolut. . :TEXT_CMDHELP_PAUSE Keskeytt komentojonon suorituksen ja pyyt kyttjlt nppinpainallusta viestill, joka on oletuksena "Paina mit tahansa nppint jatkaaksesi...". PAUSE [viesti] . :TEXT_CMDHELP_PROMPT Vaihtaa komentokehotteen esitysmuotoa. PROMPT [teksti] teksti Mritt uuden komentokehotteen esitysmuodon. Kehotteen muoto voi koostua normaalimerkkien lisksi seuraavista erityiskoodeista. $Q = (yht kuin -merkki) $$ $ (dollarin merkki) $T Nykyinen aika $D Nykyinen pivmr $P Nykyinen asema ja polku $V FreeDOS-komentokehotteen versio $N Nykyinen asema $G > (suurempi kuin -merkki) $L < (pienempi kuin -merkki) $B | (putkimerkki tai pystyviiva) $H Askelpalautin (poistaa edellisen merkin) $E Escape-koodi (ASCII-koodi 27) $_ Rivinvaihto PROMPT ilman parametreja palauttaa esitysmuodon oletusasetukseen. . :TEXT_CMDHELP_PUSHD Lis nykyisen hakemiston hakemistopolun ylimmksi ja mahdollisesti vaihtaa toiseen hakemistoon. PUSHD [[asema:]polku] [asema:]polku on polku, johon halutaan vaihtaa. . :TEXT_CMDHELP_POPD Poimii ylimmn hakemiston hakemistopinosta ja vaihtaa siihen. POPD [*] '*' tyhjent hakemistopinon. . :TEXT_CMDHELP_DIRS Nytt hakemistopinon sislln. DIRS . :TEXT_CMDHELP_RD Poistaa tyhjn hakemiston. RMDIR [asema:]polku RD [asema:]polku . :TEXT_CMDHELP_REM Esitt kommenttia komentojonossa tai CONFIG.SYS-tiedostossa. REM [kommentti] . :TEXT_CMDHELP_REN Nime tiedoston/hakemiston tai tiedostot/hakemistot uudelleen. RENAME [asema:][polku][hnimi1 | tnimi1] [hnimi2 | tnimi2] REN [asema:][polku][hnimi1 | tnimi1] [hnimi2 | tnimi2] Tlle komennolle ei voi mritt kohdeasemaa tai -polkua tiedostolle tai hakemistolle. Siirtmiseen tulee kytt MOVE-komentoa. . :TEXT_CMDHELP_SET#1 Nytt, asettaa tai poistaa ympristmuuttujia. SET [/C] [/P] [/E] [/U] [muuttuja[=[arvo]]] muuttuja Mritt ympristmuuttujan nimen. arvo Mritt merkkijonon, joka asetetaan muuttujan arvoksi. * Jos arvoa ei anneta (VAR=), ympristmuuttuja poistetaan Kirjoita SET ilman parametreja nyttksesi nykyiset ympristmuuttujat. Kirjoita SET VAR nyttksesi muuttujan VAR arvon. /C pakottaa pitmn muuttujan kirjainkoot samana; oletuksena muuttujan nimi muutetaan isoiksi kirjaimiksi, jos se ei ole jo mritelty ympristss, ja muuten pidetn samana. /P kysyy kyttjlt kehotteella arvoa ja asettaa sen muuttujalle. /E suorittaa arvon mukaisen komennon ja asettaa muuttujan arvoksi kyseisen komennon ensimmisen tulosterivin. /U muuttaa arvon kirjaimet isoiksi kirjaimiksi. . :TEXT_CMDHELP_SHIFT#1 Vaihtaa numeroitujen parametrien paikkaa komentojonossa. SHIFT [DOWN] DOWN siirt parametri-ikkunaa alkua kohti (%%0); muuten sit siirretn loppua kohti. . :TEXT_CMDHELP_TIME#1 Nytt tai asettaa jrjestelmn ajan. TIME [/T] [aika] TIME ilman parametreja tuo nyttn nykyisen kellonajan ja kehotteen uudesta ajasta. Paina ENTER pitksesi saman ajan. /T est komentoa esittmst kehotteita. . :TEXT_CMDHELP_TRUENAME Nytt annetun polun koko polkunimen. TRUENAME [asema:][polku][tiedostonimi] . :TEXT_CMDHELP_TYPE Nytt tekstitiedoston sislln. TYPE [asema:][polku]tiedostonimi . :TEXT_CMDHELP_VER Nytt FreeDOS-komentokehotteen version ja muut tiedot. VER [/R] [/W] [/D] [/C] /R Ytimen versio ja muut tiedot. /W FreeDOS-komentokehotteen takuutiedot. /D FreeDOS-komentokehotteen jakelutiedot. /C FreeDOS-komentokehotteen tekijt. . :TEXT_CMDHELP_VERIFY Kertoo FreeDOS:n tiedostojrjestelmlle, tuleeko sen varmistaa tiedostoihin kirjoitusten tapahtuneen oikein. VERIFY [ON | OFF] VERIFY ilman parametria nytt nykyisen VERIFY-tilan. . :TEXT_CMDHELP_FDDEBUG Jos FreeDOS:iin on knnetty virheenkorjaustoiminnot, tm komento kytkee virheenkorjaustulostuksen plle tai pois tai kertoo sen tilan. FDDEBUG [ON | OFF | tiedosto] FDDEBUG ilman parametreja nytt nykyisen tilan. Jos tiedosto mritelln, virheenkorjaustuloste ohjataan siihen; tuloste liitetn tiedoston loppuun, jos se on jo olemassa. Erikoistiedostonimet "stdout" ja "stderr" ohjaavat tulosteen joko standardituloste- tai standardivirhevirtaan. . :TEXT_CMDHELP_VOL Nytt levyn taltion nimen ja sarjanumeron, jos ne on mritelty. VOL [asema:] . :TEXT_CMDHELP_QUESTION#1 Nytt kehotteessa saatavilla olevat komennot ja toiminnallisuudet. ? ?komento [argumentti] Ensimminen versio nytt kaikki saatavilla olevat komennot ja toiminnallisuudet. Toinen versio kysyy kehotteella, suoritetaanko kyseist komentoa (niin kuin jljitystilassa). . :TEXT_CMDHELP_WHICH Hakee ja nytt komennon toteuttavan ohjelman polun. WHICH komento... . :TEXT_CMDHELP_MEMORY#1 Nytt FreeCOM:n sisisesti kyttmn muistin. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 COPY-komennon kohde ei voi sislt plus-merkkej ('+'). . :TEXT_DELETE_FILE#1% Poistetaan tiedostoa "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Ei voi kirjoittaa tiedostoon '%s'; levy ehk tynn? (%lu tavua vaaditaan) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% kopioitu %luKt/???Kt\r\ . :TEXT_COPY_COPIED#0% kopioitu %luKt/%luKt\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM ei voi olla laite: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Tiedosto ei ole kelvollinen FreeCOM tai on vr versio: %s . :TEXT_ERROR_LOADING_STRINGS Merkkijonoresurssia ei voitu ladata muistiin. %COMSPEC%-muuttujan osoittama sijainti nyttisi olevan virheellinen. Mrit toinen sijainti, josta FreeCOM lataa merkkijonot, kuten: C:\\COMMAND.COM tai paina Enter, jolloin merkkijonojen lataus peruutetaan. . :TEXT_TERMINATING Lopetetaan ohjelmaa nyt. . :TEXT_HIDDEN_CRITER#0% %u kriittisen virheen pyynt hiljennetty. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Lopetuskoodi (ERRORLEVEL): %u, syy: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS-rajapintavirhe\ . :TEXT_EXIT_REASON_0 pttyi normaalisti\ . :TEXT_EXIT_REASON_1 pttyi ^Break:iin\ . :TEXT_EXIT_REASON_2 pttyi virheeseen\ . :TEXT_EXIT_REASON_3 siirtyi muistiin\ . :TEXT_ERROR_EXE_CORRUPT EXE-tiedosto vioittunut\ . ================================================ FILE: strings/fixstrs.c ================================================ /* This program will read in the language file and create three files: strings.dat - contains all the strings. will be appended on the end of the exe file. strings.h - include file that contains all the defines. strings.log - contains all warnings of the local LNG file, the which resources (strings) are missing from it and which ones are not specified in the DEFAULT.lng, thus, are most likely unknown to FreeCOM This file is present only, if there are such warnings, but no message is printed onto screen! Then, if the "/lib" option is present, it creates the STRINGS library source files into the subdirectory STRINGS. There are two input files: DEFAULT.lng and the language file passed as argument to FIXSTRS. DEFAULT.lng has two meanings making it a fundamental file, which ensures the integrity of the multi-language support of FreeCOM: 1) The order of strings noted in DEFAULT.lng will be kept the same in all *.LNG files. 2) If an individual *.LNG file does not define a certain string, its contents is taken from the DEFAULT file. Because each string is assigned a certain number and only this number is known to FreeCOM internally, especially meaning 1) will ensure that each STRINGS.DAT assigns the same semantic to those numbers. The STRINGS.DAT file generated in the following steps: 1) DEFAULT.lng is read; all strings are copied into memory, the string_index_t array is generated with these strings. At the end, one could generate STRINGS.DAT with all the default strings, which are usually in English. 2) the specified *.LNG file is read; if a string is defined in this file, too, its contents overwrites the default string already present. New strings are assigned a new number above the already allocated string numbers. 3) Now all strings are known, there sizes and offsets within the file, the STRINGS.DAT and STRINGS.H files are generated. 2000/07/09 ska chg: to read STRINGS.H to keep the same order of strings chg: to let STRINGS.TXT read only once (temporary binary file) chg: The format of STRINGS.DAT has been changed in order to support different languages _without_ recompiling. 2000/07/11 ska chg: To use STRINGS.H to keep up the order becomes problematic, as this file is regenerated each time FIXSTRS is run. On failure, this file is destroyed. Therefore STRINGS.TXT will be renamed into DEFAULT.lng and is used to a) specify the order and, if missing, the default string text. 2001/03/15 ska add: version number of strings and logfile entries */ #include #if defined(__TURBOC__) #include #elif defined(__GNUC__) && !defined(__MINGW32__) #include #include #define stricmp strcasecmp #define mkdir(x) mkdir(x, 0777) static char *strupr(char *s) { char *p; for (p = s; *p; p++) *p = toupper(*p); return s; } #elif defined(__WATCOMC__) && defined(__UNIX__) #include #include #define mkdir(x) mkdir(x, 0777) #else #include #include #endif #include #include #include #undef DEBUG #include "../config.h" #include "../include/strings.typ" #include "../include/resource.h" #include "../include/keys.h" #define logfile "strings.log" #define fDAT "strings.dat" #define fTXT "DEFAULT.lng" #define fH "strings.h" #define fEXT ".lng" #define fDMAKEFILE "makefile" #define fTCMAKEFILE "strings.rsp" #define fTCMAKFILE "strings.mak" typedef enum STATE { LOOKING_FOR_START ,GETTING_PROMPT_LINE_1 ,GETTING_PROMPT_LINE_2 ,GETTING_STRING } read_state; #define MAXSTRINGS 256 #define VERSION_MISMATCH 128 #define VALIDATION_MISMATCH 64 #define PERFORM_VALIDATION 32 const char id[]="FreeDOS STRINGS v"; /* all prompts within *.LNG files start with */ const char promptID[] = "PROMPT_"; #define promptIDlen (sizeof(promptID) - 1) #define STRINGLIB_DIR "strings" #define stringdir cfile #define cfilename (&cfile[sizeof(STRINGLIB_DIR)]) #define cfmt "str%04x.c" #define objfmt "str%04x.obj" char cfile[] = STRINGLIB_DIR "\0str45678.obj"; /* Implementation details about to cache the strings within memory: + Because the strings are currently entitled to fit into 64KB, they should fit into memory during runtime of this program. Therefore FIXSTRS will be compiled in Compact memory model. */ typedef struct { char *text; int length; } dynstring; typedef struct { const int keycode; const char * const keyname; } symKey; FILE *lgf = 0; int in_file = 0; string_index_t string[MAXSTRINGS]; struct { int flags; /* bitfield: #0 -> DEFAULT, #1 -> special LNG file meaning: present in particular file #5: perform printf() validation #6: printf() validation failed #7: Version mismatch */ char *name; /* name of string */ char *text; /* text of this string */ int version; char *vstring; /* validation string */ } strg[MAXSTRINGS]; string_count_t cnt = 0; /* current string number */ string_count_t maxCnt = 0; /* number of strings within array */ #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #error "This program must be compiled with far data pointers" #endif char temp[1024]; static const char besFromChar[] = "abcdefghijklmnopqrstuvwxyz,.[{}]\\?0"; static const char besToChar[] = "\a\bcd\e\fghijklm\nopq\rs\t\x0\vw\x0yz,.[{}]\\?"; symKey symkeys[] = { /* symbolic keynames, uppercased! */ { KEY_CTL_C, "BREAK" } /* Pseudo-^Break */ ,{ KEY_CTL_C, "CBREAK" } ,{ KEY_NL, "LF" } ,{ KEY_NL, "NL" } ,{ KEY_NL, "LINEFEED" } ,{ KEY_NL, "NEWLINE" } ,{ KEY_CR, "CR" } ,{ KEY_CR, "ENTER" } ,{ KEY_ESC, "ESC" } ,{ KEY_ESC, "ESCAPE" } ,{ ASCIICODE('\f'), "FF" } ,{ ASCIICODE('\f'), "FORMFEED" } ,{ ASCIICODE('\a'), "ALARM" } ,{ ASCIICODE('\a'), "BELL" } ,{ ASCIICODE('\a'), "BEEP" } ,{ KEY_BS, "BS" } ,{ KEY_BS, "BACKSPACE" } ,{ KEY_TAB, "HT" } ,{ KEY_TAB, "TAB" } ,{ ASCIICODE('\v'), "VT" } ,{ ASCIICODE('\0'), "NUL" } ,{ ASCIICODE('\x1'), "SOH" } ,{ ASCIICODE('\x2'), "STX" } ,{ ASCIICODE('\x3'), "ETX" } ,{ ASCIICODE('\x4'), "EOT" } ,{ ASCIICODE('\x5'), "ENQ" } ,{ ASCIICODE('\x6'), "ACK" } ,{ ASCIICODE('\x7'), "BEL" } /* 8 -> BS, 9 -> HT, A -> LF, B ->VT, C -> FF, D -> CR */ ,{ ASCIICODE('\xe'), "SO" } ,{ ASCIICODE('\xf'), "SI" } ,{ ASCIICODE('\x10'), "DLE" } ,{ ASCIICODE('\x11'), "DC1" } ,{ ASCIICODE('\x12'), "DC2" } ,{ ASCIICODE('\x13'), "DC3" } ,{ ASCIICODE('\x14'), "DC4" } ,{ ASCIICODE('\x15'), "NAK" } ,{ ASCIICODE('\x16'), "SYN" } ,{ ASCIICODE('\x17'), "ETB" } ,{ ASCIICODE('\x18'), "CAN" } ,{ ASCIICODE('\x19'), "EM" } ,{ ASCIICODE('\x1a'), "SUB" } /* 1b -> ESC */ ,{ ASCIICODE('\x1c'), "FS" } ,{ ASCIICODE('\x1d'), "GS" } ,{ ASCIICODE('\x1e'), "RS" } ,{ ASCIICODE('\x1f'), "US" } ,{ KEY_F1, "F1" } ,{ KEY_F2, "F2" } ,{ KEY_F3, "F3" } ,{ KEY_F4, "F4" } ,{ KEY_F5, "F5" } ,{ KEY_F6, "F6" } ,{ KEY_F7, "F7" } ,{ KEY_F8, "F8" } ,{ KEY_F9, "F9" } ,{ KEY_F10, "F10" } ,{ KEY_F11, "F11" } ,{ KEY_F12, "F12" } ,{ KEY_LEFT, "LEFT" } ,{ KEY_RIGHT, "RIGHT" } ,{ KEY_UP, "UP" } ,{ KEY_DOWN, "DOWN" } ,{ KEY_INS, "INS" } ,{ KEY_DEL, "DEL" } ,{ KEY_HOME, "HOME" } ,{ KEY_END, "END" } ,{ KEY_PUP, "PUP" } ,{ KEY_PDOWN, "PDOWN" } ,{ 0, ""} }; /* keep it a single-file project */ #include "../lib/res_w.c" /* * Append the passed in string onto strg[cnt].text */ #define app(s) appStr(text, (s)) #define appStr(vs,s) appMem((vs), (s), strlen((s))) #define appMem(vs,s,l) appMem_(&(vs), (s), (l)) int appMem_(dynstring *vs, char *s, int length) { if((vs->text = realloc(vs->text, 1 + vs->length + length)) != 0) { char *p; p = vs->text + vs->length; if(length) memcpy(p, s, length); p[length] = 0; vs->length += length; return 1; } fputs("Out of memory\n", stderr); return 0; } unsigned fromxdigit(int ch) { if(isdigit(ch)) return ch - '0'; return toupper(ch) - 'A'; } #ifdef __TURBOC__ #define join(s1,s2) strcpy(stpcpy(temp, s1), s2); #else #define join(s1,s2) strcat(strcpy(temp, s1), s2); #endif void pxerror(const char * const msg1, const char * const msg2) { join(msg1, msg2); perror(temp); } void dumpCh(FILE * const f, const unsigned char ch) { static const char from[] = "'\\\n\t\a\b\f"; static const char to[] = "'\\ntabf0"; const char *p; if((p = strchr(from, ch)) != 0) fprintf(f, "'\\%c'", to[(int)(p - from)]); else if(isprint(ch)) fprintf(f, " '%c'", ch); else fprintf(f, "0x%02x", ch); } void dumpString(const int stringId) { FILE *f; int len, cnt; unsigned char *p; sprintf(cfilename, cfmt, stringId); if((f = fopen(cfile, "wt")) == NULL) { pxerror("creating ", cfile); exit(102); } fprintf(f, "const char %s[] = {\n\t", strg[stringId].name); p = (unsigned char*)strg[stringId].text; if(string[stringId].size > 1) { for(len = string[stringId].size, cnt = 9; --len;) { char ch; dumpCh(f, ch = *p++); putc(',', f); putc(' ', f); if(--cnt == 0 || ch == '\n') { putc('\n', f); putc('\t', f); cnt = 9; } } } if(string[stringId].size) dumpCh(f, *p); fputs("\n};\n", f); fclose(f); } /* map a backslash sequence */ int mapBSEscape(char ** const s) { char *p; const char *q; int ch; p = *s; if((ch = *p++) == 0) /* Don't advance pointer */ return 0; if(ch == 'x') { /* Hexadecimal */ if(isxdigit(*p)) { ch = fromxdigit(*p++); if(isxdigit(*p)) ch = (ch << 4) | fromxdigit(*p++); } else ch = 0; } else if((q = strchr(besFromChar, ch)) != 0) { ch = besToChar[(unsigned)(q - besFromChar)]; } /* else ch remains the character behind the backslash */ *s = p; /* Advance pointer */ return ch; } /* map a symbolic key */ int mapSymKey(char * const p) { symKey *q; strupr(p); /* Uppercase here to speed up process later */ q = symkeys; do if(strcmp(q->keyname, p) == 0) /* found */ break; while((q++)->keycode); return q->keycode; } int loadFile(const char * const fnam) { unsigned long linenr; char *p; read_state state = LOOKING_FOR_START; FILE *fin; dynstring text; /* Current text */ dynstring vstring; /* Validation string */ int version; text.text = vstring.text = 0; version = 0; printf("FIXSTRS: loading file %s\n", fnam); join(fnam, fEXT); if((fin = fopen(fnam, "rt")) == NULL && (fin = fopen(temp, "rt")) == NULL) { pxerror("opening ", fnam); return 33; } linenr = 0; while (fgets(temp, sizeof(temp), fin)) { ++linenr; p = strchr(temp, '\0'); if(p[-1] != '\n') { fprintf(stderr, "Line %lu too long\n", linenr); return 41; } /* Cut trailing control characters */ while (--p >= temp && iscntrl(*p)); p[1] = '\0'; switch (state) { case LOOKING_FOR_START: switch(*temp) { case ':': { char *vers; if((vers = strchr(temp + 1, '#')) != 0) { *vers = '\0'; } /* Locate the string name */ for(cnt = 0; cnt < maxCnt; ++cnt) if(strcmp(strg[cnt].name, temp + 1) == 0) goto strnameFound; /* string name was not found --> create a new one */ ++maxCnt; strnameFound: if(!strg[cnt].name) { if((strg[cnt].name = strdup(temp + 1)) == 0) { fputs("Out of memory\n", stderr); return 80; } } vstring.length = text.length = 0; version = (vers && *++vers)? atoi(vers): 0; if(vers && strchr(vers, '%')) strg[cnt].flags |= PERFORM_VALIDATION; if(memcmp(strg[cnt].name, promptID, promptIDlen) == 0) state = GETTING_PROMPT_LINE_1; else state = GETTING_STRING; } break; default: while(p >= temp && isspace(*p)) --p; if(p >= temp) { fprintf(stderr, "Syntax error in line #%lu\n", linenr); return 44; } /** fall through **/ case '\0': case '#': break; } break; case GETTING_PROMPT_LINE_1: { char *p, *q, len; int ch; if((*temp == '.' || *temp == ',') && (temp[1] == '\0')) { fprintf(stderr, "%s: %s: prompt syntax error\n" , fnam, strg[cnt].name); return 41; } q = p = temp; while((ch = *p++) != 0) switch(ch) { case '\\': if(*p && (*q++ = mapBSEscape(&p)) == 0) { fprintf(stderr , "%s: %s: ASCII(0) is no valid key\n" , fnam, strg[cnt].name); return 49; } break; case '{': { char *h; int thisCh; if((p = strchr(h = p, '}')) == 0) { fprintf(stderr , "%s: %s: invalid symbolic key\n" , fnam, strg[cnt].name); return 46; } *p++ = 0; if((thisCh = mapSymKey(h)) == 0) { fprintf(stderr , "%s: %s: unknown symbolic key\n" , fnam, strg[cnt].name); return 47; } if(thisCh >= 256) { fprintf(stderr , "%s: %s: non-ASCII keys not supported, yet\n" , fnam, strg[cnt].name); return 55; } *q++ = thisCh; } break; case '[': fprintf(stderr , "%s: %s: brackets are not supported, yet\n" , fnam, strg[cnt].name); return 48; default: *q++ = ch; break; } *q = 0; if(q == temp) { fprintf(stderr , "%s: %s: empty key sequence\n" , fnam, strg[cnt].name); return 52; } if((unsigned)(q - temp) > 255) { fprintf(stderr , "%s: %s: too many keys\n" , fnam, strg[cnt].name); return 55; } len = (char)(q - temp); /* Prompts are PStrings in this form: LKKKKMMMM where number of K's == number of M's == L K -> key (1..255); M -> metakey (range 1..26); 0 < L < 256 */ if(!appMem(text, &len, 1) || !app(temp)) return 42; state = GETTING_PROMPT_LINE_2; } break; case GETTING_PROMPT_LINE_2: { char *p, *q; if ((*temp == '.' || *temp == ',') && (temp[1] == '\0')) { fprintf(stderr, "%s: %s: prompt syntax error\n" , fnam, strg[cnt].name); return 43; } p = q = temp; while((*q = *p++) != 0) if(*q >= 'a' && *q <= 'z') { *q++ -= 'a' - 1; /* valid metakey */ } else if(!isspace(*q)) { fprintf(stderr, "%s: %s: invalid target metakey\n" , fnam, strg[cnt].name); return 44; } if((unsigned)(q - temp) + 1 != text.length) { fprintf(stderr , "%s: %s: number of metakeys does not match input keys\n" , fnam, strg[cnt].name); return 53; } if(!app(temp)) return 54; state = GETTING_STRING; break; } case GETTING_STRING: if ((*temp == '.' || *temp == ',') && (temp[1] == '\0')) { if (*temp == ',' && text.length && text.text[text.length - 1] == '\n') { /* Cut the text as there is to always be a '\0' at the end of the string */ text.text[--text.length] = '\0'; } state = LOOKING_FOR_START; appMem(vstring, "", 0); /* ensure vstring.text is != NULL */ assert(vstring.text); assert((strg[cnt].flags & 3) == 0 /* New string */ || strg[cnt].vstring); /* Apply the cached text */ if((strg[cnt].flags & 3) == 0 /* New string */ || (strg[cnt].version == version && ((strg[cnt].flags & PERFORM_VALIDATION) == 0 || strcmp(strg[cnt].vstring, vstring.text) == 0))) { /* OK -> replace it */ strg[cnt].version = version; free(strg[cnt].text); strg[cnt].text = text.text; string[cnt].size = text.length + 1; free(strg[cnt].vstring); strg[cnt].vstring = vstring.text; } else { if(strg[cnt].version != version) strg[cnt].flags |= VERSION_MISMATCH; if(strcmp(strg[cnt].vstring, vstring.text) != 0) strg[cnt].flags |= VALIDATION_MISMATCH; /* Failed -> ignore the read text */ free(text.text); free(vstring.text); } text.text = vstring.text = 0; strg[cnt].flags |= in_file; } else { char *p, *q, ch; /* Fetch the '%' format sequences */ q = temp - 1; while((p = strchr(q + 1, '%')) != 0) { if((q = strpbrk(p, "%diouxXfegEGcsnp")) == 0) q = strchr(p, '\0') - 1; if(!appMem(vstring, p, (unsigned)(q - p) + 2)) return 51; } /* Replace backslash escape sequences */ p = q = temp; while((ch = *p++) != 0) { if(ch != '\\') *q++ = ch; else if(!*p) goto noAppendNL; else *q++ = mapBSEscape(&p); } *q++ = '\n'; noAppendNL: if(!appMem(text, temp, (unsigned)(q - temp))) return 82; } break; } } if(ferror(fin)) { pxerror("reading ", fnam); return 34; } fclose(fin); if(state != LOOKING_FOR_START) { fprintf(stderr, "%s: Last string not terminated\n", fnam); return 40; } return 0; } static int create_make_dependency(void) { string_count_t cnt1; string_count_t maxCnt1; string_count_t cnt2; strcpy(cfilename, fTCMAKFILE); if((lgf = fopen(cfile, "wt")) == NULL) { pxerror("creating ", cfile); return 101; } cnt1 = maxCnt1 = cnt2 = 0; for(cnt = 0; cnt < maxCnt; ++cnt) { if( cnt1 == 0 ) { if( cnt > 0 ) fprintf(lgf, "\n"); fprintf(lgf, "strings_deps%d : \\\n", maxCnt1++); cnt2 = 0; } fprintf(lgf, " " objfmt, cnt); if(++cnt1 > 127) { cnt1 = 0; } if(++cnt2 > 7 && cnt1 > 0) { fprintf(lgf, " \\\n"); cnt2 = 0; } } for(cnt = 0; cnt < maxCnt1; ++cnt) { if( cnt == 0 ) fprintf(lgf, "\nSTRINGS_DEPS ="); fprintf(lgf, " strings_deps%d", cnt); } fflush(lgf); if(ferror(lgf)) { puts("Unspecific error writing to " fTCMAKFILE); return 104; } fclose(lgf); return 0; } int main(int argc, char **argv) { FILE *dat, *inc; int rc; unsigned long size; string_count_t cnt; /* current string number */ string_size_t lsize; int makeLib = 0; const char *fmt; unlink(logfile); while(argv[1] != NULL ) { if(stricmp(argv[1], "/lib") == 0 || stricmp(argv[1], "--lib") == 0) { --argc; ++argv; makeLib = 1; } else if(stricmp(argv[1], "/lib1") == 0 || stricmp(argv[1], "--lib1") == 0) { --argc; ++argv; makeLib = 2; } else if(stricmp(argv[1], "/lib2") == 0 || stricmp(argv[1], "--lib2") == 0) { --argc; ++argv; makeLib = 3; } else { break; } } /* * Hidden options lib and lib1 and lib2 * * if one of these option is used then program generate strings library * source files and generate make files and response file for make utility * * lib.. options control response file format * lib2 format is '+ &' * lib1 format is '+' * lib format is '' only */ if(argc > 2 ) { puts("FIXSTRS - Generate STRINGS.DAT and STRINGS.H for a language\n" "Useage: FIXSTRS [/lib|/lib1|/lib2] [language]\n" "\tIf no language is specified, only the default strings are read.\n" "\tThe .LNG file must reside in the current directory.\n" "Note: DEFAULT.lng must be present in the current directory, too."); return 127; } in_file = 1; if((rc = loadFile(fTXT)) != 0) return rc; in_file = 2; if(argc > 1 && (rc = loadFile(argv[1])) != 0) return rc; /* Now all the strings are cached into memory */ if(maxCnt < 2) { fputs("No string definition found.\n", stderr); return 43; } /* Create the LOG file */ if(argc > 1) { /* Only if a local LNG file was specified */ lgf = NULL; /* No LOG entry til this time */ for(cnt = 0; cnt < maxCnt; ++cnt) { switch(strg[cnt].flags & 3) { case 0: /* Er?? */ fputs("Internal error assigned string has no origin?!\n" , stderr); return 99; case 1: /* DEFAULT.lng only */ if(!lgf && (lgf = fopen(logfile, "wt")) == NULL) { fprintf(stderr, "Cannot create logfile: '%s'\n" , logfile); goto breakLogFile; } fprintf(lgf, "%s: Missing from local LNG file\n" , strg[cnt].name); break; case 2: /* local.LNG only */ if(!lgf && (lgf = fopen(logfile, "wt")) == NULL) { fprintf(stderr, "Cannot create logfile: '%s'\n" , logfile); goto breakLogFile; } fprintf(lgf, "%s: No such string resource\n" , strg[cnt].name); break; case 3: /* OK */ break; } if(strg[cnt].flags & VERSION_MISMATCH) { if(!lgf && (lgf = fopen(logfile, "wt")) == NULL) { fprintf(stderr, "Cannot create logfile: '%s'\n" , logfile); goto breakLogFile; } fprintf(lgf, "%s: Version mismatch, current is: %u\n" , strg[cnt].name, strg[cnt].version); } if(strg[cnt].flags & VALIDATION_MISMATCH) { if(!lgf && (lgf = fopen(logfile, "wt")) == NULL) { fprintf(stderr, "Cannot create logfile: '%s'\n" , logfile); goto breakLogFile; } fprintf(lgf, "%s: printf() format string mismatch, should be: %s\n" , strg[cnt].name, strg[cnt].vstring); } } if(lgf) fclose(lgf); } breakLogFile: /* 1. Adjust the offset and generate the overall size */ for(size = string[0].size, cnt = 1; cnt < maxCnt; ++cnt) { string[cnt].index = string[cnt-1].index + string[cnt-1].size; size += string[cnt].size; } if(size >= 0x10000ul - sizeof(string_index_t) * maxCnt) { fputs("Overall size of strings exceeds 64KB limit\n", stderr); return 44; } /* 2. Open STRINGS.DAT and STRINGS.H and dump control information */ if ((dat = fopen(fDAT,"wb")) == NULL) { perror("creating " fDAT); return 36; } if ((inc = fopen(fH,"wt")) == NULL) { perror("creating " fH); return 37; } puts("FIXSTRS: building STRINGS resource"); fputs("/*\n" " * This file was automatically generated by FIXSTRS.\n" " * Any modifications will be lost next time this tool\n" " * is invoked.\n" " */\n\n", inc); fprintf(inc,"#define STRINGS_ID \"%s%u\"\n" , id, STRING_RESOURCE_MINOR_ID); startResource(dat, RES_ID_STRINGS, STRING_RESOURCE_MINOR_ID); /* Preamble of STRINGS.DAT file */ fprintf(dat, "%s%u", id, STRING_RESOURCE_MINOR_ID); /* fwrite(id, sizeof(id) - 1, 1, dat); *//* file contents ID */ fwrite("\r\n\x1a", 4, 1, dat); /* text file full stop */ fputs("#define STRINGS_ID_TRAILER 4\n", inc); /* 4 additional bytes */ fputs("\n\n", inc); /* delimiter */ /* parameters of strings */ fwrite(&maxCnt, sizeof(maxCnt), 1, dat); /* number of strings */ lsize = (string_size_t)size; fwrite(&lsize, sizeof(lsize), 1, dat); /* total size of string text */ /* string control area */ fwrite(string, sizeof(string[0]), maxCnt, dat); /* append the strings */ for(cnt = 0; cnt < maxCnt; ++cnt) { fwrite(strg[cnt].text, string[cnt].size, 1, dat); if(makeLib) fprintf(inc, "extern const char %s[];\n", strg[cnt].name); fprintf(inc, "#define %-34s 0x%02x /* @ 0x%04x */\n" , strg[cnt].name, cnt, string[cnt].index); } fputs("\n/* END OF FILE */\n", inc); endResource(dat); fflush(dat); if(ferror(dat)) { fputs("Unspecific write error into " fDAT "\n", stderr); return 38; } fflush(inc); if(ferror(inc)) { fputs("Unspecific write error into " fH "\n", stderr); return 39; } fclose(dat); fclose(inc); if(makeLib) { mkdir(stringdir); #define fdmake inc #define ftc101 dat cfilename[-1] = '/'; strcpy(cfilename, fDMAKEFILE); if((fdmake = fopen(cfile, "wt")) == NULL) { pxerror("creating ", cfile); return 100; } if((rc = create_make_dependency()) != 0) return rc; strcpy(cfilename, fTCMAKEFILE); if((ftc101 = fopen(cfile, "wt")) == NULL) { pxerror("creating ", cfile); return 101; } puts("FIXSTRS: building STRINGS library source files"); /********************** prologue */ fputs("\ MAXLINELENGTH := 8192\n\ # Project specific C compiler flags\n\ MYCFLAGS_DBG = -UNDEBUG $(null,$(DEBUG) $(NULL) -DDEBUG=1)\n\ MYCFLAGS_NDBG = -DNDEBUG=1 -UDEBUG\n\ MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\n\ \n\ # Default target\n\ all: $(CFG) strings.lib\n\ \n\ strings.lib .LIBRARY : ", fdmake); /********************* individual files */ for(cnt = 0; cnt < maxCnt; ++cnt) { dumpString(cnt); fprintf(fdmake, "\\\n\t" objfmt, cnt); } if(makeLib == 3) { /* Turbo C */ fmt = "+" objfmt " &\n"; } else if(makeLib == 2) { /* Borland C */ fmt = "+" objfmt "\n"; } else { /* GCC, Open Watcom */ fmt = objfmt "\n"; } for(cnt = 0; cnt < maxCnt - 1; ++cnt) { fprintf(ftc101, fmt, cnt); } if(makeLib > 1) { /* Borland C, Turbo C */ fmt = "+" objfmt "\n"; } else { /* GCC, Open Watcom */ fmt = objfmt "\n"; } fprintf(ftc101, fmt, cnt); /********************** epilogue */ fputs("\n\ \n\ .IF $(CFG) != $(NULL)\n\ \n\ CONFIGURATION = $(CONF_BASE)\n\ \n\ .IF $(_COMPTYPE) == BC\n\ CONF_BASE = \\\n\ -f- \\\n\ -I$(INCDIR:s/;/ /:t\";\") \\\n\ -L$(LIBDIR:s/;/ /:t\";\") \\\n\ -w\n\ \n\ .IF $(_COMPILER)==BC5\n\ CONFIGURATION += -RT- -x-\n\ .ENDIF\n\ \n\ CONF_DBG = $(MYCFLAGS_DBG)\n\ CONF_NDBG = $(MYCFLAGS_NDBG)\n\ \n\ .ENDIF\n\ \n\ .IF $(_COMPTYPE) == TC\n\ CONF_BASE = \\\n\ -I$(INCDIR:s/;/ /:t\";\") \\\n\ -L$(LIBDIR:s/;/ /:t\";\") \\\n\ -w\n\ \n\ CONF_DBG = $(MYCFLAGS_DBG)\n\ CONF_NDBG = $(MYCFLAGS_NDBG)\n\ \n\ .ENDIF\n\ .ENDIF\n", fdmake); fflush(ftc101); if(ferror(ftc101)) { puts("Unspecific error writing to " fTCMAKEFILE); return 104; } fclose(ftc101); fflush(fdmake); if(ferror(fdmake)) { puts("Unspecific error writing to " fDMAKEFILE); return 105; } fclose(fdmake); } return 0; } ================================================ FILE: strings/french.err ================================================ # $Id$ # # Critical error national customization file # # Language: French # Codepage: 850 # Author: Mateusz Viste # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Erreur %1 lecteur %A: %2 zone : %3 S3 CHAR_DEVICE: Erreur %1 lecteur %A: %3 ## kind of operation S0 READ: lecture de S1 WRITE: criture vers ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: root S7 DATA: donnes ## action strings S8 IGNORE: (I)gnorer S9 RETRY: (R)ecommencer S10 ABORT: (A)nnuler S11 FAIL: (E)chec ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: eE ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Code d'erreur inconnu S15 0: tentative de violation de protection en criture 1: unit inconnue pour pilote 2: lecteur non prt 3: commande inconnue donne au pilote 4: erreur de donnes (mauvais CRC) 5: mauvaise structure de taille pour la requte de pilote de priphrique 6: erreur de recherche 7: type de support inconnu 8: secteur non trouv 9: imprimante court de papier 10: erreur d'criture 11: erreur de lecture 12: erreur gnrale 13: violation de partage 14: violation de verrou 15: changement de disque invalide 16: FCB indisponible 17: tampon de partage satur 18: page de code manquante 19: fin de l'entre 20: espace disque insuffisant ================================================ FILE: strings/french.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: French # Codepage: 850 # Author: Mateusz Viste # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retrieve the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.LNG only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carriage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interpret a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitrary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readability of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Paramtre incorrect. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Paramtre incorrect. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Option mal forme: '%s' . :TEXT_ERROR_OPT_ARG#0% L'option '%s' n'accepte pas d'arguments . :TEXT_ERROR_OPT_NOARG#0% l'option "%s" ncessite un plusieurs paramtre(s) . :TEXT_INVALID_NUMBER#0% Nombre invalide spcifi dans '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Il manque la fermeture des guillemets: %c . :TEXT_ERROR_TEMPFILE Impossible de crer le fichier temporaire . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Trop de paramtres. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Trop de paramtres. . :TEXT_ERROR_INVALID_PARAMETER#0% Paramtre invalide. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Chemin introuvable. . :TEXT_ERROR_FILE_NOT_FOUND Fichier introuvable. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Fichier introuvable. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Paramtre requis absent. . :TEXT_ERROR_INVALID_DRIVE#0% Spcification de lecteur invalide: %c:. . :TEXT_ERROR_BADCOMMAND#2% Commande ou nom de fichier incorrect - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Plus de mmoire disponible. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 L'allocation de mmoire DOS a chou. . :TEXT_ERROR_CANNOTPIPE Impossible d'tablir un pipe ! Impossible d'ouvrir le fichier temporaire ! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% La ligne #%ld dans le fichier BATCH '%s' est trop longue. . :TEXT_ERROR_BFILE_VANISHED#0% Le fichier BATCH '%s' est introuvable. . :TEXT_ERROR_BFILE_LABEL#0% Le fichier BATCH '%s' ne contient pas d'tiquette '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s a chou pour '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Impossible de dfinir la variable '%s'. L'environnement serait-il satur ? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% La variable d'environnement '%s' est introuvable. . :TEXT_ERROR_NO_ENVIRONMENT Aucun environnement ! La mmoire est peut-tre bout. Utilisez l'option /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Impossible de dfinir l'alias '%s'. L'espace des alias serait-il satur ? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' non trouv. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Pas d'espace pour les alias. La mmoire est peut-tre insuffisante. . :TEXT_ERROR_SYNTAX_STR#0% Erreur de syntaxe. - '%s' . :TEXT_ERROR_SYNTAX Erreur de syntaxe. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Nom de fichier trop long. - '%s' . :TEXT_ERROR_SELFCOPY#0% Impossible de copier '%s' sur lui-mme . :TEXT_ERROR_COMMAND_TOO_LONG Ligne de commande trop longue aprs expansion d'alias ! . :TEXT_ERROR_LINE_TOO_LONG Ligne trop longue. Impossible d'excuter la commande. . :TEXT_ERROR_HISTORY_SIZE#1% Taille de l'historique invalide '%s'. . :TEXT_HISTORY_EMPTY#1 L'historique de la ligne de commande est vide. . :TEXT_ERROR_BAD_MCB_CHAIN La chane MCB ou le systme de compatibilit MS-DOS est corrompu. . :TEXT_ERROR_UNDEFINED_ERROR#0% Erreur non dfinie %d. . :TEXT_ERROR_REGION_WARNING#0% Rgion de mmoire invalide %d - ignor. . :TEXT_ERROR_ON_OR_OFF Vous devez spcifier ON ou OFF. . :TEXT_ERROR_BAD_VARIABLE Mauvaise spcification de variable. . :TEXT_ERROR_IN_MISSING#1 IN oubli dans la commande FOR. . :TEXT_ERROR_MISSING_PARENTHESES#1 Une ou plusieurs parenthse(s) oublie(s). . :TEXT_ERROR_DO_MISSING#1 DO oubli dans la commande FOR. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Aucune commande aprs DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Impossible de rediriger l'entre depuis le fichier '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Impossible de rediriger la sortie vers le fichier '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 La redirection est vide. . :TEXT_ERROR_INVALID_DATE Date invalide. . :TEXT_ERROR_INVALID_TIME Heure invalide. . :TEXT_ERROR_NO_GOTO_LABEL tiquette de destination non dfinie dans GOTO. . :TEXT_CTTY_NOTIMPLEMENTED La commande CTTY a t exclue de ce COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% Priphrique '%s' invalide ou protg en criture. . :TEXT_ERROR_CTTY_DUP#0% chec lors du changement des descripteurs du fichier vers TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L pas encore implment. . :TEXT_ERROR_U_NOTIMPLEMENTED /U pas encore implment. . :TEXT_ERROR_WRITING_DEST Erreur lors de l'criture sur la destination. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Impossible d'ouvrir la source. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Impossible d'ouvrir le fichier '%s' . :TEXT_ERROR_READ_FILE#0% Impossible de lire le fichier '%s' . :TEXT_ERROR_WRITE_FILE#0% Impossible d'crire dans le fichier '%s' . :TEXT_ERROR_LEADING_PLUS Le caractre '+' ne peut pas prcder les arguments. . :TEXT_ERROR_TRAILING_PLUS Le caractre '+' ne peut pas suivre les arguments. . :TEXT_ERROR_NOTHING_TO_DO Rien faire. . :TEXT_ERROR_COPY COPY a chou. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: il manque le nom du fichier . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: il manque le numro . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: numro non valide . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Commande manquante . :TEXT_NOT_IMPLEMENTED_YET Dsol... pas encore implment. . :TEXT_FAILED_LOAD_STRINGS chec lors du transfert des messages en mmoire. . :TEXT_MSG_NOTIMPLEMENTED L'option /MSG t exclue de ce COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u lments affichs. . :TEXT_CORRUPT_COMMAND_LINE Ligne de commande corrompue ! Ceci est une erreur interne lie COMMAND.COM, merci de la rapporter (par exemple sur www.freedos.org/bugs). . :TEXT_QUOTED_C_OR_K#1 Les options /C et /K ne peuvent pas tre ajoutes, elles sont ignores. . :TEXT_INIT_FULLY_QUALIFIED#1% Le rpertoire de COMMAND.COM doit tre compltement dfini ! cela signifie que la lettre du lecteur doit tre prcise. Par exemple: C:\\FREEDOS COMMAND.COM utilise actuellement le rpertoire suivant : %s . :TEXT_ERROR_RESTORE_SESSION Les informations de la session ne peuvent pas tre restaures, tous les paramtres locaux sont perdus. Rfrez-vous aux messages d'erreurs ci-dessus pour connatre la raison de ce problme... . :TEXT_ERROR_SAVE_SESSION L'information courante ne peut tre prserve durant l'appel du programme. Rfrez-vous aux messages d'erreurs ci-dessus pour connatre la raison de ce problme... . :TEXT_ERROR_CWD_FAILED#1% Le lecteur %c: ne rpond pas. . :TEXT_ERROR_KSWAP_ALIAS_SIZE chec de l'change : Les alias allouent trop de mmoire. . :TEXT_ERROR_KSWAP_ALLOCMEM chec de l'change : impossible d'allouer de la mmoire distante. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Fin d'espace pour les alias. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Cet alias n'existe pas: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 chec de l'insertion de l'alias. . :TEXT_ALIAS_INVALID_NAME#1% Nom d'alias invalide '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Impossible de charger le module contextuel ou le pilote d'erreurs critiques. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Contexte bout de mmoire. Si cette erreur persiste, envisagez d'allouer plus de tampons internes, comme l'historique, la pile de rpertoires etc. . :TEXT_ERROR_CONTEXT_LENGTH#1% La taille totale des contextes (%lu octets) excde la limite maximale. La taille des contextes a t modifie %u octets. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 chec de l'ajout d'informations d'tat au contexte. Cette erreur peut indiquer une corruption mmoire ou une taille minimale mal dtermine du contexte. Veuillez informer le mainteneur de FreeCOM l'adresse : freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Le contexte a t perdu aprs le swap. Un contexte va tre recr, mais tous les alias etc. seront perdus. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Permission refuse . :TEXT_ERROR_NO_SUCH_FILE#1% %s: Aucun fichier ou rpertoire de ce nom . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Erreur inconnue . # # Informational messages # :TEXT_MSG_PAUSE#1 Appuyez sur une touche pour continuer . . .\ . :TEXT_MSG_HISTORY_SIZE#0% La taille de l'historique est de %d octets. . :TEXT_MSG_DOSKEY Les fonctionnalits DOSKEY sont dj actives dans le shell. . :TEXT_MSG_ECHO_STATE#0% ECHO est %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY est %s . :TEXT_MSG_FDDEBUG_STATE#0% La sortie de DEBUG est %s. . :TEXT_MSG_FDDEBUG_TARGET#0% La sortie de DEBUG est imprime sur '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK est %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR est %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN Complete est %s . :TEXT_MSG_CURRENT_DATE#0% La date actuelle est %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Entrez une nouvelle date (mm%sjj%s[aa]aa): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Entrez une nouvelle date (jj%smm%s[aa]aa): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Entrez une nouvelle date ([aa]aa%smm%sjj): \ . :TEXT_MSG_CURRENT_TIME#0% L'heure actuelle est %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Entrez une nouvelle heure : \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% OoNn{CR}{LF}{CBREAK} aabb b b b Tous les fichiers dans '%s' vont tre dtruits ! tes-vous sr (O/N) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 OoNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Oui=ENTRE, Non=CH] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% OoNnTtQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Appui de Control-Break dtect.\r Terminer le fichier batch '%s' (Oui/Non/Tous) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% OoNnTtQq{BREAK}{ENTER}{ESC} aabbccdd d a b craser '%s' (Oui/Non/Tous/Quitter) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% OoNnTtQq{BREAK}{ENTER}{ESC} aabbccdd d a b Ajouter '%s' (Oui/Non/Tous/Quitter) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% OoNnTtQq{BREAK}{ENTER}{ESC} aabbccdd d a b Effacer '%s' (Oui/Non/Tous/Quitter) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY La pile de rpertoires est vide. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Le volume dans le lecteur %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% est %s . :TEXT_DIR_HDR_VOLUME_NONE n'a pas d'tiquette . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Le numro de srie du volume est %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s fichier(s)\ . :TEXT_DIR_FTR_BYTES#0% %12s octets . :TEXT_DIR_FTR_TOTAL_NUMBER Total des fichiers lists : . :TEXT_DIR_FTR_DIRS#1% %10s rpertoire(s)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s octets de libre . :TEXT_DIR_DIRECTORY#0% Rpertoire de %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Rpertoire de %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Aucun chemin de recherche dfini. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Dim\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Lun\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Mar\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Mer\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Jeu\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Ven\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sam\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 aucun fichier effac. . :TEXT_MSG_DEL_CNT_FILES_1#1 un fichier effac. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u fichiers effacs. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Commandes internes disponibles : . :TEXT_MSG_SHOWCMD_FEATURES Fonctionnalits prsentes : . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [alias] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [saisie tendue] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [historique] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [compltion des noms de fichiers] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [swapping] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [commencer la journalisation] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [dernier rpertoire] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [longs noms de fichiers] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [swap noyau] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [swap XMS] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [swap par dfaut] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [commandes installables] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [pile de rpertoires (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [dbogage FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Appuyez sur F8 pour le mode pas--pas, ou sur F5 pour passer %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Contournement de '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS version %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Noyau FreeDOS (build 1933 ou plus rcent) . :TEXT_MSG_VER_LATER_FREEDOS#0% Version du noyau FreeDOS : %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman et d'autres. Ce programme est distribu dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE, ni explicite ni implicite, y compris les garanties de commercialisation ou d'adaptation dans un but spcifique. Prenez connaissance de la Licence Publique Gnrale GNU pour plus de dtails. Envoyez les rapports de bugs freedos-devel@lists.sourceforge.net. Les mises jour sont disponibles sur https://github.com/FDOS/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman et d'autres. Ce programme est libre, vous pouvez le redistribuer et/ou le modifier selon les termes de la Licence Publique Gnrale GNU publie par la Free Software Foundation (version 2 ou bien toute autre version ultrieure choisie par vous). Envoyez les rapports de bugs freedos-devel@lists.sourceforge.net. Les mises jour sont disponibles sur https://github.com/FDOS/freecom . :TEXT_MSG_VER_DEVELOPERS Le shell de commandes FreeDOS est dvelopp par de nombreux dveloppeurs, consultez le fichier HISTORY.TXT attach. Envoyez les rapports de bugs freedos-devel@lists.sourceforge.net. Les mises jour sont disponibles sur https://github.com/FDOS/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Le shell est sur le point d'tre termin, bien que cela soit interdit\r (habituellement par la spcification de l'option "/P")\r Vous devez relancer le systme ou, si le shell fonctionne dans un\r environnement multitche, terminer la tche manuellement.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Excutable FreeCOM non trouv. Vous devez spcifier le chemin complet vers COMMAND.COM comme premier argument de COMMAND, par exemple : C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Segment d'environnement : max %5u octets ; %5u octets libres . :TEXT_MEMORY_CONTEXT#1% Segment de contexte : max %5u octets ; %5u octets libres . :TEXT_MEMORY_HEAP#1% Mmoire du tas : %5lu octets disponibles . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliases : limite %5u octets, actuel %5u octets, %5u lments . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistorique : limite %5u octets, actuel %5u octets, %5u lments . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tPile rpert. : limite %5u octets, actuel %5u octets, %5u lments . :TEXT_MEMORY_CTXT_LASTDIR#1% \tCache rpert.: %5u octets utiliss, %5u lments . :TEXT_MEMORY_CTXT_BATCH#1% \tEmpilement bat : %5u octets utiliss, %5u lments . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : %5u octets utiliss, %5u lments . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Impossible d'identifier la page de code actuelle depuis le systme. . :TEXT_ERROR_SET_CODEPAGE#1 Le changement de page de code en cours a chou. . :TEXT_DISPLAY_CODEPAGE#1% La page de code actuelle est %u. La page de code systme est : %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Affiche, dtermine ou enlve les alias ALIAS [variable[=][chane]] variable Spcifie le nom de l'alias chane Spcifie la chane de caractres qui activera l'alias. Tapez ALIAS sans paramtres pour afficher les alias actuels. . :TEXT_CMDHELP_BEEP Gnre un bip sonore. . :TEXT_CMDHELP_BREAK Active ou dsactive l'usage de CTRL+C. BREAK [ON | OFF] Tapez BREAK sans paramtres pour afficher le statut actuel de BREAK. . :TEXT_CMDHELP_CALL#1 Excute un fichier batch partir d'un autre fichier batch. CALL [/S | /N] [/Y] [lecteur:][chemin]fichier [paramtres batch] paramtres batch Spcifie les paramtres du fichier batch invoquer. /S force, /N renie le swapping de FreeCOM. /Y active le traage pendant l'excution de la commande. . :TEXT_CMDHELP_CD Change de rpertoire ou affiche le nom du rpertoire en cours. CHDIR [lecteur:][chemin] CHDIR[..] CD [lecteur:][chemin] CD[..] CD - .. Indique que vous souhaitez changer vers le rpertoire-parent. - Si l'option "dernier rpertoire" est active, change vers le dernier rpertoire. Tapez CD lecteur: pour afficher le rpertoire en cours sur le lecteur spcifi. Tapez CD sans paramtres pour afficher le lecteur et rpertoire actuels. Regardez aussi : CDD . :TEXT_CMDHELP_CDD Affiche le nom ou change le rpertoire et le lecteur en cours. CDD [lecteur:][chemin] CDD[..] .. Change vers le rpertoire parent. - Si l'option "dernier rpertoire" est active, revient au dernier rpertoire. Si lecteur: est spcifi, le lecteur en cours est chang ; c'est la seule diffrence avec "CHDIR". Tapez CD sans paramtres pour afficher le lecteur et rpertoire en cours. . :TEXT_CMDHELP_CHCP Affiche ou dfinit la page de code en cours. CHCP [nnn] nnn Indique le numro de page de code. Tapez CHCP sans paramtres afin d'afficher la page de code en cours. . :TEXT_CMDHELP_CLS Nettoie l'cran. CLS . :TEXT_CMDHELP_COMMAND Dmarre une nouvelle copie du shell de commande de FreeDOS. COMMAND [[lecteur:]chemin] [appareil] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] commande]] [drive:]path Spcifie le rpertoire contenant COMMAND.COM. device Spcifie le dispositif pour l'entre et sortie de commandes. /E:nnnnn Dfinit la taille initiale d'environnement nnnnn octets. (nnnnn devrait tre entre 256 et 32.768). /L:nnnn Spcifie la taille des tampons internes (ncessite /P aussi). (nnnn devrait tre entre 128 et 1.024). /U:nnn Spcifie la taille du tampon d'entre (ncessite /P aussi). (nnn devrait tre entre 128 et 255). /P Rend le nouveau shell de commandes permanent (pas de sortie). /MSG Stocke tous les messages d'erreur en mmoire (ncessite /P). /LOW Force le shell de commandes garder ses donnes rsidentes dans la mmoire basse. /Y Passe par le programme batch spcifi par /C ou /K. /C command Excute la commande spcifie et retourne. /K command Excute la commande spcifie et continue de fonctionner. . :TEXT_CMDHELP_COPY Copie un ou plusieurs fichiers vers un autre emplacement. COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] [/V] [/Y | /-Y] source Spcifie le ou les fichiers copier. /A Indique un fichier texte ASCII. /B Indique un fichier binaire. destination Spcifie le rpertoire et/ou le nom du nouveau fichier. /V Vrifie que les nouveaux fichiers sont bien enregistrs. /Y Supprime la demande de confirmation de rcriture d'une destination dj existante. /-Y Force une demande de confirmation avant toute rcriture d'un fichier dj existant. Le paramtre /Y peut tre ajout la variable d'environnement COPYCMD. Ceci peut tre dsactiv en ligne de commande avec /-Y. Pour joindre des fichiers, spcifiez un seul fichier de destination mais plusieurs de source (avec des jokers ou au format file1+file2+file3). . :TEXT_CMDHELP_CTTY Change le priphrique utilis pour contrler le systme. CTTY priphrique priphrique Le priphrique que vous voulez utiliser, comme COM1. . :TEXT_CMDHELP_DATE#1 Affiche ou rgle la date. DATE [/D] [date] Tapez DATE sans paramtres pour afficher la date actuelle et une demande de nouvelle date. Appuyez sur ENTRE pour garder la mme date. /D Bloque l'interactivit de DATE. . :TEXT_CMDHELP_DEL#2 Efface un ou plusieurs fichiers. DEL [lecteur:][chemin]fichier [/P] [/V] ERASE [lecteur:][chemin]fichier [/P] [/V] [lecteur:][chemin]fichier Spcifie le/les fichier(s) effacer. Vous pouvez spcifier plusieurs fichiers l'aide de masques. /P Demande confirmation avant d'effacer chaque fichier. /V Affiche tous les fichiers effacs. . :TEXT_CMDHELP_DIR#4 Affiche une liste des fichiers et de sous rpertoires dans un rpertoire. DIR [lecteur:][chemin][nom-de-fichier] [/P] [/W] [/A[[:]attributs]] [/O[[:]ordre-de-tri]] [/S] [/B] [/L] [lecteur:][chemin][nom-de-fichier] Spcifie le lecteur, le rpertoire et/ou les fichiers lister. (Peut tre amlior spcification de fichier ou plusieurs spcs.) /P Effectue une pause aprs chaque cran d'information. /W Utilise le format de liste largie. /A Affiche les fichiers avec attributs spcifis. (Dfaut : /ADHSRA) attributs D Rpertoires R Fichiers en lecture seule H Fichiers cachs A Fichiers prts tre archivs S Fichiers systme - Prfixe signifiant non /O Liste les fichiers dans l'ordre de tri. ordre tri N Par le nome (alphabtique) S Par la taille (petits d'abord) E Par extension D Par horodatage (d'abord l'ancien) G Groupe d'abord les dossiers- Prfixe pour inverser l'ordre U Sans tri Par dfaut quivalent /ONG /S Affiche les fichiers dans le dossier spcifi et tous sous dossiers /B Utilise le format nu (pas d'en-tte ou de rsum). /L Utilise des minuscules. /Y or /4 Affiche l'anne en 4 chiffres. Les commutateurs peuvent tre rgls dans la variable d'env DIRCMD. Annuler les commutateurs prrgls en prfixant avec - (tiret)--par exemple, /-W. . :TEXT_CMDHELP_DOSKEY#1 L'utilitaire externe DOSKEY a t incorpor dans FreeCOM. Utilisez curseur HAUT & BAS pour l'historique et HISTORY pour l'afficher. Utilisez curseur GAUCHE & DROIT et les touches FIN et HOME pour naviguer dans la ligne de commande et avec INSER changez les modes insertion et crasement. Utilisez TAB pour complter le mot actuel comme nom de fichier, utilisez-le deux fois pour afficher tous les fichiers correspondants. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 dite les lignes de commande, les rappelle et cre des macros DOSKEY [/commutateur ...] [nom-de-macro=[texte]] /BUFSIZE:size Dfinit la taille de la macro et du tampon (dfaut : 512) /ECHO:on|off Active/dsactive l'cho des expansions des macros(dfaut : on) /FILE:file Spcifie un fichier contenant la liste des macros /HISTORY Affiche toutes les commandes stockes en mmoire /INSERT Insre de nouveaux caractres sur la ligne lors de la frappe /KEYSIZE:size Dfinit la taille du tampon du clavier type-ahead(dfaut:15) /LINE:size Dfinit la taille du tampon d'dition de ligne (dfaut:128) /MACROS Affiche toutes les macros DOSKEY /OVERSTRIKE crase les anciens caractres lors de la frappe (par dfaut) /REINSTALL Installe une nouvelle copie de DOSKey macroname Spcifie un nom pour la macro que vous crez text Spcifie les commandes que vous voulez assigner la macro HAUT, BAS rappellent les commandes chap efface la commande actuelle F7 affiche l'historique des commandes Alt+F7 efface l'historique des commandes [cars] F8 recherche les commandes commenant par [cars] F9 slectionne une commande en fonction du nombre Alt+F10 efface les dfinitions des macros Ci-dessous des codes spciaux utilisables dans les dfinitions de macros DOSKEY: $T Sparateur de commande : commandes multiples dans une macro $1-$9 Paramtres batch : quivalent %1-%9 dans les programmes batch $* Symbole remplac par tout ce qui suit le nom de la macro . :TEXT_CMDHELP_ECHO Affiche des messages, ou active ou dsactive l'cho des commandes. ECHO [ON | OFF] ECHO [message] Tapez ECHO sans paramtres pour afficher le rglage echo actuel. . :TEXT_CMDHELP_EXIT Quitte le shell FreeDOS sauf s'il est charg avec /P. EXIT . :TEXT_CMDHELP_FOR Excute une commande spcifie pour chaque fichier dans un jeu de fichiers. FOR %%variable IN (set) DO commande [paramtres-de-commande] %%variable Spcifie un paramtre remplaable. (set) Spcifie un jeu d'un ou plusieurs fichiers. Jokers accepts. commande Spcifie la commande excuter pour chaque fichier. paramtres-de-commande Spcifie des paramtres ou options pour la commande spcifie. Pour utiliser la commande FOR dans un programme batch, spcifiez %%%%variable au lieu de %%variable. Par exemple : FOR %%%%f IN (---dbut--- a*.* ---fin---) DO ECHO - %%%%f - . :TEXT_CMDHELP_GOTO Dirige le shell de commande vers une ligne tiquete dans un programme batch. GOTO tiquette tiquette Spcifie du texte utilis dans un batch en tant qu'tiquette. Vous tapez une tiquette sur une ligne, en commenant par un deux-points. . :TEXT_CMDHELP_HISTORY#1 Commande history. HISTORY [taille] Sans la "taille" le contenu actuel du tampon de l'historique de la ligne de commande est affiche. Avec la taille, la taille du tampon de l'historique est modifie. . :TEXT_CMDHELP_IF Effectue des traitements conditionnels dans les programmes batch. IF [NOT] ERRORLEVEL nombre commande IF [NOT] chane1==chane2 commande IF [NOT] EXIST nom-de-fichier commande NOT Spcifie que le shell de commande ne doit excuter la commande seulement si la condition est fausse. ERRORLEVEL nombre Spcifie une condition vraie si le dernier programme excut a retourn un code de sortie gal ou suprieur au nombre spcifi. commande Spcifie la commande excuter si la condition est satisfaite. chane1==chane2 Spcifie une condition vraie si les chanes de texte spcifies correspondent. EXIST nom-de-fich.Spcifie une condition vraie a si le nom de fichier spcifi existe. . :TEXT_CMDHELP_LFNFOR Active/Dsactive les noms de fichiers longs dans la commande FOR ou pour Tab. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Tapez LFNFOR ou LFNFOR COMPLETE sans paramtre pour afficher le rglage actuel de LFNFOR. . :TEXT_CMDHELP_LH Charge un programme dans la zone de mmoire haute. LOADHIGH [lecteur:][chemin]nom-de-fichier [paramtres] LOADHIGH [/L:rgion1[,taillemin1][;rgion2[,taillemin2]...] [/S]] [lecteur:][chemin]nom-de-fichier [paramtres] /L:rgion1[taillemin1][;rgion2[,taillemin2]]... Spcifie les zones de mmoire dans lesquelles charger le programme. Rgion1 spcifie le nombre de la premire zone de la mmoire ; taillemin1 spcifie la taille minimale (optionnelle) pour rgion1. Rgion2 et taillemin2 spcifient le nombre et la taille minimale de la seconde zone (optionnelle). Vous pouvez spcifier autant de zones que vous le souhaitez. /S Rtrcit un UMB sa taille minimale pendant le chargement du programme. [lecteur:][chemin]nom-de-fichier Spcifie la localisation et le nom du programme. . :TEXT_CMDHELP_LOADFIX Charge un programme au-dessus des premiers 64K de mmoire et l'excute. LOADFIX [lecteur:][chemin]nom-de-fichier Utilisez LOADFIX pour charger un programme si vous avec reu le message "Fichier compress corrompu" lorsque vous le chargez dans la mmoire basse. . :TEXT_CMDHELP_MD Cre un rpertoire. MKDIR [lecteur:]chemin MD [lecteur:]chemin . :TEXT_CMDHELP_PATH Affiche ou dfinit un chemin de recherche pour les fichiers excutables. PATH [[lecteur:]chemin[;...]] PATH ; Tapez PATH ; pour effacer tous les rglages de recherche et forcer le shell de commande rechercher uniquement dans le rpertoire courant. Tapez PATH sans paramtres pour afficher le chemin actuel. . :TEXT_CMDHELP_PAUSE Suspend le traitement d'un programme batch et affiche le message : "Appuyez sur une touche pour continuer...." ou un message optionnel spcifi. PAUSE [message] . :TEXT_CMDHELP_PROMPT Modifie l'invite de commande. PROMPT [texte] texte Spcifie une nouvelle invite de commande. L'invite peut tre constitue de caractres normaux et des codes spciaux suivants : $Q = (signe d'galit) $$ $ (signe du dollar) $T Heure actuelle $D Date actuelle $P Lecteur et chemin actuels $V nombre de version du shell de commande de FreeDOS $N Lecteur actuel $G > (signe de supriorit) $L < (signe d'infriorit) $B | (pipe) $H Retour arrire (efface le caractre prcdent) $E Code d'chappement (code ASCII 27) $_ Retour charriot et avance d'une ligne Tapez PROMPT sans paramtre pour remettre zro le rglage de l'invite. . :TEXT_CMDHELP_PUSHD Pousse le rpertoire courant dans la pile de rpertoires, avec la possibilit de modifier le rpertoire de travail courant. PUSHD [[lecteur:]chemin] O [lecteur:]chemin est le chemin pour lequel vous souhaitez changer. . :TEXT_CMDHELP_POPD Affiche un rpertoire de la pile de rpertoires et y apporte des modifications. POPD [*] Le paramtre '*' nettoie la pile de rpertoires. . :TEXT_CMDHELP_DIRS Affiche le contenu de la pile de rpertoires. DIRS . :TEXT_CMDHELP_RD Efface un rpertoire. RMDIR [lecteur:]chemin RD [lecteur:]chemin . :TEXT_CMDHELP_REM Enregistre des commentaires (remarques) dans un fichier batch ou CONFIG.SYS. REM [commentaire] . :TEXT_CMDHELP_REN Renomme un fichier/rpertoire ou des fichiers/rpertoires. RENAME [lecteur:][chemin][nomrp1 | nomfichier1] [nomrp2 | nomfichier2] REN [lecteur:][chemin][nomrp1 | nomfichier1] [nomrp2 | nomfichier2] Notez que vous ne pouvez pas spcifier un nouveau lecteur ou chemin pour votre destination. Utilisez la commande MOVE pour cela. . :TEXT_CMDHELP_SET#1 Affiche, dfinit ou enlve des variables d'environnement. SET [/C] [/P] [/E] [/U] [variable=[chane]] variable Spcifie le nom de la variable d'environnement. chane Spcifie une srie de caractres assigner la variable. * Si aucune chane n'est spcifie, la variable est enleve de l'environnement. Tapez SET sans paramtres pour afficher les variables d'environnement actuels. Tapez SET VAR pour afficher la valeur de VAR /C force conserver la casse de la variable, par dfaut la variable est en majuscules s'il ne se trouve pas dj dans l'environnement, sinon la casse est garde. /P demande une chane, et assigne l'entre de l'utilisateur la variable. /E rgle la variable donne la premire ligne de la sortie de la commande souligne par [chane]. /U modifie la casse de [chane] en majuscules. . :TEXT_CMDHELP_SHIFT#1 Modifie la position des paramtres remplaables dans un fichier batch. SHIFT [DOWN] DOWN dplace la fentre d'argument vers le dbut (%%0) ; sinon vers la fin. . :TEXT_CMDHELP_TIME#1 Affiche ou dfinit l'heure du systme. TIME [/T] [heure] Tapez TIME sans paramtre pour afficher l'heure actuelle et une invite pour entrez une nouvelle heure. Appuyez sur ENTRE pour garder l'heure. /T empche TIME de devenir interactif. . :TEXT_CMDHELP_TRUENAME Affiche le nom de chemin complet du chemin spcifi. TRUENAME [lecteur:][chemin][nom-de-fichier] . :TEXT_CMDHELP_TYPE Affiche le contenu d'un fichier texte. TYPE [lecteur:][chemin]fichier . :TEXT_CMDHELP_VER Affiche la version du shell FreeDOS et d'autres informations. VER [/R] [/W] [/D] [/C] /R Montre la version du noyau et d'autres informations. /W Garantie du shell FreeDOS. /D Informations sur la redistribution du shell FreeDOS. /C Contributeurs du shell FreeDOS. . :TEXT_CMDHELP_VERIFY Indique au systme de fichiers FreeDOS s'il doit vrifier si vos fichiers sont correctement crits sur un disque. VERIFY [ON | OFF] Tapez VERIFY sans paramtre pour afficher l'tat actuel du rglage de VERIFY. . :TEXT_CMDHELP_FDDEBUG Si le dbogage est compil dans FreeDOS, cette commande activera ou dsactivera la sortie de dbogage, ou vous dira si elle est active ou dsactive. FDDEBUG [ON | OFF | fichier] Tapez FDDEBUG sans paramtre pour afficher le rglage actuel de sortie de dbogage. Si un fichier est spcifi toute la sortie de dbogage est fait dans ce fichier ; la sortie est ajoute au fichier, s'il existe dj. Les noms spciaux "stdout" et "stderr" peuvent tre utiliss pour rediriger la sortie vers la sortie standard ou le flux d'erreurs standard. . :TEXT_CMDHELP_VOL Affiche l'tiquette du volume ainsi que le numro de srie, s'ils existent. VOL [lecteur:] . :TEXT_CMDHELP_QUESTION#1 Affiche une liste des commandes et des fonctions disponibles dans le shell. ? ?commande [argument] La premire variante affiche toutes les commandes et fonctions internes. La seconde demandera s'il faut ou non excuter la commande spcifie comme si le mode trace tait actif. . :TEXT_CMDHELP_WHICH Recherche et affiche le fichier excutable pour chaque commande spcifie. WHICH commande... . :TEXT_CMDHELP_MEMORY#1 Affiche la mmoire interne utilise par FreeCOM en interne. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 La destination de COPY ne doit pas contenir des caractres plus ('+'). . :TEXT_DELETE_FILE#1% Effacement du fichier "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Impossible d'crire sur le fichier '%s' ; le disque serait-il satur ? (%lu octets requis) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% %luKo/???Ko copis \r\ . :TEXT_COPY_COPIED#0% %luKo/%luKo copis\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM ne peut pas tre un appareil : "%s" . :TEXT_ERROR_FCOM_INVALID#0% Ce fichier FreeCOM n'est pas valide ou provient d'une version incompatible : %s . :TEXT_ERROR_LOADING_STRINGS chec du chargement la ressource des chanes dans la mmoire, l'endroit indiqu dans %COMSPEC% semble tre invalide. Veuillez spcifier une autre localisation de FreeCOM pour tenter de charger les chanes, par exemple : C:\\COMMAND.COM ou appuyez simplement sur entre pour annuler le chargement des chanes. . :TEXT_TERMINATING Arrt maintenant. . :TEXT_HIDDEN_CRITER#0% %u requtes d'erreur critique ont t supprimes. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Code de sortie (ERRORLEVEL) : %u, raison : %u (%s) . :TEXT_EXIT_REASON_NEG_1 Erreur d'API DOS\ . :TEXT_EXIT_REASON_0 termin normalement\ . :TEXT_EXIT_REASON_1 termin par ^Break\ . :TEXT_EXIT_REASON_2 termin par une erreur critique\ . :TEXT_EXIT_REASON_3 devenu rsident\ . :TEXT_ERROR_EXE_CORRUPT fichier EXE corrompu\ . ================================================ FILE: strings/german.err ================================================ # $Id$ # # Critical error national customization file # # Language: German # Author: Steffen Kaiser (ska-src@gmx.net) # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Fehler %1 Laufwerk %A: im %2-Bereich: %3 S3 CHAR_DEVICE: Fehler %1 Gert %A: %3 ## kind of operation S0 READ: beim Lesen von S1 WRITE: beim Schreiben auf ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: Verzeichnis S7 DATA: Daten ## action strings S8 IGNORE: (I)gnorieren S9 RETRY: (W)iederholen S10 ABORT: (A)bbrechen S11 FAIL: (F)ehler ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: wW KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Unbekannter Fehler S15 0: Laufwerk ist schreibgeschtzt 1: Unbekannte Treiberuntereinheit 2: Gert nicht bereit 3: Treiber erhielt ein unbekanntes Kommando 4: Daten- bzw. CRC-Fehler 5: Inkorrekte Lnge der Treiberkommandostruktur 6: Positionierungsfehler 7: Unbekannter Medientyp 8: Sektor wurde nicht gefunden 9: Papier zu Ende 10: Allgemeiner Schreibfehler 11: Allgemeiner Lesefehler 12: Allgemeiner Fehler 13: Verletzung der SHARE-Rechte 14: Lock-Verletzung 15: inkorrekter Medienwechsel 16: Zugriff auf FCB verweigert 17: berlauf des SHARE-Puffers 18: unterschiedliche Codepages 19: Ende der Eingabe erreicht 20: Laufwerk voll ================================================ FILE: strings/german.lng ================================================ # FreeCOM national customization file # # Language: German # Codepage: 858 (850 plus Euro currency sign) # Author: Clemens Lser (Cl.Loeser@web.de) # Changelog by W. Spiegl (2024-12-21). # TEXT_CMDHELP_IF: added /I string==STRING # TEXT_CMDHELP_ECHO: added ECHO. # TEXT_CMDHELP_SHIFT: removed (%0) "the beginning (%0); otherwise" (?). # Changelog by W. Spiegl (2024-10-15): # "FOR - Example: replaced %% by %%%%" # 2022-01-19 / 2022-06-01 by W. Spiegl: corrected: line 287, "Eigabe", 311 "ngltig", # 434 "Speicherpatz", 439 "Speicherpaltz", # 1121 "Dienstrogramm", 1395 "richtung", 1405 "double space", # 1456 "Standart" by W. Spiegl. # modified the line breaks of command, del, dir, erase, history, if, # lh, loadhigh, set and memory (second fixes by W. Spiegl: 2024-10-13) # Added a lot of test: TEXT_ERROR_PERMISSION_DENIED, TEXT_ERROR_NO_SUCH_FILE, # TEXT_ERROR_UNKNOWN_ERROR, TEST_MSG_LFNFOR_STATE, TEST_MSG_LFNFOR_COMPLETE_STATE, # PROMPT_APPEND_FILE, TEXT_SHOWCMD_FEATURE_LONG_FILENAMES, TEXT_CMDHELP_LFNFOR, # TEXT_CMDHELP_SET, TEXT_TERMINATING, TEXT_HIDDEN_CRITER, TEXT_DISP_EXITCODE, # TEXT_EXIT_REASON_NEG1, TEXT_EXIT_REASON_0 till _3, TEXT_ERROR_EXE_CORRUPT # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Falscher Parameter. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Falscher Parameter. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Ungltige Option: '%s' . :TEXT_ERROR_OPT_ARG#0% Option '%s' erfordert keine Parameter. . :TEXT_ERROR_OPT_NOARG#0% Option '%s' erfordert einen Parameter. . :TEXT_INVALID_NUMBER#0% Ungltige Nummer in '%s'. . :TEXT_ERROR_CLOSE_QUOTE#0% Schlieendes Anfhrungszeichen fehlt: %c . :TEXT_ERROR_TEMPFILE Kann temporre Datei nicht erstellen. . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Zu viele Parameter. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Zu viele Parameter. . :TEXT_ERROR_INVALID_PARAMETER#0% Ungltiger Parameter. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Pfad nicht gefunden. . :TEXT_ERROR_FILE_NOT_FOUND Datei nicht gefunden. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Datei nicht gefunden. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Erforderlicher Parameter fehlt. . :TEXT_ERROR_INVALID_DRIVE#0% Ungltiges Laufwerk %c:. . :TEXT_ERROR_BADCOMMAND#2% Befehl oder Dateiname nicht gefunden. - "%s" . :TEXT_ERROR_OUT_OF_MEMORY Nicht gengend Speicher. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Zuteilung von DOS-Speicher fehlgeschlagen. . :TEXT_ERROR_CANNOTPIPE Kann keine Pipe erstellen! Kann temporre Datei nicht ffnen! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Zeile Nr. %ld in Stapeldatei '%s' zu lang. . :TEXT_ERROR_BFILE_VANISHED#0% Stapeldatei '%s' nicht gefunden. . :TEXT_ERROR_BFILE_LABEL#0% Stapeldatei '%s' enthlt keine Sprungmarke '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s ist fr '%s' fehlgeschlagen. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Kann Umgebungsvariable '%s' nicht setzen. Umgebung voll? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Umgebungsvariable '%s' nicht gefunden. . :TEXT_ERROR_NO_ENVIRONMENT Keine Umgebung verfgbar. Mgliche Ursache: Nicht gengend Speicher verfgbar. Setzen Sie die Umgebungsgre durch die COMMAND.COM Option '/E'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Kann Alias '%s' nicht setzen. Aliasspeicher voll? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' nicht gefunden. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Kein Aliasspeicher verfgbar. Mgliche Ursache: Nicht gengend Speicher verfgbar. . :TEXT_ERROR_SYNTAX_STR#0% Syntaxfehler. - '%s' . :TEXT_ERROR_SYNTAX Syntaxfehler. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Dateiname zu lang. - '%s' . :TEXT_ERROR_SELFCOPY#0% Datei '%s' kann nicht auf sich selbst kopiert werden. . :TEXT_ERROR_COMMAND_TOO_LONG Befehlszeile nach Aliaserweiterung zu lang! . :TEXT_ERROR_LINE_TOO_LONG Befehlszeile zu lang. Kann Befehl nicht ausfhren. . :TEXT_ERROR_HISTORY_SIZE#1% Ungltige History-Gre '%s'. . :TEXT_HISTORY_EMPTY#1 Befehlszeilen-History ist leer. . :TEXT_ERROR_BAD_MCB_CHAIN Ungltige MCB-Kette oder MS-DOS inkompatibles System. . :TEXT_ERROR_UNDEFINED_ERROR#0% Unbekannter Fehler %d aufgetreten. . :TEXT_ERROR_REGION_WARNING#0% Ungltiger Speicherbereich %d. Wird ignoriert. . :TEXT_ERROR_ON_OR_OFF Bitte verwenden Sie /ON oder /OFF. . :TEXT_ERROR_BAD_VARIABLE Ungltige Variablenangabe. . :TEXT_ERROR_IN_MISSING#1 IN fehlt in der FOR-Anweisung. . :TEXT_ERROR_MISSING_PARENTHESES#1 Eine oder beide Klammern fehlen. . :TEXT_ERROR_DO_MISSING#1 DO fehlt in der FOR-Anweisung. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR-Anweisung: Kein Befehl nach DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Kann Eingabe von Datei '%s' nicht umleiten. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Kann Eingabe in Datei '%s' nicht umleiten. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Leere Umleitung. . :TEXT_ERROR_INVALID_DATE Ungltiges Datum. . :TEXT_ERROR_INVALID_TIME Ungltige Zeit. . :TEXT_ERROR_NO_GOTO_LABEL GOTO bentigt eine Sprungmarkenangabe. . :TEXT_CTTY_NOTIMPLEMENTED Der CTTY-Befehl wurde nicht in diese COMMAND.COM implementiert. . :TEXT_ERROR_NORW_DEVICE#0% Ungltiges oder kein Lese-/Schreib-Gert '%s'. . :TEXT_ERROR_CTTY_DUP#0% nderung der Dateibeschreibung zu TTY '%s' fehlgeschlagen. . :TEXT_ERROR_L_NOTIMPLEMENTED Parameter /L ist noch nicht implementiert. . :TEXT_ERROR_U_NOTIMPLEMENTED Parameter /U ist noch nicht implementiert. . :TEXT_ERROR_WRITING_DEST Fehler beim Schreiben. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Kann Quelle nicht ffnen. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Kann Datei '%s' nicht ffnen. . :TEXT_ERROR_READ_FILE#0% Kann nicht von Datei '%s' lesen. . :TEXT_ERROR_WRITE_FILE#0% Kann nicht auf Datei '%s' schreiben. . :TEXT_ERROR_LEADING_PLUS Der Verkettungsoperator '+' kann den Parametern nicht voranstehen. . :TEXT_ERROR_TRAILING_PLUS Der Verkettungsoperator '+' kann den Parametern nicht nachstehen. . :TEXT_ERROR_NOTHING_TO_DO Nichts zu tun. . :TEXT_ERROR_COPY COPY fehlgeschlagen. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: Dateiname fehlt. . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: Nummer fehlt. . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: Ungltige Nummer. . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Befehl fehlt. . :TEXT_NOT_IMPLEMENTED_YET Noch nicht implementiert. . :TEXT_FAILED_LOAD_STRINGS Fehler beim Laden der Sprachnachrichten. . :TEXT_MSG_NOTIMPLEMENTED Die /MSG Option wurde in dieser COMMAND.COM deaktiviert. . :TEXT_MSG_ITEMS_DISPLAYED#1 %u Elemente angezeigt. . :TEXT_CORRUPT_COMMAND_LINE Ein interner Fehler ist aufgetreten. Dies hat mit dem System zu tun auf dem COMMAND.COM luft. Bitte melden Sie diesen Fehler. . :TEXT_QUOTED_C_OR_K#1 Die Optionen /C und /K knnen nicht quotiert werden. Optionen werden ignoriert. . :TEXT_INIT_FULLY_QUALIFIED#1% Der Pfad zur COMMAND.COM muss vollstndig angegeben werden. Das heit mit Laufwerksbuchstabe und fhrendem Backslash. Zum Beispiel: C:\\FREEDOS COMMAND.COM geht von folgendem Pfad aus: %s . :TEXT_ERROR_RESTORE_SESSION Die Sitzungsinformationen konnten nicht wiederhergestellt werden. Alle lokalen Einstellungen sind verloren. Hinweise auf die Ursache dieses Problems entnehmen Sie bitte den vorangegangenen Fehlermeldungen. . :TEXT_ERROR_SAVE_SESSION Die aktuellen Informationen konnten whrend des Programmaufrufs nicht gesichert werden. Hinweise auf die Ursache dieses Problems entnehmen Sie bitte den vorangegangenen Fehlermeldungen. . :TEXT_ERROR_CWD_FAILED#1% Laufwerk %c: Keine Antwort oder interner Speicherfehler. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Tausch fehlgeschlagen: Aliase reservieren zu viel Speicher. . :TEXT_ERROR_KSWAP_ALLOCMEM Tausch fehlgeschlagen: Kann keinen weiteren Speicherplatz reservieren. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Kein weiterer Aliasspeicherplatz verfgbar. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Alias '%s' unbekannt. . :TEXT_ERROR_ALIAS_INSERT#1 Einfgen des Alias fehlgeschlagen. . :TEXT_ALIAS_INVALID_NAME#1% Aliasname '%s' ungltig. . :TEXT_ERROR_LOADING_CONTEXT#1 Kontextmodul der Ausnahmefehlerroutine kann nicht geladen werden. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Kein weiterer Kontextspeicher verfgbar. Falls dieser Fehler weiterhin auftritt ziehen Sie bitte in Erwgung die internen Puffer wie z.B. History, Dateiverzeichnis oder Stack zu vergrern. . :TEXT_ERROR_CONTEXT_LENGTH#1 Die Gesamtkontextgre %lu Bytes berschreitet die Maximalgrenze. Der Kontext wird auf %u Bytes reduziert. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Das Einfgen von Statusinformationen in den Kontext ist fehlgeschlagen. Dieser Fehler kann auf Speicherfehler oder eine falsch bestimmte Minimalgre des Kontexts hindeuten. Bitte benachrichtigen Sie die Verantwortlichen von FreeCOM: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Der Kontext ging beim Tauschen verloren. Der Kontext wird neu erstellt, aber alle Aliase etc. sind verloren. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Erlaubnis verweigert. . :TEXT_ERROR_NO_SUCH_FILE#1% %s: Datei oder Verzeichnis existiert nicht. . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Unbekannter Fehler. . # # Informational messages # :TEXT_MSG_PAUSE#1 Drcken Sie eine beliebige Taste, um fortzufahren...\ . :TEXT_MSG_HISTORY_SIZE#0% Die Gre der History betrgt %d Bytes. . :TEXT_MSG_DOSKEY Die DOSKey Fhigkeiten sind bereits in der Shell freigegeben. . :TEXT_MSG_ECHO_STATE#0% ECHO ist %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY ist %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG-Ausgabe ist %s. . :TEXT_MSG_FDDEBUG_TARGET#0% DEBUG-Ausgabe wird nach '%s' geleitet. . :TEXT_MSG_BREAK_STATE#0% BREAK ist %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR ist %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN Complete ist %s . :TEXT_MSG_CURRENT_DATE#0% Aktuelles Datum ist %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Geben Sie ein neues Datum (mm%sdd%s[cc]yy) ein: \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Geben Sie ein neues Datum (dd%smm%s[cc]yy) ein: \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Geben Sie ein neues Datum ([cc]yy%smm%sdd) ein: \ . :TEXT_MSG_CURRENT_TIME#0% Aktuelle Zeit ist %s. . :TEXT_STRING_PM#1 PM\ . :TEXT_STRING_AM#1 AM\ . :TEXT_MSG_ENTER_TIME#1 Geben Sie die neue Zeit ein: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% JjNn{CR}{LF}{CBREAK} aabb b b b Alle Dateien in '%s' werden gelscht! Mchten Sie fortfahren (J/N) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 JjNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Ja=ENTER, Nein=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be # prefixed by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% JjNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Steuerung+Pause gedrckt.\r Verarbeitung der Stapeldatei '%s' abbrechen (Ja/Nein/Alle) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% JjNnAaSs{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' berschreiben (Ja/Nein/Alle/Stoppen) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% JjNnAaSs{BREAK}{ENTER}{ESC} aabbccdd d a b Anwenden auf '%s' (Ja/Nein/Alle/Stoppen) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% JjNnAaSs{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' lschen (Ja/Nein/Alle/Stoppen) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Dateiverzeichnis-Stack ist leer. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Volumen in Laufwerk %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% ist %s . :TEXT_DIR_HDR_VOLUME_NONE hat keine Bezeichnung . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Volumen-Seriennummer ist %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s Datei(en)\ . :TEXT_DIR_FTR_BYTES#0% %12s Bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Gesamtanzahl der aufgelisteten Dateien: . :TEXT_DIR_FTR_DIRS#1% %10s Verzeichnis(se)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s Bytes frei . :TEXT_DIR_DIRECTORY#0% Verzeichnis von %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Verzeichnis von %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Kein Suchpfad angegeben. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 So\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Mo\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Di\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Mi\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Do\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Fr\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sa\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 keine Datei entfernt. . :TEXT_MSG_DEL_CNT_FILES_1#1 eine Datei entfernt. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u Dateien entfernt. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Verfgbare interne Befehle: . :TEXT_MSG_SHOWCMD_FEATURES Verfgbare Befehle: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [Aliase] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [erweiterte Eingabe] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [History] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [Dateinamenergnzung] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [Tauschen (Swapping)] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [Protokollierung starten] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [vorheriges Verzeichnis] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [lange Dateinamen] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [Kernel Tausch (Swap)] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS Tausch (Swap)] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [Swap als Voreinstelung] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [installierbare Befehle] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [Dateiverzeichnis-Stack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM Fehlersuche (Debug)] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Drcken Sie F8 fr den Einzelschritt-Modus, oder F5 um %s zu bergehen... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% bergehe '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS Version %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS Kernel (build 1933 oder frher) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS Kernel Version %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman und andere. Dieses Programm wird in der Hoffnung vertrieben, dass es ntzlich ist, jedoch OHNE JEGLICHE GEWHR; ohne auch nur die implizierte Gewhr der MARKTGNGIGKEIT oder TAUGLICHKEIT FR EINEN BESTIMMTEN ZWECK. Bitte lesen Sie die GNU General Public License fr nhere Informationen hierzu. Bitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net. Updates sind unter http://freedos.sourceforge.net/freecom erhltlich. . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman und andere. Dieses Programm ist freie Software. Sie knnen es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation verffentlicht, weitergeben und/oder modifizieren, entweder gem Version 2 der Lizenz oder (nach Ihrer Option) jeder spteren Version. Bitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net. Updates sind unter http://freedos.sourceforge.net/freecom erhltlich. . :TEXT_MSG_VER_DEVELOPERS Die FreeDOS Command Shell wurde von vielen Entwicklern entwickelt, fr nhere Informationen greifen Sie bitte auf die Datei HISTORY.TXT zurck. Bitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net. Updates sind unter http://freedos.sourceforge.net/freecom erhltlich. . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Die Shell ist dabei, beendet zu werden, obwohl unerlaubt\r (blicherweise durch das Aktivieren der /P Option).\r Sie mssen Ihr System neustarten oder beenden Sie, falls\r diese Shell in einer Multitasking-Umgebung luft, diesen\r Prozess manuell.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Ausfhrbare FreeCOM Datei nicht gefunden. Sie mssen den vollen Pfad zur COMMAND.COM als ersten Parameter von COMMAND angeben, z.B. C:\\FREEDOS . :TEXT_MEMORY_ENVIRONMENT#1% Umgebungs-Segment : max %5u Bytes; frei %5u Bytes . :TEXT_MEMORY_CONTEXT#1% Kontext-Segment : max %5u Bytes; frei %5u Bytes . :TEXT_MEMORY_HEAP#1% Heap : frei %5lu Bytes . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliase : Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistory : Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tDateivz-Stack: Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente . :TEXT_MEMORY_CTXT_LASTDIR#1% \tVorheriger-Verz-Cache : gebraucht %5u Bytes, %5u Elemente . :TEXT_MEMORY_CTXT_BATCH#1% \tStapel-Verschachtelung: gebraucht %5u Bytes, %5u Elemente . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : gebraucht %5u Bytes, %5u Elemente . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Anlegen der aktuellen Codepage durch das System fehlgeschlagen. . :TEXT_ERROR_SET_CODEPAGE#1 nderung der aktuellen Codepage fehlgeschlagen. . :TEXT_DISPLAY_CODEPAGE#1% Aktuelle Codepage ist %u. Die richtige System-Codepage ist %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Zeigt an, setzt oder entfernt Aliase. ALIAS [Variable[=][Zeichenkette]] Variable Spezifiziert den Aliasnamen. Zeichenkette Spezifiziert eine Reihe von Zeichen, die dem Alias zugeordnet werden. Geben Sie ALIAS ohne Parameter ein, um die aktuellen Aliase anzuzeigen. . :TEXT_CMDHELP_BEEP Beep-Ton ausgeben. . :TEXT_CMDHELP_BREAK Setzt oder lscht die erweiterte STRG+C berprfung. BREAK [ON | OFF] Geben Sie BREAK ohne Parameter ein, um die aktuelle BREAK Einstellung anzuzeigen. . :TEXT_CMDHELP_CALL#1 Ruft ein Stapelverarbeitungsprogramm von einem anderen aus auf. CALL [/S | /N] [/Y] [Laufwerk:][Pfad]Dateiname [Stapeldatei-Parameter] Stapeldatei-Parameter Spezifiziert alle vom Stapelprogramm bentigten Befehlszeilen-Informationen. /S erzwingt, /N verweigert das Swappen von FreeCOM. /Y aktiviert den Einzelschritt-Modus whrend der Ausfhrung des Befehls. . :TEXT_CMDHELP_CD Zeigt den Namen oder wechselt das aktuelle Verzeichnis. CHDIR [Laufwerk:][Pfad] CHDIR[..] CD [Laufwerk:][Pfad] CD[..] CD - .. Spezifiziert, dass Sie zum bergeordneten Verzeichnis wechseln mchten. - Falls das "vorheriges Verzeichnis"-Feature aktiviert ist, Wechsel zum vorherigen Verzeichnis. Geben Sie CD Laufwerk: ein, um das aktuelle Verzeichnis des angegebenen Laufwerks anzuzeigen. Geben Sie CD ohne Parameter ein, um das aktuelle Laufwerk und Verzeichnis anzuzeigen. Siehe auch: CDD . :TEXT_CMDHELP_CDD Zeigt den Namen oder wechselt das aktuelle Verzeichnis und Laufwerk. CDD [Laufwerk:][Pfad] CDD[..] .. Spezifiziert, dass Sie zum bergeordneten Verzeichnis wechseln mchten. - Falls das "vorheriges Verzeichnis"-Feature aktiviert ist, Wechsel zum vorherigen Verzeichnis. Falls Laufwerk: angegeben ist, wird das aktuelle Arbeitslaufwerk gewechselt; dies ist der einzige Unterschied zu "CHDIR". Geben Sie CDD ohne Parameter ein, um das aktuelle Laufwerk und Verzeichnis anzuzeigen. . :TEXT_CMDHELP_CHCP Zeigt oder setzt die Nummer der aktiven Codepage. CHCP [nnn] nnn Spezifiziert eine Codepage-Nummer. Geben Sie CHCP ohne Parameter ein, um die Nummer der aktiven Codepage anzuzeigen. . :TEXT_CMDHELP_CLS Lscht den Bildschirm. CLS . :TEXT_CMDHELP_COMMAND Startet eine neue Instanz der FreeDOS Command Shell. COMMAND [[Laufwerk:]Pfad] [Gert] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] Befehl]] [Laufwerk:]Pfad Spezifiziert das Verzeichnis, das die COMMAND.COM enthlt. Gert Spezifiziert das fr die Befehls - Ein- und Ausgabe zu benutzende Gert. /E:nnnnn Setzt die anfngiche Umgebungsgre auf nnnnn Bytes. (nnnnn sollte eine Zahl zwischen 256 und 32.768 sein.) /L:nnnn Spezifiziert die Gre der internen Puffer (braucht /P). (nnnn sollte eine Zahl zwischen 128 und 1.024 sein.) /U:nnn Spezifiziert die Eingabepuffergre (erfordert ebenso /P). (nnn sollte eine Zahl zwischen 128 und 255 sein.) /P Richtet die neue Command Shell Instanz dauerhaft ein (kann nicht beendet werden). /MSG Speichert alle Fehlermeldungen im Speicher (braucht /P). /LOW Zwingt Command Shell, bleibende Daten im LoMem zu speichern. /Y Arbeitet schrittweise die durch /C oder /K spezifizierten Stapelverarbeitungsdateien ab. /C Befehl Fhrt den spezifizierten Befehl aus und kehrt zurck. /K Befehl Fhrt den spezifizierten Befehl aus und luft weiter. . :TEXT_CMDHELP_COPY Kopiert eine oder mehrere Dateien an einen anderen Ort. COPY [/A | /B] Quelle [/A | /B] [+ Quelle [/A | /B] [+ ...]] [Ziel [/A | /B]] [/V] [/Y | /-Y] Quelle Spezifiziert die zu kopierende(n) Datei(en). /A Gibt an, dass es sich um eine ASCII Textdatei handelt. /B Gibt an, dass es sich um eine Binrdatei handelt. Ziel Spezifiziert das Verzeichnis und/oder den Dateinamen fr die neue(n) Datei(en). /V Verifiziert, dass neue Dateien korrekt geschrieben werden. /Y Unterdrckt Besttigungsabfragen fr das berschreiben bereits existierender Zieldateien. /-Y Bewirkt, dass das berschreiben bereits existierender Zieldateien besttigt werden muss. Die /Y Option kann in der COPYCMD Umgebungsvariable voreingestellt sein. Dies kann mit /-Y in der Befehlszeile bergangen werden. Um Dateien hinzuzufgen geben Sie eine einzelne Datei als Ziel und mehrere Dateien als Quelle ein. Benutzen Sie hierzu Wildcards oder das Format Datei1+Datei2+Datei3. . :TEXT_CMDHELP_CTTY Wechselt das Terminalgert, das zur Steuerung Ihres Systems verwendet wird. CTTY Gert Gert Das Terminalgert das Sie verwenden mchten, z.B. COM1. . :TEXT_CMDHELP_DATE#1 Zeigt oder setzt das Datum. DATE [/D] [Datum] Geben Sie DATE ohne Parameter ein, um die aktuelle Datumseinstellung und die Abfrage fr eine neue anzuzeigen. Drcken Sie ENTER, um das Datum beizubehalten. /D verhindert, dass DATE interaktiv wird. . :TEXT_CMDHELP_DEL#2 Lscht eine oder mehrere Dateien. DEL [Laufwerk:][Pfad]Dateiname [/P] [/V] ERASE [Laufwerk:][Pfad]Dateiname [/P] [/V] [Laufwerk:][Pfad]Dateiname Spezifiziert die zu lschende(n) Datei(en). Benutzen Sie Wildcards, um mehrere Dateien anzugeben. /P Fragt fr jede zu lschende Datei nach Besttigung. /V Zeigt alle gelschten Dateien an. . :TEXT_CMDHELP_DIR#4 Zeigt eine Liste von Dateien und Unterverzeichnissen in einem Verzeichnis an. DIR [Laufwerk:][Pfad][Dateiname] [/P] [/W] [/A[[:]Attribute]] [/O[[:]Reihenfolge]] [/S] [/B] [/L] [Laufwerk:][Pfad][Dateiname] Spezifiziert Laufwerk, Verzeichnis, und/oder aufzulistende Dateien. (Knnen sowohl erweiterte als auch mehrere Datei- spezifikationen sein.) /P Legt nach jedem vollstndigen Ausfllen des Bildschirms mit Informationen eine Pause ein. /W Benutzt das ausfhrliche Listenformat. /A Zeigt nur Dateien mit den spezifizierten Attributen an. (Grundeinstellung ist /ADHSRA) Attribute D Verzeichnisse (Directories) R Schreibgeschtzte Dateien (Read-only) H Versteckte Dateien (Hidden) A Zur Archivierung bereite Dateien S Systemdateien - (Das Prefix invertiert die jeweilige Bedeutung) /O Listet Dateien in (Sortier-)Reihenfolge auf. Reihenfolge N Nach Name (alphabetisch) S Nach Gre (Size) (kleinste zuerst) E Nach Erweiterung (alphabetisch) D Nach Datum und Zeit (lteste zuerst) G Verzeichnisse zuerst - (Das Prefix kehrt die Reihenfolge um) U Unsortiert (Grundeinstelung ist /ONG) /S Zeigt Dateien im spezifizierten Verzeichnis und allen Unterverzeichnissen an. /B Benutzt das knappe Format (ohne Kopftext und Zusammenfasung). /L Benutzt Kleinbuchstaben. /Y or /4 Zeigt vierstellige Jahreszahlen an. Einstellungen knnen in der DIRCMD Umgebungsvariable gespeichert werden. Grundeinstellungen knnen durch das Voranstellen eines - (Bindestrich) bergangen werden; z.B. /-W. . :TEXT_CMDHELP_DOSKEY#1 Das externe DOSKey Dienstprogramm wurde in FreeCOM eingebunden. Benutzen Sie die Pfeiltasten HOCH und RUNTER, um die Befehls-History abzurufen und durch HISTORY anzeigen zu lassen. Benutzen Sie LINKS und RECHTS und die ENDE und POS1 Tasten, um innerhalb der Befehlszeile zu navigieren und schalten Sie mit der EINFG-Taste zwischen dem berschreibe- und Einfge-Modus hin und her. Benutzen Sie die Tabulatortaste, um das aktuelle Wort als Dateinamen zu vervollstndigen; drcken Sie sie zweimal, um alle mglichen Treffer anzuzeigen. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Editiert die Befehlszeile, ruft Befehlseingaben ab und erstellt Makros. DOSKEY [/Switch ...] [Makroname=[Text]] /BUFSIZE:Gre Legt die Gre des Makro- und Befehlspuffers fest (Voreinstellung: 512) /ECHO:on|off Aktiviert/deaktiviert das Echo fr Makroerweiterungen (Voreinstellung: on) /FILE:Datei Spezifiziert eine Datei, die eine Liste mit Makros enthlt /HISTORY Zeigt alle im Speicher abgelegten Befehle an /INSERT Fgt neu getippte Buchstaben in die Zeile ein /KEYSIZE:Gre Legt die Gre des Tastatur-vortipp-Puffers fest (Voreinstellung: 15) /LINE:Gre Legt die Gre des Zeileneditionspuffers fest (Voreinstellung: 128) /MACROS Zeigt alle DOSKey Makros an /OVERSTRIKE berschreibt Buchstaben in der Zeile mit neu getippten Buchstaben (Voreinstellung) /REINSTALL Richtet eine neue Instanz von DOSKey ein Makroname Spezifiziert den Namen des Makros den Sie erstellen Text Spezifiziert Befehle, die Sie dem Makro zuweisen mchten HOCH, RUNTER Ruft Befehle ab Esc Lscht den aktuellen Befehl F7 Zeigt die Befehls-History an Alt+F7 Lscht die Befehls-History [Buchstaben]F8 Sucht nach Befehlen, die mit [Buchstaben] beginnen F9 Whlt einen Befehl durch seine Nummer aus Alt+F10 Lscht Makrodefinitionen Die folgenden Spezialcodes knnen Sie in DOSKey Makrodefinitionen nutzen: $T Befehlstrennzeichen: ermglicht mehrere Befehle in einem Makro $1-$9 Stapelparameter: gleichbedeutend mit %1-%9 in Stapelprogrammen $* Symbol wird durch alles, was in der Befehlszeile auf den Makronamen folgt, ersetzt. . :TEXT_CMDHELP_ECHO Zeigt Nachrichten an oder schaltet das Befehls-Echoing an oder aus. ECHO [ON | OFF] ECHO [Nachricht] ECHO. ECHO. Zeigt eine leere Zeile (nur in Batch-Dateien) Geben Sie ECHO ohne Parameter ein, um die aktuelle Echoeinstellung anzuzeigen. . :TEXT_CMDHELP_EXIT Beendet die FreeDOS Command Shell. EXIT . :TEXT_CMDHELP_FOR Fhrt einen spezifizierten Befehl fr jede Datei eines Dateisatzes aus. FOR %%Variable IN (Dateisatz) DO Befehl [Befehlsparameter] %%Variable Spezifiziert einen ersetzbaren Parameter. (Dateisatz) Spezifiziert einen Satz aus einer oder mehreren Dateien. Wildcards knnen benutzt werden. Befehl Spezifiziert einen auf jede Datei anzuwendenden Befehl. Befehlsparameter Spezifiziert Parameter oder Switches fr den angegebenen Befehl. Um den FOR-Befehl in einem Stapelprogramm zu benutzen, geben Sie %%%%Variable anstelle von %%Variable an. Zum Beispiel: FOR %%%%f IN (---Start--- a*.* ---Ende---) DO ECHO - %%%%f - . :TEXT_CMDHELP_GOTO Setzt den Befehlszeileninterpreter auf eine Sprungmarke in einem Stapelverarbeitungsprogramm. GOTO Sprungmarke Sprungmarke Spezifiziert eine Zeichenkette, die in einem Stapelprogramm als Sprungmarke verwendet wird. Geben Sie in eine extra Zeile einen Doppelpunkt gefolgt von der Sprungmarke ein. . :TEXT_CMDHELP_HISTORY#1 History-Befehl. HISTORY [Gre] Ohne "Gre" wird der aktuelle Inhalt des Befehlszeilen-History-Puffers an- gezeigt. Bei Angabe einer Gre wird die Gre des History-Puffers gendert. . :TEXT_CMDHELP_IF Bewirkt bedingungsabhngige Verarbeitung in einem Stapelprogramm. IF [NOT] ERRORLEVEL Nummer Befehl IF [NOT] Zeichenkette1==Zeichenkette2 Befehl IF [NOT] EXIST Dateiname Befehl /I string==STRING NOT Gibt an, dass der Interpreter den Befehl nur dann ausfhren soll, wenn die Bedingung nicht zutrifft. ERRORLEVEL Nummer Ergibt eine wahre Bedingung, falls das zuletzt ausge- fhrte Programm einen Ausgangscode zurckgegeben hat, der gleich oder grer als die spezifizierte Nummer ist Befehl Spezifiziert den bei zutreffender Bedingung auszu- fhrenden Befehl. Zeichenkette1==Zeichenkette2 Ergibt eine wahre Bedingung, falls die spezifizierten Zeichenketten bereinstimmen. EXIST Dateiname Ergibt eine wahre Bedingung, falls die spezifizierte Datei existiert. /I string==STRING Ignoriert Gro-/Kleinschreibung . :TEXT_CMDHELP_LFNFOR Ermglicht/deaktiviert lange Dateinamen beim FOR Befehl oder bei der Dateinamenvervollstndigung mit "TAB". LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Geben Sie LFNFOR oder LFNFOR COMPLETE ohne Parameter ein um die aktuelle LFNFOR Einstellung anzuzeigen. . :TEXT_CMDHELP_LH Ldt ein Programm in den hheren Speicherbereich. LOADHIGH [Laufwerk:][Pfad]Dateiname [Parameter] LOADHIGH [/L:Region1[,minGre1][;Region2[,minGre2]...] [/S]] [Laufwerk:][Pfad]Dateiname [Parameter] /L:Region1[,minGre1][;Region2[,minGre2]]... Spezifiziert die Speicherregionen, in die das Programm geladen werden soll. Region1 spezifiziert die Nummer der ersten Speicherregion; minGre1 spezifiziert, falls vorhanden, die minimale Gre fr Region1. Region2 und minGre2 spezifizieren, falls erforderlich, Nummer und minimale Gre fr die zweite Region. Sie knnen beliebig viele Regionen spezifizieren. /S Schrumpft ein UMB auf seine Minimalgre whrend das Programm geladen wird. [Laufwerk:][Pfad]Dateiname Spezifiziert Pfad und Namen des zu ladenden Programms. . :TEXT_CMDHELP_LOADFIX Ldt ein Programm nach den ersten 64K des Speichers und fhrt es aus. LOADFIX [Laufwerk:][Pfad]Dateiname Benutzen Sie LOADFIX um ein Programm zu laden, wenn Ihnen beim Versuch, es im LoMem zu laden, die Nachricht "Packed file corrupt" (Gepackte Datei beschdigt) angezeigt wurde. . :TEXT_CMDHELP_MD Erstellt ein Verzeichnis. MKDIR [Laufwerk:]Pfad MD [Laufwerk:]Pfad . :TEXT_CMDHELP_PATH Zeigt oder setzt einen Suchpfad fr ausfhrbare Dateien. PATH [[Laufwerk:]Pfad[;...]] PATH ; Geben Sie PATH ; ein, um alle Suchpfadeinstelungen zu lschen und die Command Shell lediglich im jeweils aktuellen Verzeichnis suchen zu lassen. Geben Sie PATH ohne Parameter ein, um die aktuelle Suchpfadeinstellung anzuzeigen. . :TEXT_CMDHELP_PAUSE Unterbricht die Verarbeitung eines Stapelprogramms und zeigt die Nachricht "Drcken Sie eine beliebige Taste, um fortzufahren..." oder eine optional spezifizierte Nachricht an. PAUSE [Nachricht] . :TEXT_CMDHELP_PROMPT ndert das Erscheinungsbild der Eingabeaufforderung. PROMPT [Text] Text Spezifiziert eine neue Eingabeaufforderung. Die Eingabeaufforderung kann aus normalen Zeichen sowie den folgenden Spezialcodes bestehen: $Q = (Gleichheitszeichen) $$ $ (Dollarzeichen) $T Aktuelle Zeit $D Aktuelles Datum $P Aktuelles Laufwerk und Pfad $V Die FreeDOS Command Shell Versionsnummer $N Aktuelles Laufwerk $G > (grer-als-Zeichen) $L < (kleiner-als-Zeichen) $B | (Pipe) $H Backspace (lscht das vorangehende Zeichen) $E Escape Code (ASCII Code 27) $_ Wagenrcklauf und neue Zeile (CrLf) Geben Sie PROMPT ohne Parameter ein, um die Eingabeaufforderung auf Grundeinstellung zurckzusetzen. . :TEXT_CMDHELP_PUSHD Legt das aktuelle Verzeichnis mit der Option, das aktuelle Arbeitsverzeichnis zu wechseln, im Dateiverzeichnis-Stack ab. PUSHD [[Laufwerk:]Pfad] Wobei [Laufwerk:]Pfad der Pfad ist, zu dem Sie wechseln mchten. . :TEXT_CMDHELP_POPD Holt ein Verzeichnis vom Dateiverzeichnis-Stack und wechselt zu ihm. POPD [*] Der '*' Parameter leert den Dateiverzeichnis-Stack. . :TEXT_CMDHELP_DIRS Zeigt den Inhalt des Dateiverzeichnis-Stacks an. DIRS . :TEXT_CMDHELP_RD Lscht ein Verzeichnis. RMDIR [Laufwerk:]Pfad RD [Laufwerk:]Pfad . :TEXT_CMDHELP_REM Weist Kommentare (Remarks) in einer Stapeldatei oder in CONFIG.SYS aus. REM [Kommentar] . :TEXT_CMDHELP_REN Benennt eine oder mehrere Datei(en)/Verzeichnis(se) um. RENAME [Laufwerk:][Pfad][Verzeichnisname1 | Dateiname1] [Verzeichnisname2 | Dateiname2] REN [Laufwerk:][Pfad][Verzeichnisname1 | Dateiname1] [Verzeichnisname2 | Dateiname2] Bitte beachten Sie, dass Sie weder ein neues Laufwerk noch einen neuen Pfad als Zielelement spezifizieren knnen. Benutzen Sie hierzu den MOVE-Befehl. . :TEXT_CMDHELP_SET#1 Zeigt, setzt oder lscht Umgebungsvariablen. SET [/C] [/P] [/E] [/U] [Variable[=[Zeichenkette]]]] Variable Spezifiziert den Namen der Umgebungsvariable. Zeichenkette Spezifiziert eine Zeichenkette, die der Variable zugewiesen werden soll. * Falls keine Zeichenkette spezifiziert wird, wird die Variable aus der Umgebung gelscht. Geben Sie SET ohne Parameter ein, um die aktuellen Umgebungsvariablen anzuzeigen. Geben Sie SET VAR ein, um den Wert von VAR anzuzeigen. /C Erzwingt die Einhaltung der Gro-/Kleinschreibung der Variable; die Voreinstellung ist, die Variable in Grobuchstaben zu bernehmen, falls sie nicht bereits in der Umgebung vorhanden ist. Andernfalls wird die Gro-/Kleinschreibung beibehalten. /P Fragt Benutzer nach einer Zeichenkette und weist die Benutzereingabe der Variablen zu. /E Es wird ein Befehl ausgefhrt und die erste Zeile der Ausgabe des Befehls wird in einer Variablen gespeichert. /U Wandelt den Wert einer Variablen in Grobuchstaben um. . :TEXT_CMDHELP_SHIFT#1 ndert die Position ersetzbarer Parameter einer Stapeldatei. SHIFT [RUNTER] RUNTER verschiebt das Argumentfenster Richtung Anfang (%%0); anderenfalls in Richtung Ende. . :TEXT_CMDHELP_TIME#1 Zeigt oder setzt die Systemzeit. TIME [/T] [Zeit] Geben Sie TIME ohne Parameter ein, um die aktuelle Zeiteinstellung anzu- zeigen und nach der neuen Einstellung zu fragen. Drcken Sie ENTER, um die Zeit beizubehalten. /T verhindert, dass TIME interaktiv wird. . :TEXT_CMDHELP_TRUENAME Zeigt den vollen Pfadnamen des angegebenen Pfades an. TRUENAME [Laufwerk:][Pfad][Dateiname] . :TEXT_CMDHELP_TYPE Zeigt den Inhalt von Textdateien an. TYPE [Laufwerk:][Pfad]Dateiname . :TEXT_CMDHELP_VER Zeigt die Versionsnummer und andere Informationen ber die FreeDOS Command Shell an. VER [/R] [/W] [/D] [/C] /R Zeigt die Kernelversion und weitere Informationen. /W FreeDOS Command Shell Gewhrleistung. /D FreeDOS Command Shell Weitergabeinformationen. /C FreeDOS Command Shell Beteiligte. . :TEXT_CMDHELP_VERIFY Legt fest, ob das FreeDOS Dateisystem verifizieren soll, dass Dateien erfolgreich abgelegt wurden. VERIFY [ON | OFF] Geben Sie VERIFY ohne Parameter ein, um die aktuelle VERIFY Einstellung anzuzeigen. . :TEXT_CMDHELP_FDDEBUG Falls FreeDOS mit Fehlersuche (Debugging) kompiliert wurde, schaltet dieser Befehl die Ausgabe von Fehlerinformationen ein oder aus oder gibt die aktuelle Einstellung an. FDDEBUG [ON | OFF | Datei] Geben Sie FDDEBUG ohne Parameter ein, um die aktuelle Einstellung anzuzeigen. Falls eine Datei spezifiziert wird, werden alle Fehlerinformationen in diese Datei umgeleitet; die Ausgabe wird an die Datei angehngt, falls sie schon existiert. Die besonderen Namen "stdout" und "stderr" knnen benutzt werden, um die Ausgabe zur Standardausgabe oder zum Standard-Fehler-Stream umzuleiten. . :TEXT_CMDHELP_VOL Zeigt das Laufwerk-Volumelabel und, falls vorhanden, die Seriennummer an. VOL [Laufwerk:] . :TEXT_CMDHELP_QUESTION#1 Zeigt eine Liste der verfgbaren Befehle der Shell an. ? ?Befehl [Parameter] Die erste Variante zeigt alle verfgbaren internen Befehle und Fhigkeiten an. Die zweite fragt ab, ob der spezifizierte Befehl wie im Einzelschrittmodus ausgefhrt werden soll oder nicht. . :TEXT_CMDHELP_WHICH Sucht und zeigt die zum jeweiligen Befehl gehrende ausfhrbare Datei an. WHICH {Befehl} . :TEXT_CMDHELP_MEMORY#1 Zeigt den von FreeCOM intern verwendeten Speicher an MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 Das COPY-Ziel darf keine Pluszeichen ('+') enthalten. . :TEXT_DELETE_FILE#1 Lsche Datei '%s'. . # # The following messages are new in 0.82pl3, I think. # :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Kann Datei '%s' nicht schreiben; Ist vielleicht das Ziellaufwerk voll? (%lu bytes bentigt) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% %luKB kopiert\r\ . :TEXT_COPY_COPIED#0% %luKB von %luKB kopiert\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM kann kein Gert sein: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Diese Datei ist kein FreeCOM, zumindest keine kompatible Version: %s . # # Stupid question, but when strings cannot be found, how on # Earth can this message be displayed anyway??? # :TEXT_ERROR_LOADING_STRINGS Konnte die Strings nicht von %COMSPEC% laden. Bitte geben Sie an, wo FreeCOM zu finden ist, zum Beispiel: C:\\COMMAND.COM oder drcken, Sie ENTER um ohne Strings weiterzumachen. . :TEXT_TERMINATING Beende jetzt. . :TEXT_HIDDEN_CRITER#0% %u Kritische Fehleranfragen unterdrckt. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Exitcode (ERRORLEVEL): %u, Grund: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS API Fehler.\ . :TEXT_EXIT_REASON_0 Normal beendet.\ . :TEXT_EXIT_REASON_1 Beendet durch ^Break.\ . :TEXT_EXIT_REASON_2 Durch kritischen Fehler beendet.\ . :TEXT_EXIT_REASON_3 Resident geworden.\ . :TEXT_ERROR_EXE_CORRUPT EXE Datei ist korrupt.\ . ================================================ FILE: strings/indent.pro ================================================ -kr -di2 -nbc -nfca -bl -bli0 -ss -npcs -ncs -nbs -i2 -ci4 -nce -sob -ts80 -nbad -cli2 ================================================ FILE: strings/italian.err ================================================ # $Id$ # # Critical error national customization file # # Language: Italian # Codepage: CP850 # Author: Roberto Mariottini # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Errore di %1l'unit %A: %2 area: %3 S3 CHAR_DEVICE: Errore di %1 dispositivo %A: %3 ## kind of operation S0 READ: lettura dal S1 WRITE: scrittura sul ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: root S7 DATA: dati ## action strings S8 IGNORE: (I)gnora S9 RETRY: (R)iprova S10 ABORT: (A)nnulla S11 FAIL: (F)allisci ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Codice di errore sconosciuto S15 0: tentativo di violazione della protezione in scrittura 1: unit sconosciuta al driver 2: unit non pronta 3: comando sconosciuto inviato al driver 4: errore nei dati (errore CRC) 5: errata dimensione della struttura di richiesta al driver 6: erorre di posizionamento (seek) 7: tipo di supporto (media) sconosciuto 8: settore non trovato 9: stampante senza carta 10: scrittura fallita 11: lettura fallita 12: guasto generico 13: violazione della condivisione 14: violazione di blocco (lock) 15: cambio di disco non valido 16: FCB non disponibile 17: sharing buffer overflow 18: tabella di codici differente 19: input esaurito 20: spazio su disco insufficiente ================================================ FILE: strings/italian.lng ================================================ # $Id$ # # Derived from: Id: DEFAULT.lng,v 1.34 2004/12/01 21:20:46 skaus Exp # # FreeCOM national customization file # # Language: Italian # Codepage: 850 # Author: Roberto Mariottini # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Opzione non valida. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Opzione non valida. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Formato dell'opzione non corretto: '%s' . :TEXT_ERROR_OPT_ARG#0% L'opzione '%s' non ha argomenti . :TEXT_ERROR_OPT_NOARG#0% L'opzione '%s' ha un argomento . :TEXT_INVALID_NUMBER#0% Numero specificato non valido: '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Manca chiusura virgolette: %c . :TEXT_ERROR_TEMPFILE Impossibile creare il file temporaneo . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Troppi parametri. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Troppi parametri. . :TEXT_ERROR_INVALID_PARAMETER#0% Parametro non valido. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Percorso non trovato. . :TEXT_ERROR_FILE_NOT_FOUND File non trovato. . :TEXT_ERROR_SFILE_NOT_FOUND#0% File non trovato. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Manca un parametro obbligatorio. . :TEXT_ERROR_INVALID_DRIVE#0% Unit non valida %c:. . :TEXT_ERROR_BADCOMMAND#2% Comando o nome di file errato - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Errore di memoria esaurita. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Allocazione di memoria DOS fallita. . :TEXT_ERROR_CANNOTPIPE Impossibile aprire il file temporaneo! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% La linea #%ld nel file batch '%s' troppo lunga. . :TEXT_ERROR_BFILE_VANISHED#0% File batch '%s' non trovato. . :TEXT_ERROR_BFILE_LABEL#0% Il file batch '%s' non contiene l'etichetta '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s fallito per '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Impossibile impostare la variabile d'ambiente '%s'. Spazio ambiente esaurito? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Variabile d'ambiente '%s' non trovata. . :TEXT_ERROR_NO_ENVIRONMENT Spazio ambiente assente. Memoria insufficiente. Specificare l'opzione /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Impossibile impostare l'alias '%s'. Spazio alias esaurito? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' non trovato. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Spazio alias assente. Memoria insufficiente. . :TEXT_ERROR_SYNTAX_STR#0% Errore di sintassi. - '%s' . :TEXT_ERROR_SYNTAX Errore di sintassi. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Nome di file troppo lungo. - '%s' . :TEXT_ERROR_SELFCOPY#0% Impossibile copiare '%s' su se stesso . :TEXT_ERROR_COMMAND_TOO_LONG Linea di comando troppo lunga dopo l'espansione degli alias! . :TEXT_ERROR_LINE_TOO_LONG Linea troppo lunga. Impossibile eseguire il comando. . :TEXT_ERROR_HISTORY_SIZE#1% Dimensione cronologia non valida '%s'. . :TEXT_HISTORY_EMPTY#1 Cronologia comandi vuota. . :TEXT_ERROR_BAD_MCB_CHAIN Catena MCB corrotta, o sistema non compatibile con MS-DOS. . :TEXT_ERROR_UNDEFINED_ERROR#0% Errore non definito %d. . :TEXT_ERROR_REGION_WARNING#0% Regione di memoria illegale %d - ignorata. . :TEXT_ERROR_ON_OR_OFF Occorre specificare ON oppure OFF. . :TEXT_ERROR_BAD_VARIABLE Specificazione di variabile non corretta. . :TEXT_ERROR_IN_MISSING#1 FOR: IN mancante. . :TEXT_ERROR_MISSING_PARENTHESES#1 Parentesi mancante. . :TEXT_ERROR_DO_MISSING#1 FOR: DO mancante. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: nessun comando dopo l'istruzione DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Impossibile ridirezionare l'input dal file '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Impossibile ridirezionare l'output sul file '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Ridirezione vuota. . :TEXT_ERROR_INVALID_DATE Data non valida. . :TEXT_ERROR_INVALID_TIME Ora non valida. . :TEXT_ERROR_NO_GOTO_LABEL Nessuna etichetta specificata per il GOTO. . :TEXT_CTTY_NOTIMPLEMENTED Il comando CTTY stato escluso da questo COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% Unit non valida o non in lettura-scrittura - '%s'. . :TEXT_ERROR_CTTY_DUP#0% Tentativo di cambiamento dei descrittori dei file per il TTY '%s' fallito. . :TEXT_ERROR_L_NOTIMPLEMENTED /L non ancora implementato. . :TEXT_ERROR_U_NOTIMPLEMENTED /U non ancora implementato. . :TEXT_ERROR_WRITING_DEST Errore di scrittura sulla destinazione. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Impossibile aprire la sorgente. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Impossibile aprire il file '%s' . :TEXT_ERROR_READ_FILE#0% Impossibile leggere dal file '%s' . :TEXT_ERROR_WRITE_FILE#0% Impossibile scrivere sul file '%s' . :TEXT_ERROR_LEADING_PLUS Il carattere di concatenazione '+' non pu precedere gli argomenti. . :TEXT_ERROR_TRAILING_PLUS Il carattere di concatenazione '+' non pu seguire gli argomenti. . :TEXT_ERROR_NOTHING_TO_DO Nulla da fare. . :TEXT_ERROR_COPY COPY fallito . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: nome di file mancante . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: numero mancante . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: numero non valido . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: comando mancante . :TEXT_NOT_IMPLEMENTED_YET Spiacente... non ancora implementato. . :TEXT_FAILED_LOAD_STRINGS Caricamento dei messaggi in memoria fallito. . :TEXT_MSG_NOTIMPLEMENTED L'opzione /MSG stata esclusa da questo COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u elementi visualizzati. . :TEXT_CORRUPT_COMMAND_LINE Linea di comando corrotta. Questo un errore interno correlato al sistema in cui COMMAND.COM eseguito. Si prega di segnalare l'errore. . :TEXT_QUOTED_C_OR_K#1 Le opzioni /K e /C non possono essere virgolettate, quindi sono state ignorate. . :TEXT_INIT_FULLY_QUALIFIED#1% Il percorso di COMMAND.COM deve essere completamente specificato! Deve includere la specificazione di unit ed iniziare con un backslash. Per esempio: C:\\FDOS COMMAND.COM assume ora questo percorso: %s . :TEXT_ERROR_RESTORE_SESSION Le informazioni di sessione non possono essere ripristinate, ogni impostazione locale persa. Fare riferimento al precedente messaggio di errore per comprendere la ragione di questo problema. . :TEXT_ERROR_SAVE_SESSION Le informazioni attuali non possono essere mantenute durante la chiamata del programma. Fare riferimento al precedente messaggio di errore per comprendere la ragione di questo problema. . :TEXT_ERROR_CWD_FAILED#1% L'unit %c: non risponde o la memoria interna esaurita. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swapping fallito: gli alias occupano troppa memoria. . :TEXT_ERROR_KSWAP_ALLOCMEM Swapping fallito: impossibile allocare la memoria FAR. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Spazio alias esaurito. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Alias non trovato: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Inserimento alias fallito. . :TEXT_ALIAS_INVALID_NAME#1% Nome alias non valido '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Impossibile caricare il modulo di contesto o il gestore di errori critici. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Memoria insufficiente per il Contesto. Se l'errore persiste, incrementare i buffer interni, come la cronologia comandi, stack di directory, ecc... . :TEXT_ERROR_CONTEXT_LENGTH#1% La dimensione totale del contesto di %lu byte, oltre il limite minimo. Ridimensionamento del contesto a %u byte. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Tentativo fallito di aggiungere informazioni di stato al contesto. Questo errore pu indicare corruzione di memoria o una dimensione minima del contesto determinata non correttamente. Informare il maintainer di FreeCOM all'indirizzo: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Contesto mancante dopo lo scambio. Il contesto ricreato, ma tutti gli alias, ecc. sono persi. . # # Informational messages # :TEXT_MSG_PAUSE#1 Premere un tasto per continuare . . .\ . :TEXT_MSG_HISTORY_SIZE#0% La cronologia di %d byte. . :TEXT_MSG_DOSKEY Le caratteristiche di DOSKEY sono gi abilitate. . :TEXT_MSG_ECHO_STATE#0% ECHO %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY %s . :TEXT_MSG_FDDEBUG_STATE#0% L'output di DEBUG %s. . :TEXT_MSG_FDDEBUG_TARGET#0% L'output di DEBUG stampato su '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK %s . :TEXT_MSG_CURRENT_DATE#0% La data corrente %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Immettere la nuova data (mm%sgg%s[aa]aa): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Immettere la nuova data (gg%smm%s[aa]aa): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Immettere la nuova data ([aa]aa%smm%sgg): \ . :TEXT_MSG_CURRENT_TIME#0% L'ora corrente %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Immettere la nuova ora: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% SsNn{CR}{LF}{CBREAK} aabb b b b Tutti i file in '%s' saranno cancellati! Procedere con l'operazione (S/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 SsNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [S=INVIO, No=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% SsNnTt{LF}{CR}{CBREAK}{ESC} aabbcc a a c b Control-Break premuto.\r Terminare il file batch '%s' (S/No/Tutti) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% SsNnTtEe{CBREAK}{ENTER}{ESC} aabbccdd d a b Sovrascrivere '%s' (S/No/Tutti/Esci) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b SsNnTtEe{CBREAK}{ENTER}{ESC} aabbccdd d a b Appendere a '%s' (S/No/Tutti/Esci) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% SsNnTtEe{CBREAK}{ENTER}{ESC} aabbccdd d a b Cancellare '%s' (S/No/Tutti/Esci) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Stack delle directory vuoto. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Il volume nell'unit %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% %s. . :TEXT_DIR_HDR_VOLUME_NONE non ha etichetta. . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Numero di serie del volume: %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s File\ . :TEXT_DIR_FTR_BYTES#0% %12s byte . :TEXT_DIR_FTR_TOTAL_NUMBER File totali elencati: . :TEXT_DIR_FTR_DIRS#1% %10s Directory\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s byte disponibili . :TEXT_DIR_DIRECTORY#0% Directory di %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Directory di %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Nessun percorso di ricerca definito. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Dom\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Lun\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Mar\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Mer\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Gio\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Ven\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sab\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 nessun file cancellato. . :TEXT_MSG_DEL_CNT_FILES_1#1 un file cancellato. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u file cancellati. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Comandi interni disponibili: . :TEXT_MSG_SHOWCMD_FEATURES Funzionalit disponibili: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliases] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [enhanced input] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [history] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [filename completion] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [swapping] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start logging] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [last dir] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS swap] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [default to swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [installable commands] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [directory stack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM debugging] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Premere F8 per la modalit traccia, o F5 per non eseguire %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% '%s' ignorato. . :TEXT_MSG_VER_DOS_VERSION#0% DOS versione %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS kernel (build 1933 o precedente) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS kernel versione %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2004 Tim Norman and others. Questo programma distribuito nella speranza che sia utile, ma SENZA ALCUNA GARANZIA; senza neppure la garanzia implicita di COMMERCIABILITA' o di APPLICABILITA' PER UN PARTICOLARE SCOPO. Si veda la Licenza Pubblica Generica GNU (GNU General Public License, in inglese) per avere maggiori dettagli. Segnalare eventuali bug a: freedos-devel@lists.sourceforge.net Aggiornamenti sono disponibili all'indirizzo: http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman and others. Questo programma e software libero; lecito ridistribuirlo e/o modificarlo secondo i termini della Licenza Pubblica Generica GNU come pubblicata dalla Free Software Foundation; o la versione 2 della licenza o (a vosta scelta) una qualsiasi versione successiva. Segnalare eventuali bug a: freedos-devel@lists.sourceforge.net Aggiornamenti sono disponibili all'indirizzo: http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS FreeCOM (FreeDOS Command Shell) sviluppato da molti sviluppatori, fare riferimento al file HISTORY.TXT incluso. Segnalare eventuali bug a: freedos-devel@lists.sourceforge.net Aggiornamenti sono disponibili all'indirizzo: http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Il programma shell sta per terminare, sebbene ci sia\r vietato (normalmente utilizzando l'opzione "/P").\r E' necessario riavviare il computer o, se si sta eseguendo il\r programma shell in un ambiente multitasking, terminare il\r processo/task manualmente. . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Eseguibile FreeCOM non trovato. Occorre specificare il percorso completo COMMAND.COM come primo parametro di COMMAND, per esempio: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Segmento di ambiente : max %5u byte; liberi %5u byte . :TEXT_MEMORY_CONTEXT#1% Segmento di contesto : max %5u byte; liberi %5u byte . :TEXT_MEMORY_HEAP#1% Heap : liberi %5lu byte . :TEXT_MEMORY_CTXT_ALIAS#1% \tAlias : limite %5u byte, attuale %5u byte, %5u elementi . :TEXT_MEMORY_CTXT_HISTORY#1% \tCronologia : limite %5u byte, attuale %5u byte, %5u elementi . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tStack directory: limite %5u byte, attuale %5u byte, %5u elementi . :TEXT_MEMORY_CTXT_LASTDIR#1% \tLast dir cache : usati %5u byte, %5u elementi . :TEXT_MEMORY_CTXT_BATCH#1% \tBatch nesting : usati %5u byte, %5u elementi . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : usati %5u byte, %5u elementi . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Fallito tentativo di acquisizione della tabella codici corrente dal sistema. . :TEXT_ERROR_SET_CODEPAGE#1 Fallito tentativo di cambiamento della tabella codici corrente. . :TEXT_DISPLAY_CODEPAGE#1% La tabella codici corrente %u. La tabella codici del sistema (vera e propria) : %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Visualizza, imposta, o cancella alias. ALIAS [variabile=[stringa]] variabile Specifica il mode dell'alias. stringa Specifica una serie di caratteri da assegnare all'alias. Digitare ALIAS senza parametri per visualizzare gli alias attuali. . :TEXT_CMDHELP_BEEP Emette un bip. . :TEXT_CMDHELP_BREAK Imposta o annulla il controllo di CTRL+C esteso. BREAK [ON | OFF] Digitare BREAK senza parametri per visualizzare l'impostazione BREAK attuale. . :TEXT_CMDHELP_CALL#1 Richiama un file batch da un altro. CALL [/S | /N] [/Y] [unit:][percorso]nomefile [parametri-batch] parametri-batch Specifica le informazioni a linea di comando richieste dal programma batch. /S forza, /N nega lo swapping di FreeCOM. /Y abilita il modo tracciamento durante l'esecuzione del programma. . :TEXT_CMDHELP_CD Visualizza o cambia la directory corrente. CHDIR [unit:][percorso] CHDIR[..] CD [unit:][percorso] CD[..] CD - .. Specifica che si vuole passare alla directory superiore. - Se la funzionalit "last directory" abilitata, passa alla directory precedente. Digitare CD unit: per visualizzare la directory corrente nell'unit specificata. Digitare CD senza parametri per visualizzare l'unit e la directory correnti. Vedere anche: CDD . :TEXT_CMDHELP_CDD Visualizza il nome o cambia unit e directory correnti. CDD [unit:][percorso] CDD[..] CDD - .. Specifica che si vuole passare alla directory superiore. - Se la funzionalit "last directory" abilitata, passa alla directory precedente. Se l'unit specificata, l'unit corrente cambier di conseguenza; questa l'unica differenza con "CHDIR". Digitare CD senza parametri per visualizzare unit e directory correnti. . :TEXT_CMDHELP_CHCP Visualizza o imposta la tabella codici attiva. CHCP [nnn] nnn Specifica un numero di tabella codici. Digitare CHCP senza parametri per visualizzare il numero della tabella codici attiva. . :TEXT_CMDHELP_CLS Cancella lo schermo. CLS . :TEXT_CMDHELP_COMMAND Esegue una nuova copia del programma shell di FreeDOS. COMMAND [[unit:]percorso] [dispositivo] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] comando]] [unit:]percorso Specifica la directory che contiene COMMAND.COM. dispositivo Specifica il dispositivo da usare per l'input e l'output dei comandi. /E:nnnnn Imposta la dimensione iniziale dell'ambiente a nnnnn byte. (nnnnn deve essere compreso fra 256 e 32,768). /L:nnnn Specifica la dimensione dei buffer interni (richiede /P). (nnnn deve essere compreso fra 128 e 1,024). /U:nnn Specifica la lunghezza del buffer di input (richiede /P). (nnn deve essere compreso fra 128 e 255). /P Rende la nuova shell permanente (non pu terminare). /MSG Memorizza tutti i messagi in memoria (richiede /P). /LOW Forza la shell a mantenere i suoi dati residenti in memoria bassa. /Y Esegue il programma batch specificato da /C o /K in modalit passo passo. /C comando Esegue il comando specificato e termina. /K comando Esegue il comando specificato e continua a funzionare. . :TEXT_CMDHELP_COPY Copia uno o pi file in un'altra posizione. COPY [/A | /B] sorgente [/A | /B] [+ sorgente [/A | /B] [+ ...]] [destinazione] [/A | /B]] [/V] [/Y | /-Y] sorgente Specifica il o i file che devono essere copiati. /A Indica un file di testo ASCII. /B Indica un file binario. destinazione Specifica la directory e/o il nomefile per il/i nuovi file. /V Verifica che i nuovi file siano scritti correttamente. /Y Sopprime la richiesta di conferma per la sovrascrittura di file destinazione gi esistenti. /-Y Causa la richiesta di conferma per la sovrascrittura di file destinazione gi esistenti. L'opzione /Y pu essere presente nella variabile d'ambiente COPYCMD. Ci pu essere annullato con l'opzione /-Y sulla linea di comando. Per appendere i file specificare un singolo file come destinazione, ma molteplici file come sorgente (usando i caratteri jolly o la forma file1+file2+file3). . :TEXT_CMDHELP_CTTY Cambia il dispositivo terminale usato per controllare il sistema. CTTY dispositivo dispositivo Il dispositivo terminale da usare, per esempio COM1. . :TEXT_CMDHELP_DATE#1 Visualizza o imposta la data. DATE [/D] [data] Digitare DATE senza parametri per visualizzare la data attuale e la richiesta di una nuova data. Prmere INVIO per mantenere la stessa data. /D impedisce che DATE diventi interattivo. . :TEXT_CMDHELP_DEL#2 Cancella uno o pi file. DEL [unit:][percorso]nomefile [/P] [/V] ERASE [unit:][percorso]nomefile [/P] [/V] [unit:][percorso]nomefile Specifica il/i file da cancellare. Specificare file multipli usando i caratteri jolly. /P Chiede conferma prima di cancellare ogni file. /V Visualizza tutti i file cancellati. . :TEXT_CMDHELP_DIR#4 Visualizza la lista dei file e sottodirectory in una directory. DIR [unit:][percorso][nomefile] [/P] [/W] [/A[[:]attributi]] [/O[[:]ordine]] [/S] [/B] [/L] [unit:][percorso][nomefile] Specifica unit, directory, e/o file da visualizzare (Si possono usare i caratteri jolly o nomifile multipli). /P Effettua una pausa dopo ogni schermata di informazioni. /W Usa il formato su pi colonne. /A Visualizza i file con gli attributi specificati. (Default: /ADHSRA) attributi D Directory R File di sola lettura H File nascosti A File pronti per l'archiviazione S File di sistema - Prefisso che nega gli attributi /O Visualizza i file ordinati. (Default: /ONG) ordine N Per nome (alfabetico) S Per dimensione (crescente) E Per estensione (alfabetico) D Per data e ora (cronologico) G Prima le directory - Prefiso che inverte l'ordine U Non ordinati /S Visualizza i file nelle directory specificate e tutte le sottodirectory. /B Usa ul formato breve (n intestazione n riepilogo). /L Usa caratteri minuscoli. /Y or /4 Visualizza l'anno con 4 cifre. Le opzioni possono essere presenti nella variabile d'ambiente DIRCMD. Per annullare le opzioni preimpostate inserire un - (meno) davanti all'opzione, per esempio: /-W . :TEXT_CMDHELP_DOSKEY#1 L'utility estaerna DOSKEY stata incorporata in FreeCOM. Usare i tasti cursore SU e GIU' per richiamare la cronologia comandi e HISTORY per visualizzarla. Usare i tasti cursore SINSTRA e DESTRA ed i tasti INIZIO e FINE per navigare all'interno della linea di comando, ed il tasto INS per passare dal modo inserimento al modo sovrascrittura e viceversa. Usare il tasto TAB per completare la parola corrente come un nome di file; premerlo due volte per visualizzare tutti i file che corrispondono. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Modifica la linea di comando, richiama linee di comando, e crea macro DOSKEY [opzioni ...] [nomemacro=[testo]] /BUFSIZE:nnnn Imposta la dimensione del buffer macro e comandi (default:512) /ECHO:on|off Abilita/disabilita l'eco dell'espansione delle macro (default:on) /FILE:file Specifica un file contenente una lista di macro /HISTORY Visualizza tutte le linee di comando memorizzate /INSERT Modo inserimento: i caratteri digitati vengono inseriti /KEYSIZE:size Imposta la dimensione del buffer di tastiera (default:15) /LINE:size Imposta la dimensione massima del buffer di modifica della linea (default:128) /MACROS Visualizza tutte le macro memorizzate /OVERSTRIKE Modo sovrascrittura: i caratteri sovrascrivono quelli gi esistenti (default) /REINSTALL Installa una nuova copia di DOSKey macroname Specifica un nome per la macro da creare text Specifica i comandi che si vogliono assegnare alla macro SU,GIU' (tasti cursore) richiamano le linee di comando Esc cancella la linea corrente F7 visualizza la cronologia comandi Alt+F7 cancella la cronologia comandi [testo]F8 cerca un comando che comincia con [testo] F9 seleziona la linea di comando per numero Alt+F10 cancella le definizioni di macro I seguenti codici speciali possono essere usati nella definizione di macro: $T Separatore di comandi: permette comandi multipli in una macro $1-$9 Parametri: equivalenti a %1-%9 nei programmi batch $* Simbolo sostituito da tutto ci che segue il nome della macro nella linea di comando. . :TEXT_CMDHELP_ECHO Visualizza un messaggio, o abilita/disabilita l'eco dei messaggi. ECHO [ON | OFF] ECHO [messaggio] Digitare ECHO senza parametri per visualizzare l'attuale stato dell'eco dei messaggi. . :TEXT_CMDHELP_EXIT Chiude il programma shell dei comandi di FreeDOS, tranne nel caso sia stato eseguito con l'opzione /P. EXIT . :TEXT_CMDHELP_FOR Esegue il comando specificato per ogni file in un insieme di file. FOR %%variabile IN (insieme) DO comando [parametri-comando] %%variabile Specifica il parametro sostituibile. (insieme) Specifica un insieme di uno o pi file. Valgono i caratteri jolly. comando Specifica il comando da eseguire per ogni file. parametri-comando Specifica i parametri e/o le opzioni per il commando. Per usare il comando FOR in un programma batch, specificare %%%%variabile invece di %%variabile. Per esempio: FOR %%f IN (---inizio--- a*.* ---fine---) DO ECHO - %%f - . :TEXT_CMDHELP_GOTO Dirige il programma shell ad una linea etichettata in un programma batch. GOTO etichetta etichetta Specifica una stringa usata nel programma batch come etichetta. Per definire un'etichetta posizionarla su una riga da sola, incominciando con il carattere : (due punti). Per esempio: ECHO prima del GOTO GOTO fine REM questa linea ignorata :fine ECHO dopo il GOTO . :TEXT_CMDHELP_HISTORY#1 Cronologia comandi. HISTORY [dimensione] Senza parametri visualizza l'attuale contenuto del buffer di cronologia comandi. Specificando la dimensione, modifica la dimensione del buffer di cronologia comandi. . :TEXT_CMDHELP_IF Esegue elaborazioni condizionali nei programmi. IF [NOT] ERRORLEVEL numero comando IF [NOT] stringa1==stringa2 comando IF [NOT] EXIST nomefile comando NOT Il comando sar eseguito solo se la condizione falsa. ERRORLEVEL numero Specifica una condizione vera se l'ultimo programma eseguito ha restituito un codice d'uscita maggiore o uguale al numero specificato. comando Specifica il comando da eseguire se la condizione verificata. string1==string2 Specifica una condizione vera se le stringhe specificate sono identiche. EXIST nomefile Specifica una condizione vera se il file specificato esiste. . :TEXT_CMDHELP_LH Carica un programma nell'aria di memoria alta (upper memory area). LOADHIGH [unit:][percorso]nomefile [parmetri] LOADHIGH [/L:regione1[,mindim1][;regione2[,mindim2]...] [/S]] [unit:][percorso]nomefile [parmetri] /L:regione1[,mindim1][;regione2[,mindim2]]... Specifica la/le regioni di memoria in cui caricare il programma. Regione1 specifica il numero prima regione di memoria; mindim1 specifica la dimensione minima, se presemte, per la regione1. Regione2 e mindim2 specificano il numero e la dimensione minima della seconda regione, se presente. Si possono specificare quante regioni si vogliono. /S Riduce l' UMB alla sua dimensione minima mentre sta caricando il programma. [unit:][percorso]nomefile Specifica nome e posizione del programma. . :TEXT_CMDHELP_LOADFIX Carica il programma sopra ai primi 64K di memoria, e lo esegue. LOADFIX [unit:][percorso]nomefile Usare LOADFIX per caricare il programma se si riceve il messaggio "Packed file corrupt" quando si cerca di eseguirlo. . :TEXT_CMDHELP_MD Crea una directory. MKDIR [unit:]percorso MD [unit:]percorso . :TEXT_CMDHELP_PATH Visualizza o imposta il percorso di ricerca per i file eseguibili. PATH [[unit:]percorso[;...]] PATH ; Digitare PATH ; per cancellare il percorso di ricerca e cercare solo nella directory corrente. Digitare PATH senza parametri per visualizzare il percorso corrente. . :TEXT_CMDHELP_PAUSE Sospende l'elaborazione di un programma batch e visualizza il messaggio: "Premere un tasto per continuare..." o il messaggio opzionale specificato. PAUSE [messaggio] . :TEXT_CMDHELP_PROMPT Cambia il prompt. PROMPT [testo] testo Specifica il nuovo prompt. Il prompt pu essere costituito da caratteri normali e i seguenti codici speciali: $Q = (segno di uguale) $$ $ (simbolo del dollaro) $T Ora attuale $D Data odierna $P Unit and percorso correnti $V Il numero di versione della shell di FreeDOS $N Unit corrente $G > (segno di maggiore) $L < (segno di minore) $B | (segno di pipe) $H Backspace (cancella il carattere precedente) $E Codice di escape (codice ASCII 27) $_ A capo (Carriage return e linefeed) Digitare PROMPT senza parametri per riottenre le impostazioni di default. . :TEXT_CMDHELP_PUSHD Aggiunge la directory corrente alla pila delle directory, e cambia la directory corrente. PUSHD [[unit:]percorso] Dove [unit:]percorso la nuova directory corrente. . :TEXT_CMDHELP_POPD Toglie la directory in cima alla pila delle directory, e la imposta come directory corrente. POPD [*] Il parametro '*' svuota la pila delle directory. . :TEXT_CMDHELP_DIRS Visualizza il contenuto dela pila delle directory. DIRS . :TEXT_CMDHELP_RD Rimuove (cancella) una directory. RMDIR [unit:]percorso RD [unit:]percorso . :TEXT_CMDHELP_REM Memorizza commenti in un programma batch o in CONFIG.SYS. REM [commento] . :TEXT_CMDHELP_REN Rinomina un file/directory. RENAME [unit:][percorso][nomedirectory1 | nomefile1] [nomedirectory2 | nomefile2] REN [unit:][percorso][nomedirectory1 | nomefile1] [nomedirectory2 | nomefile2] Notare che non si pu specificare una nuova unit o percorso come destinazione. Usare il comando MOVE per fare ci. . :TEXT_CMDHELP_SET#1 Visualizza, imposta, o cancella variabili d'ambiente. SET [/C] [/P] [variabile=[stringa]] variabile Specifica il nome della variabile d'ambiente. stringa Specifica una serie di caratteri da assegnare alla variabile. * Se non specificata una stringa, la variabile rimossa dall'ambiente. Digitare SET senza parametri per visualizzare le variabili d'ambiente attuali. /C mantiene il carattere maiuscolo/minuscolo del nome della variabile; per default la variabile convertita in mauscolo, se non gi presente nell'ambiente, altrimenti il carattere mantenuto. /P richiede all'utente una stringa, ed assegna l'input dell'utente alla variabile. . :TEXT_CMDHELP_SHIFT#1 Cambia la posizione dei parametri in un file batch. SHIFT [DOWN] DOWN sposta i parametri verso l'inizio (%%0); altrimenti verso la fine. . :TEXT_CMDHELP_TIME#1 Visualizza o imposta l'ora di sistema. TIME [/T] [ora] Digitare TIME senza parmetri per visualizzare l'ora attuale e immeterne una nuova. Premere INVIO per mantenere la stessa ora. /T impedisce che TIME diventi interattivo. . :TEXT_CMDHELP_TRUENAME Visualizza il nome completo di percorso del file/percorso specificato. TRUENAME [unit:][percorso][nomefile] . :TEXT_CMDHELP_TYPE Visualizza il contenuto di un file di testo. TYPE [unit:][percorso]nomefile . :TEXT_CMDHELP_VER Visualizza la versione ed altre informazioni sul programma shell di FreeDOS. VER [/R] [/W] [/D] [/C] /R Visualizza la versione del kernel ed altre informazioni. /W Visualizza la garanzia. /D Visualizza le informazioni per la redistribuzione. /C Visualizza i collaboratori. . :TEXT_CMDHELP_VERIFY Chiede a FreeDOS di verificare che i file siano scritti correttamente sul disco. VERIFY [ON | OFF] Digitare VERIFY senza parametri per visualizzare l'impostazione attuale di VERIFY. . :TEXT_CMDHELP_FDDEBUG Se la modalit debug compilata in FreeDOS, questo comando attiva o disattiva l'output di debug, o visualizza lo stato attuale. FDDEBUG [ON | OFF | nomefile] Digitare FDDEBUG senza parametri per visualizzare lo stato corrente. Se si specifica un file, tutto l'output di debug rediretto in questo file; l'output aggiunto al filee, se gi esistente. I nomi speciali "stdout" e "stderr" possono essere usati per redirigere l'output di debug sullo standard output o standard error. . :TEXT_CMDHELP_VOL Visualizza l'etichetta di volume e il numero di serie del disco, se esistenti. VOL [unit:] . :TEXT_CMDHELP_QUESTION#1 Visualizza la lista di comandi e funzionalit disponibili nel programma shell. ? ?comando [argomento] La prima variante visualizza tutti i comandi e le funzionalit disponibili. La seconda richiede conferma prima di eseguire il comando specificato come il modo tracciamento fosse attivo. . :TEXT_CMDHELP_WHICH Ricerca e visualizza il file eseguibile per ogni comando specificato. WHICH comando ... . :TEXT_CMDHELP_MEMORY#1 Visualizza la memoria usata da FreeCOM internamente. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 La destinazione del comando COPY non pu contentere il carattere pi ('+'). . :TEXT_DELETE_FILE#1% Cancellazione del file "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Impossibile scrivere sul file '%s'; disco pieno? (%lu byte richiesti) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% copiati %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% copiati %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM non pu essere un dispositivo: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Questo file non un FreeCOM valido o di una versione incompatibile: %s . :TEXT_ERROR_LOADING_STRINGS Caricamento delle risorse in memoria fallito, la posizione puntata da %COMSPEC% sembra non essere valida. Specificare un'altra posizione da cui FreeCOM pu provare a caricare le risorse, per esempio: C:\\COMMAND.COM o premi INVIO per annullare il caricamento. . :TEXT_TERMINATING Fine dell'elaborazione. . :TEXT_HIDDEN_CRITER#0% Richiesta di Errore Critico %u soppressa. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Codice d'uscita (ERRORLEVEL): %u, causa: %u (%s) . :TEXT_EXIT_REASON_NEG_1 errore API DOS\ . :TEXT_EXIT_REASON_0 terminato normalmente\ . :TEXT_EXIT_REASON_1 terminato da ^Interr (^Break)\ . :TEXT_EXIT_REASON_2 terminato da errore critico\ . :TEXT_EXIT_REASON_3 divenuto residente\ . ================================================ FILE: strings/makefile ================================================ # $Id$ # # Makefile for the FreeDOS kernel's command interpreter # # $Log$ # Revision 1.9 2003/12/09 20:25:35 skaus # bugfix: INIT: FreeCOM-path and TTY can be in any order # # Revision 1.8 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.7 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.lng and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # .INCLUDE : ../_config.mk LDLIBS !:= .IF $(LNG) != $(NULL) _LNG = $(LNG:u:s/.lng//) _LLNG = $(_LNG).lng _ELNG = $(LNG).err .ELSE _LLNG = _ELNG = .ENDIF OBJ := # Default target all: strings.h strings.dat strings.lib strings.err dist : ; .INIT : $(CFG) __errl __errl: @+-if exist errlist del errlist >nul -ctags *.c ..\lib\*.c strings.h strings.dat .UPDATEALL : fixstrs.exe DEFAULT.lng $(_LLNG) fixstrs.exe /lib $(LNG) +copy strings.h .. >nul strings.lib : fixstrs.exe DEFAULT.lng $(RUNMAKE) strings_lib strings_lib_clean strings_lib .SETDIR=strings : $(RUNMAKE) NDEBUG!:=Yes DEBUG!:= +copy strings.lib .. +copy strings.lst .. strings_lib_clean : -$(RM) -fr strings strings.err : critstrs.exe DEFAULT.err $(_ELNG) critstrs.exe $(LNG) fixstrs.exe ?= _MODEL !:= c fixstrs.exe : fixstrs.c ../include/strings.typ critstrs.exe ?= _MODEL !:= c critstrs.exe : critstrs.c #MAKEDEP START #MAKEDEP STOP clobber : clean $(RM) $(RMFLAGS) *.exe *.com ..\strings.h ..\strings.dat ..\string.err clean : strings_lib_clean $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) strings.h strings.dat $(RM) $(RMFLAGS) *.log strings.err strings.lib strings.lst ================================================ FILE: strings/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak COMPACT_MODEL = 1 TOP = .. !include "$(TOP)/config.mak" all : $(CFG) strings.h strings.err fixstrs.exe strings.h : DEFAULT.lng ..$(DIRSEP)utilsc$(DIRSEP)fixstrs.exe $(FIXSTRSOPT) $(LNG) $(CP) strings.h .. strings.err : DEFAULT.err ..$(DIRSEP)utilsc$(DIRSEP)critstrs.exe $(LNG) fixstrs.exe: fixstrs.c ================================================ FILE: strings/polish.err ================================================ # $Id$ # # Critical error national customization file # # Language: Polish # Codepage: 991 (Mazovia) # Author: Mateusz Viste "Fox" / the.killer@wp.pl # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Bd %1 dysku %A: %2 obszar: %3 S3 CHAR_DEVICE: Bd %1 urzdzenia %A: %3 ## kind of operation S0 READ: odczyt z S1 WRITE: zapis do ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: root S7 DATA: dane ## action strings S8 IGNORE: (I)gnoruj S9 RETRY: p(O)nw S10 ABORT: (P)rzerwij S11 FAIL: (Z)rezygnuj ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: pP KEYS_ABORT: eE KEYS_FAIL: zZ ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Nieznany kod bdu S15 0: prba pogwacenia ochrony przez zapisem 1: nieznana jednostka sterownika 2: napd nie jest gotowy 3: sterownik nie rozpozna polecenia 4: bd danych (bdne CRC) 5: bad device driver request structure length 6: bd wyszukiwania 7: nieznany typ nonika 8: sektor nie odnaleziony 9: brak papieru w drukarce 10: bd zapisu 11: bd odczytu 12: bd oglny 13: pogwacenie praw wspdzielenia 14: lock violation 15: nieprawidowa zmiana dysku 16: FCB niedostpne 17: przepenieniee wspdzielonych buforw 18: nieprawidowa strona kodowa 19: koniec wejcia 20: niewystarczajce miejsce na dysku ================================================ FILE: strings/polish.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Polish # Codepage: 991 (Mazovia) # Author: Mateusz Viste "Fox" / the.killer@wp.pl # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Niepoprawny parametr. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Niepoprawny parametr. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% le sformuowana opcja: '%s' . :TEXT_ERROR_OPT_ARG#0% Opcja '%s' nie moe mie argumentu . :TEXT_ERROR_OPT_NOARG#0% Opcja '%s' wymaga argumentu . :TEXT_INVALID_NUMBER#0% Niepoprawny numer w '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Brak zamykajcego cudzysowa: %c . :TEXT_ERROR_TEMPFILE Nie mona utworzy pliku tymczasowego . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Zbyt wiele parametrw. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Zbyt wiele parametrw. . :TEXT_ERROR_INVALID_PARAMETER#0% Niepoprawny parametr. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND cieki nie odnaleziono. . :TEXT_ERROR_FILE_NOT_FOUND Pliku nie odnaleziono. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Pliku nie odnaleziono. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Brak wymaganego parametru. . :TEXT_ERROR_INVALID_DRIVE#0% Niepoprawny napd %c:. . :TEXT_ERROR_BADCOMMAND#2% Ze polecenie lub nazwa pliku - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Bd: Brak pamici. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Alokacja pamici DOS nie powioda si. . :TEXT_ERROR_CANNOTPIPE BD! Nie mona otworzy pliku tymczasowego! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Linia #%ld pliku wsadowego '%s' jest za duga. . :TEXT_ERROR_BFILE_VANISHED#0% Nie odnaleziono pliku wsadowego '%s'. . :TEXT_ERROR_BFILE_LABEL#0% Plik wsadowy '%s' nie zawiera etykiety '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s nie powiodo si dla '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Nie mona ustawi zmiennej rodowiskowej '%s'. Przepenione rodowisko? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Nie odnaleziono zmiennej rodowiskowej '%s'. . :TEXT_ERROR_NO_ENVIRONMENT Brak rodowiska. Moe zbyt mao pamici. Sprbuj z parametrem /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Nie mog ustawi aliasu '%s'. Przestrze dla aliasw zapeniona? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' nie odnaleziony. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Brak przestrzeni dla aliasw. Moe zbyt mao pamici. . :TEXT_ERROR_SYNTAX_STR#0% Bd skadni. - '%s' . :TEXT_ERROR_SYNTAX Bd skadni. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Zbyt duga nazwa pliku. - '%s' . :TEXT_ERROR_SELFCOPY#0% Nie mog skopiowa '%s' na samego siebie. . :TEXT_ERROR_COMMAND_TOO_LONG Command line too long after alias expansion! . :TEXT_ERROR_LINE_TOO_LONG Linia zbyt duga. Nie mog wykona polecenia. . :TEXT_ERROR_HISTORY_SIZE#1% Nieprawidowy rozmiar historii '%s'. . :TEXT_HISTORY_EMPTY#1 Historia komend pusta. . :TEXT_ERROR_BAD_MCB_CHAIN acush MCB uszkodzony, lub system niekompatybilny z MS-DOS. . :TEXT_ERROR_UNDEFINED_ERROR#0% Nieznany bd %d. . :TEXT_ERROR_REGION_WARNING#0% Niedozwolony region pamici %d - ignorowany. . :TEXT_ERROR_ON_OR_OFF Naley poda ON lub OFF. . :TEXT_ERROR_BAD_VARIABLE Niepoprawna specyfikacja zmiennej. . :TEXT_ERROR_IN_MISSING#1 FOR: brak operatora IN. . :TEXT_ERROR_MISSING_PARENTHESES#1 Brakuje jednego lub obu nawiasw. . :TEXT_ERROR_DO_MISSING#1 FOR: Brak operatora DO. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Brak komendy po operatorze DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Nie mona przekierowa rda z pliku '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Nie mona przekierowa wyjcia do pliku '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Puste przekierowanie. . :TEXT_ERROR_INVALID_DATE Nieprawidowa data. . :TEXT_ERROR_INVALID_TIME Nieprawidowy czas. . :TEXT_ERROR_NO_GOTO_LABEL Brak okrelonej etykiety dla GOTO. . :TEXT_CTTY_NOTIMPLEMENTED The CTTY command has been excluded from this COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% Urzdzenie nieprawidowe, lub nie wspiera operacji odczyt/zapis '%s'. . :TEXT_ERROR_CTTY_DUP#0% Failed to change file descriptors to TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L jeszcze nie zaimplementowane. . :TEXT_ERROR_U_NOTIMPLEMENTED /U jeszcze nie zaimplementowane. . :TEXT_ERROR_WRITING_DEST Bd zapisu u celu. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Nie mona otworzy rda. - '%s' . :TEXT_ERROR_OPEN_FILE#0% Nie mona otworzy pliku '%s' . :TEXT_ERROR_READ_FILE#0% Nie mona odczyta z pliku '%s' . :TEXT_ERROR_WRITE_FILE#0% Nie mona zapisa pliku '%s' . :TEXT_ERROR_LEADING_PLUS Znak '+' nie moe znajdowa si przed argumentem. . :TEXT_ERROR_TRAILING_PLUS Znak '+' nie moe znajdowa si za argumentem. . :TEXT_ERROR_NOTHING_TO_DO Nie ma niczego do wykonania. . :TEXT_ERROR_COPY COPY nie powiodo si . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: brak nazwy pliku . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: brak numeru . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: nieprawidowy numer . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: brak komendy . :TEXT_NOT_IMPLEMENTED_YET Przykro mi... Jeszcze nie zaimplementowane. . :TEXT_FAILED_LOAD_STRINGS Nie udao si zaadowa komunikatw do pamici. . :TEXT_MSG_NOTIMPLEMENTED The /MSG option has been excluded from this COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% Wywietlono %u jednostek. . :TEXT_CORRUPT_COMMAND_LINE Uszkodzona linia polece. To jest wewntrzny bd i jest zwizany z systemowym COMMAND.COM. Prosz powiadomi zesp FreeDOS o tym bdzie. . :TEXT_QUOTED_C_OR_K#1 The /C and /K options cannot be quoted, they are ignored. . :TEXT_INIT_FULLY_QUALIFIED#1% cieka do COMMAND.COM musi by w peni opracowana! To oznacza, e musi skada si z litery napdu i zaczyna si backslash'em. Na przykad: C:\\FDOS COMMAND.COM sprbuje teraz t ciek: %s . :TEXT_ERROR_RESTORE_SESSION The session information could not be restored, any local settings are lost. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_SAVE_SESSION The current information cannot be preserved during the call of the program. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_CWD_FAILED#1% Dysk %c: nie odpowiada. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swapping failed: Aliases allocate too much memory. . :TEXT_ERROR_KSWAP_ALLOCMEM Swapping failed: Cannot allocate far memory. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Brak pamici aliasw. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Nie ma takiego aliasu: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Nie udao si doda aliasu. . :TEXT_ALIAS_INVALID_NAME#1% Nieprawidowa nazwa aliasu '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Nie udao si zaadowa moduu kontekstowego lub bd krytyczny. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Brak pamici kontekstowej. Jeli bd bdzie si powtarza, sprbuj zwikszy jakie wewntrzne bufory, takie jak historia, stos katalogw itp. . :TEXT_ERROR_CONTEXT_LENGTH#1% Kontekst wielkoci %lu bajtw przekracza maksymalny limit. Kontekst zostanie pomniejszony do %u bajtw. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Dodanie informacji o statusie do kontekstu nie powiodo si. Moe to wskazywa na bd pamici lub nieprawidowo okrelon minimaln wielko kontekstu. Prosz powiadomi gospodarza FreeCOM na: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Kontekst zosta utracony w trakcie swapping'u. Kontekst zostanie odtworzony, jednake wszystkie aliasy itd. zostan utracone. . # # Informational messages # :TEXT_MSG_PAUSE#1 Nacinij dowolny klawisz aby kontynuowa...\ . :TEXT_MSG_HISTORY_SIZE#0% Wielkoc historii to %d bajtw. . :TEXT_MSG_DOSKEY DOSKEY ju jest aktywny w shell'u. . :TEXT_MSG_ECHO_STATE#0% ECHO jest %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY jest %s . :TEXT_MSG_FDDEBUG_STATE#0% Wyjcie DEBUG jest %s. . :TEXT_MSG_FDDEBUG_TARGET#0% Wyjcie DEBUG jest drukowane do '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK jest %s . :TEXT_MSG_CURRENT_DATE#0% Obecna data to %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Wprowad now dat (mm%sdd%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Wprowad now dat (dd%smm%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Wprowad now dat ([cc]yy%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME#0% Teraz jest godzina %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Wprowad now godzin: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% TtNn{CR}{LF}{CBREAK} aabb b b b Wszystkie pliki z '%s' zostan wykasowane! Czy jeste pewien (T/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 TyNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Tak=ENTER, Nie=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% TtNnWwQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Wcinito Control-Break.\r Zatrzyma plik wsadowy '%s' (Tak/Nie/Wszystkie) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% TtNnWwKk{BREAK}{ENTER}{ESC} aabbccdd d a b Czy nadpisa '%s' (Tak/Nie/Wszystkie/Koniec) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% TtNnWwKk{BREAK}{ENTER}{ESC} aabbccdd d a b Czy dopisa do '%s' (Tak/Nie/Wszystkie/Koniec) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% TtNnWwKk{BREAK}{ENTER}{ESC} aabbccdd d a b Wykasowa '%s' (Tak/Nie/Wszystkie/Koniec) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Stos katalogw jest pusty. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Zbir w stacji %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% to %s . :TEXT_DIR_HDR_VOLUME_NONE nie ma etykiety . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Numer seryjny zbioru to %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s pliki(w)\ . :TEXT_DIR_FTR_BYTES#0% %12s bajtw . :TEXT_DIR_FTR_TOTAL_NUMBER Wszystkich plikw: . :TEXT_DIR_FTR_DIRS#1% %10s katalogi(w)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s bajtw wolnych . :TEXT_DIR_DIRECTORY#0% Katalog %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Katalog %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Nie podano cieki poszukiwa. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Nie\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Pon\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Wto\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 ro\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Czw\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Pi\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sob\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 nie usunito adnego pliku. . :TEXT_MSG_DEL_CNT_FILES_1#1 usunito jeden plik. . :TEXT_MSG_DEL_CNT_FILES_2#1% plikw usunitych: %u . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Dostpne komendy wewntrzne: . :TEXT_MSG_SHOWCMD_FEATURES Dostpne usugi: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliases] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [enhanced input] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [history] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [filename completion] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [swapping] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start logging] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [last dir] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS swap] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [default to swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [installable commands] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [directory stack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM debugging] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Wcinij F8 dla trybu krok po kroku, lub F5 by obej %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Obchodzenie '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% Wersja DOS: %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Jdro FreeDOS (build 1933 lub nowszy) . :TEXT_MSG_VER_LATER_FREEDOS#0% Wersja jdra FreeDOS: %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman i inni. Niniejszy program rozpowszechniany jest z nadziej, i bdzie uyteczny, jednak BEZ JAKIEJKOLWIEK GWARANCJI, nawet domylnej gwarancji PRZYDATNOCI HANDLOWEJ albo PRZYDATNOCI DO OKRELONYCH ZASTOSOWA. W celu uzyskania bliszych informacji zapoznaj si z GNU General Public License. Raporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net Nowe wersje dostpne pod http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman i inni. Niniejszy program jest wolnym oprogramowaniem; moesz go rozprowadza dalej i/lub modyfikowa na warunkach Powszechnej Licencji Publicznej GNU, wydanej przez Fundacj Wolnego Oprogramowania - wedug wersji 2-giej tej Licencji lub ktrej z pniejszych wersji. Raporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net Nowe wersje dostpne pod http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS Shell FreeDOS jest rozwijany przez wielu twrcw, prosz zapozna si z zaczonym plikiem HISTORY.TXT. Raporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net Nowe wersje dostpne pod http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Shell zostanie zakoczony, pomimo, i jest to zabronione (prawdopodobnie\r atywna jest opcja "/P").\r Naley zrestartowa system, lub - jeli shell jest uruchomiony w\r rodowisku wielozadaniowym - zakoczy ten proces/zadanie rcznie.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Plik wykonywalny FreeCOM nie zosta odnaleziony. Naley okreli pen ciek do COMMAND.COM jako pierwszy argument za COMMAND, na razie: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Segment rodowiska : maks %5u bajtw; wolnych %5u bajtw . :TEXT_MEMORY_CONTEXT#1% Segment kontekstowy : maks %5u bajtw; wolnych %5u bajtw . :TEXT_MEMORY_HEAP#1% Stos : wolnych %5lu bajtw . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliases : limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistory : limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tDirectory stack: limit %5u bytes, current %5u bytes, %5u items . :TEXT_MEMORY_CTXT_LASTDIR#1% \tLast dir cache : used %5u bytes, %5u items . :TEXT_MEMORY_CTXT_BATCH#1% \tBatch nesting : used %5u bytes, %5u items . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : used %5u bytes, %5u items . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Nie udao si uzyska obecnej strony kodowej od systemu. . :TEXT_ERROR_SET_CODEPAGE#1 Zmiana obecnej strony kodowej nie powioda si. . :TEXT_DISPLAY_CODEPAGE#1% Obecna strona kodowa to %u. Systemowa strona kodowa to: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Wywietla, ustawia lub usuwa aliasy. ALIAS [zmienna[=][string]] variable Okrela nazw aliasu. string Okrela seri znakw przyporzdkowanych aliasowi. Wpisz ALIAS bez parametrw by wywietli obecny aliasy. . :TEXT_CMDHELP_BEEP Odgrywa jeden BEEP. . :TEXT_CMDHELP_BREAK Ustawia lub czyci stan sprawdzania klawiszy CTRL+C. BREAK [ON | OFF] Wpisz BREAK bez parametrw by wywietli obecny stan. . :TEXT_CMDHELP_CALL#1 Wywouje jeden program wsadowy z innego. CALL [/S | /N] [/Y] [dysk:][cieka]nazwapliku [parametry wsadowe] parametry wsadowe Okrela wszystkie informacje wymagane przez program wsadowy w wierszu polece. /S wcza, /N wycza swapping dla FreeCOM. /Y wcza tryb "krok po kroku". . :TEXT_CMDHELP_CD Wywietla nazw obecnego katalogu lub zmienia katalog na inny. CHDIR [dysk:][cieka] CHDIR[..] CD [dysk:][cieka] CD[..] CD - .. Okrela e uytkownik chce przej do katalogu nadrzdnego. - Jeli usuga "ostatni katalog" jest wczona, przechodzi do niego. Wpisz CD dysk: aby wywietli obceny katalog podanego dysku. Wpisz CD bez parametrw aby wywietli obecny katalog i obecny dysk. Zobacz take: CDD . :TEXT_CMDHELP_CDD Wywietla obecny dysk i katalog lub przechodzi do innego dysku i katalogu. CDD [dysk:][cieka] CDD[..] .. Okrela e uytkownik chce przej do katalogu nadrzdnego. - Jeli usuga "ostatni katalog" jest wczona, przechodzi do niego. Jeli "dysk:" jest okrelony i rni si od obecnego, interpreter przechodzi do niego; to jest jedyna rnica midzy "CD" a "CDD". Wpisz CD bez parametrw aby wywietli obecny dysk i katalog. . :TEXT_CMDHELP_CHCP Wywietla lub ustawia aktywn stron kodow. CHCP [nnn] nnn Okrela numer strony kodowej. Wpisz CHCP bez parametrw aby wywietli aktywn stron kodow. . :TEXT_CMDHELP_CLS Czyci ekran. CLS . :TEXT_CMDHELP_COMMAND Uruchamia now kopi interpretra komend (shell'u) FreeDOS. COMMAND [[dysk:]cieka] [urzdzenie] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] command]] [dysk:]cieka Okrela dysk i katalog zawierajce COMMAND.COM. urzdzenie Okrela urzdzenie uywane dla wyj/wej. /E:nnnnn Ustawia pierwotn wielko rodowiska na nnnnn bajtw. (nnnnn powinno zawiera si midzy 256 a 32,768). /L:nnnn Ustawia dugo wewntrznych buforw (wymaga /P). (nnnn powinno zawiera si midzy 128 a 1,024). /U:nnn Ustawia dugo bufora wejciowego (wymaga /P). (nnn powinno zawiera si midzy 128 a 255). /P aduje nowy interpreter komend (shell) na stae. /MSG Skaduje wszystkie komunikaty bdw w pamici (wymaga /P). /LOW Wymusza na interpreterze komend prac w pamici niskiej. /Y Wykonuje plik wsadowy podany z /C lub /K krok po kroku. /C polecenie Wykonuje okrelone polecenie i powraca. /K polecenie Wykonuja okrelone polecenie i kontynuuje dziaanie. . :TEXT_CMDHELP_COPY Kopiuje jeden lub wicej plikw w inne miejsce. COPY [/A | /B] rdo [/A | /B] [+ rdo [/A | /B] [+ ...]] [destynacja [/A | /B]] [/V] [/Y | /-Y] rdo Okrela plik lub pliki majce zosta skopiowane. /A Wskazuje e plik jest plikiem tekstowym ASCII. /B Wskazuje e plik jest binarny. destination Okrela katalog i/lub nazw pliku dla nowego(ych) pliku(w). /V Sprawdza czy pliki zostay poprawnie zapisane. /Y Automatycznie odpowiada "tak" na kade pytanie o nadpisanie istniejcych plikw u celu. /-Y Wymusza pytanie przed kadym nadpisaniem istniejcego pliku u celu. Parametr /Y moe znajdowa si w zmiennej COPYCMD. Moe by anulowany z linii polece za pomoc parametru /-Y. Aby dopisa pliki, naley poda jeden plik jako cel, a wiele plikw jako rdo (uywajc masek lub formatu plik1+plik2+plik3). . :TEXT_CMDHELP_CTTY Zmienia terminal zarzdzajcy systemem. CTTY urzdzenie urzdzenie Urzdzenie majce zosta wykorzystane, takie jak np COM1. . :TEXT_CMDHELP_DATE#1 Wywietla lub ustawia dat. DATE [/D] [data] Wpisz DATE bez parametrw aby wywietli obecne ustawienia daty i zapytanie o wprowadzenie nowej. Wcinij ENTER aby zachowa t sam dat. /D wycza interaktywno programu DATE. . :TEXT_CMDHELP_DEL#2 Usuwa jeden lub wicej plikw DEL [dysk:][cieka]nazwapliku [/P] [/V] ERASE [dysk:][cieka]nazwapliku [/P] [/V] [dysk:][cieka]nazwapliku Okrela plik(i) do wykasowania. /P Pyta o potwierdzenie przed wykasowaniem kadego pliku. /V Wywietla wszystkie wykasowane pliki. . :TEXT_CMDHELP_DIR#4 Wywietla list plikw i podkatalogw w katalogu. DIR [dysk:][cieka][nazwapliku] [/P] [/W] [/A[[:]atrybuty]] [/O[[:]kolejno]] [/S] [/B] [/L] [dysk:][cieka][nazwapliku] Okrela dysk, katalog i/lub pliki do wywietlenia. (Mona uywa wielu masek) /P Zatrzymuje si po kadym wywietleniu penego ekranu. /W Uywa formatu rozszerzonej listy. /A Wywietla pliki z okrelonym atrybutem. (Domylnie to /ADHSRA) atrybuty D Katalogi R Pliki tylko-do-odczytu H Pliki ukryte A Pliki gotowe do archiwizacji S Pliki systemowe - Prefiks negujcy /O Sortuje pliki. kolejno N Po nazwach (alfabetycznie) S Po wielkoci (od mniejszych) E Po rozszerzeniach (alf.) D Po dacie i czasie (od modszych) G Grupuje najpierw katalogi - Prefiks odwracajcy kolejno U Wycza sortowanie Domylne to /ONG /S Wywietla pliki w podanym katalogu i wszystkich podkatalogach. /B Wywietla pliki w jednej kolumnie. /L Uywa maych liter. /Y or /4 Uywa czterocyfrowej daty. Parametry mog by z gry ustawione w zmiennej DIRCMD. . :TEXT_CMDHELP_DOSKEY#1 Zewntrzny program uytkowy DOSKEY zosta zaimplementowany wewntrz FreeCOM. Uyj kursorw gra/d by przewija histori, a polecenia HISTORY by j w peni wywietli. Uyj klawiszy prawo/lewo i END oraz HOME by porusza si w linii polece, za pomoc klawisza INSERT moesz przechodzi z trybu wstawiania do trybu zamiany. Uyj klawisza TAB by kompletowa nazwy plikw; wciskaj dwukrotnie by zobaczy wszystkie pasujce pliki. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edits command lines, recalls command lines, and creates macros DOSKEY [/switch ...] [macroname=[text]] /BUFSIZE:size Sets size of macro and command buffer (default:512) /ECHO:on|off Enables/disables echo of macro expansions (default:on) /FILE:file Specifies file containing a list of macros /HISTORY Displays all commands stored in memory /INSERT Inserts new characters into line when typing /KEYSIZE:size Sets size of keyboard type-ahead buffer (default:15) /LINE:size Sets maximum size of line edit buffer (default:128) /MACROS Displays all DOSKey macros /OVERSTRIKE Overwrites new characters onto line when typing (default) /REINSTALL Installs a new copy of DOSKey macroname Specifies a name for a macro you create text Specifies commands you want to assign to the macro UP,DOWN arrows recall commands Esc clears current command F7 displays command history Alt+F7 clears command history [chars]F8 searches for command beginning with [chars] F9 selects a command by number Alt+F10 clears macro definitions The following are special codes you can use in DOSKey macro definitions: $T Command separator: allows multiple commands in a macro $1-$9 Batch parameters: equivalent to %1-%9 in batch programs $* Symbol replaced by everything following macro name on the command line . :TEXT_CMDHELP_ECHO Wywietla komunikaty, lub wcza/wycza zwracanie echa. ECHO [ON | OFF] ECHO [komunikat] Wpisz ECHO bez parametrw by wywietli obecne ustawienie zwracania echa. . :TEXT_CMDHELP_EXIT Wychodzi z interpretara komend FreeDOS, chyba e zosta zaadowany z /P. EXIT . :TEXT_CMDHELP_FOR Uruchamia podane polecenie dla kadego pliku z zestawu plikw. FOR %%zmienna IN (zestaw) DO polecenie [parametry polecenia] %%zmienna Okrela parametr wymienny. (zestaw) Okrela zestaw jednego lub kilku plikw. Uywanie symboli wieloznacznych jest dozwolone. polecenie Okrela polecenie, ktre ma zosta wykonane dla kadego pliku. parametry polecenia Okrela parametry lub przeczniki dla okrelonego polecenia. Aby uy polecenia FOR w programie wsadowym, naley uywa %%%%zmienna zamiast %%zmienna. Na przykad: FOR %%f IN (a*.*) DO ECHO - %%f - . :TEXT_CMDHELP_GOTO Przekierowuje interpreter komend do zaetykietowanej linii pliku wsadowego. GOTO etykieta etykieta Okrela cig znakw uywanych w pliku wsadowym jako etykieta. Etykieta w pliku musi znajdowa si sama w linii i by poprzedzona dwukropkiem. . :TEXT_CMDHELP_HISTORY#1 Historia polece. HISTORY [wielko] Bez parametru "wielko", program wywietla histori polece. Wywoanie z parametrem "wielko" powoduje zmian wielkoci bufora historii. . :TEXT_CMDHELP_IF Dokonuje warunkowego przetwarzania w plikach wsadowych. IF [NOT] ERRORLEVEL liczba polecenie IF [NOT] cig1==cig2 polecenie IF [NOT] EXIST nazwapliku polecenie NOT Wskazuje, e system powinien wykona polecenie tylko wtedy, gdy warunek nie jest speniony. ERRORLEVEL liczba Okrela warunek prawdziwy, jeeli ostatni uruchomiony program zwrci kod wyjcia rwny lub wikszy od podanej liczby. polecenie Okrela polecenie, ktre ma zosta wykonane, jeeli warunek zostanie speniony. cig1==cig2 Okrela warunek prawdziwy, jeeli podane cigi tekstowe s rwne. EXIST nazwapliku Okrela warunek prawdziwy, jeeli okrelona nazwa pliku istnieje. . :TEXT_CMDHELP_LH aduje program w grny obszar pamici. LOADHIGH [dysk:][cieka]nazwapliku [parametry] LOADHIGH [/L:region1[,wielko1][;region2[,wielko2]...] [/S]] [dysk:][cieka]nazwapliku [parametry] /L:region1[,wielko1][;region2[,wielko2]]... Okrela region(y) pamici do ktrych zaadowa program. Region1 okrela pierwszego regionu pamici; wielko1 okrela jego minimaln wielko. Region2 i wielko2 okrelaj numer i minimaln wielko drugiego regionu. Mona okreli nieograniczon liczb regionw. /S Zwiera UMB to minimalnej wielkoci podczas adowania programu. [dysk:][cieka]nazwapliku Okrela umiejscowienie i nazw programu. . :TEXT_CMDHELP_LOADFIX aduje program powyej pierwszych 64KB pamici i uruchamia go. LOADFIX [dysk:][cieka]nazwapliku Uyj LOADFIX do zaadowania programu jeli otrzymae komunikat "Packed file corrupt" podczas prby zaadowania go do pamici niskiej. . :TEXT_CMDHELP_MD Tworzy katalog. MKDIR [dysk:]cieka MD [dysk:]cieka . :TEXT_CMDHELP_PATH Wywietla lub ustawia ciek dla plikw wykonywalnych. PATH [[dysk:]cieka[;...]] PATH ; Aby wyczyci ustawienie cieki przeszukiwania i wybra do przeszukiwania jedynie biecy katalog, wpisz PATH ;. Aby wywietli biec ciek, wpisz PATH. . :TEXT_CMDHELP_PAUSE Wstrzymuje przetwarzanie pliku wsadowego i wywietla komunikat "Nacinij dowolny klawisz aby kontynuowa..." lub inny jeli zostanie okrelony. PAUSE [komunikat] . :TEXT_CMDHELP_PROMPT Zmienia znak zgoszenia. PROMPT [tekst] tekst Okrela nowy znak zgoszenia. Znak zgoszenia mona zbudowa z normalnych znakw oraz nastpujcych znakw specjalnych: $Q = (znak rwnoci) $$ $ (symbol dolara) $T Bieca godzina $D Bieca data $P Biecy dysk i cieka $V Numer wersji interpretera komend FreeDOS $N Biecy dysk $G > (znak wikszoci) $L < (znak mniejszoci) $B | (potok) $H Cofacz (usuwa poprzedni znak) $E Kod escape (kod ASCII 27) $_ Powrt karetki i znak wysuwu wiersza Aby przywrci domylne ustawienia znaku zgoszenia, wpisz PROMPT. . :TEXT_CMDHELP_PUSHD Wstawia obecny katalog do stosu katalogw, umoliwiajc przejcie do innego katalogu. PUSHD [[dysk:]cieka] Gdzie [dysk:]cieka jest ciek do ktrej nastpi przejcie. . :TEXT_CMDHELP_POPD Odczytuje katalog ze stosu katalogw i przechodzi do niego. POPD [*] Parametr '*' czyci stos katalogw. . :TEXT_CMDHELP_DIRS Wywietla zawarto stosu katalogw. DIRS . :TEXT_CMDHELP_RD Usuwa katalog. RMDIR [dysk:]cieka RD [dysk:]cieka . :TEXT_CMDHELP_REM Umoliwa wstawianie komentarzy do plikw wsadowych oraz w CONFIG.SYS REM [komentarz] . :TEXT_CMDHELP_REN Zmienia nazw pliku/katalogu lub plikw/katalogw. RENAME [dysk:][cieka][katalog1 | plik1] [katalog2 | plik2] REN [dysk:][cieka][katalog1 | plik1] [katalog2 | plik2] Zauwa, e nie mona poda innego dysku ani innej cieki dla nowego pliku bd katalogu. Dla tego celu uyj polecenia MOVE. . :TEXT_CMDHELP_SET#1 Wywietla, ustawia, lub usuwa zmienne rodowiskowe. SET [/C] [/P] [zmienna=[warto]] zmienna Okrela nazw zmiennej rodowiskowej. warto Przyporzdkowuje cig znakw okrelonej zmiennej. * Jeeli adna warto nie zostanie podana, zmienna jest usuwana. Wpisz SET bez parametrw aby wywietli wszystkie zmienne obecne w systemie. /C Zachowuje wielko liter nazwy zmiennej; domylnie nazwa zmiennej przeksztacana jest na wielkie litery. /P Pyta uytkownika wartoci i przyporzdkowuje tekst wpisany przez uytkownika zmiennej. . :TEXT_CMDHELP_SHIFT#1 Zmienia pozycje parametrw w pliku wsadowym. SHIFT [DOWN] DOWN przesuwa wartoci w kierunku pocztku (%%0); w przeciwnym wypadku w kierunku koca. . :TEXT_CMDHELP_TIME#1 Wywietla lub ustawia czas systemowy. TIME [/T] [time] Wpisz TIME bez adnych parametrw aby wywieti obecny czas wraz z pytaniem o jego zmian. Wcinij ENTER aby zachowa ten sam czas. /T Wycza interaktywno programu TIME. . :TEXT_CMDHELP_TRUENAME Wywietla pen ciek okrelonej cieki. TRUENAME [dysk:][cieka][nazwapliku] . :TEXT_CMDHELP_TYPE Wywietla zawarto plikw tekstowych. TYPE [dysk:][cieka]nazwapliku . :TEXT_CMDHELP_VER Wywietla wersj shell'u FreeDOS i inne informacje. VER [/R] [/W] [/D] [/C] /R Wywietla wersj jdra i inne informacje. /W Gwarancja shell'u FreeDOS. /D Informacje na temat rozpowszechniania shell'u FreeDOS. /C Wsptwrcy shell'u FreeDOS. . :TEXT_CMDHELP_VERIFY Nakazuje systemowi plikw FreeDOS sprawdzanie poprawnoci zapisu plikw na dysk. VERIFY [ON | OFF] Wpisz VERIFY bez parametru aby wywietli obecny ustawienie VERIFY. . :TEXT_CMDHELP_FDDEBUG Jeli debugowanie jest wkompilowane w FreeDOS, polecenie to wczy lub wyczy komunikaty debug, lub wywietli w jakim jest obecnie stanie. FDDEBUG [ON | OFF | plik] Wpisz FDDEBUG bez parametru aby wywietli obecny stan DEBUG. Jeli podany jest jaki plik, wszystkie komunikaty debug zostan przekierowane do tego pliku; jeli plik ju istnieje, komunikaty zostan do niego dodane. Urzdzenia specjalne "stdout" i "stderr" mog by uyte do przekierowania komunikatw do standardowego wyjcia lub wyjcia bdw. . :TEXT_CMDHELP_VOL Wywietla etykiet zbioru oraz numer seryjny, jeli istniej. VOL [dysk:] . :TEXT_CMDHELP_QUESTION#1 Wywietla list polece i usug dostpnych poprzez shell. ? ?polecenie [argument] Pierwszy wariant wywietla wszystkie dostpne polecenia i usugi wewntrzne. Drugi pyta o potwierdzenie wykonania polecenia tak jakby wczony by tryb "krok po kroku" . :TEXT_CMDHELP_WHICH Wyszukuje i wywietla plik wykonywalny odpowiedzialny za podane polecenie. WHICH polecenie... . :TEXT_CMDHELP_MEMORY#1 Wywietla wewntrzn pami uywan przez FreeCOM. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 cieka docelowa COPY nie moe zawiera znaku plus ('+'). . :TEXT_DELETE_FILE#1% Kasowanie pliku "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Nie mona pisa do pliku '%s'; dysk prawdopodobnie peny? (%lu wymaganych bajtw) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% skopiowano %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% skopiowano %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM nie moe by urzdzeniem: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Plik nie jest prawidowym plikiem FreeCOM, lub jest w niekompatybilnej wersji: %s . :TEXT_ERROR_LOADING_STRINGS Failed to load the strings resource into memory, the location pointed to in %COMSPEC% seems to be invalid. Please specify another location of FreeCOM to try to load the strings from, e.g.: C:\\COMMAND.COM or just hit enter to cancel to load the strings. . :TEXT_TERMINATING Zakaczanie w toku. . :TEXT_HIDDEN_CRITER#0% %u Critical Error requests suppressed. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Exit code (ERRORLEVEL): %u, reason: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS API error\ . :TEXT_EXIT_REASON_0 zakoczono poprawnie\ . :TEXT_EXIT_REASON_1 terminated by ^Break\ . :TEXT_EXIT_REASON_2 zakoczono krytycznym bdem\ . :TEXT_EXIT_REASON_3 gone resident\ . ================================================ FILE: strings/pt.err ================================================ # $Id: DEFAULT.ERR $ # # Critical error national customization file # # Language: Portuguese # Codepage: CP860 # Author: Fabjo Arbaro # ## Primary strings S2 BLOCK_DEVICE: Erro %1 na unidade %A: %2 rea: %3 S3 CHAR_DEVICE: Erro %1 no dispositivo %A: %3 ## kind of operation S0 READ: lendo de S1 WRITE: escrevendo para ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: raiz S7 DATA: dados ## action strings S8 IGNORE: (I)gnorar S9 RETRY: (R)epetir S10 ABORT: (A)bortar S11 FAIL: (F)alhar ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Cdigo de erro desconhecido S15 0: tentativa de violao de proteco de escrita 1: unidade desconhecida para controlador 2: unidade no preparada 3: comando desconhecido dado a controlador 4: erro de dados (cdigo CRC invlido) 5: dimenso da estructura de pedido ao controlador invlida 6: erro de busca 7: tipo de suporte desconhecido 8: sector no encontrado 9: impressora sem papel 10: falha de escrita 11: falha de leitura 12: falha genrica 13: falha de partilha 14: falha de bloqueio 15: troca de disco invlida 16: FCB indisponvel 17: memria partilhada esgotada 18: pgina de cdigos incompatvel 19: entrada esgotada 20: espao em disco insuficiente ================================================ FILE: strings/pt.lng ================================================ # $Id: DEFAULT.LNG $ # # FreeCOM national customization file # # Language: Portuguese # Codepage: CP860 # Author: Fabjo Arbaro # # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Parmetro invlido. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Parmetro invlido. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Opo malformada: '%s' . :TEXT_ERROR_OPT_ARG#0% Opo '%s' no pode ter argumentos . :TEXT_ERROR_OPT_NOARG#0% Opo '%s' deve ter um argumento . :TEXT_INVALID_NUMBER#0% Nmero invlido especificado em '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% Fecho de aspas em falta: %c . :TEXT_ERROR_TEMPFILE No possvel criar ficheiro temporrio . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Demasiados parmetros. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Demasiados parmetros. . :TEXT_ERROR_INVALID_PARAMETER#0% Parmetro invlido. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Caminho no encontrado. . :TEXT_ERROR_FILE_NOT_FOUND Ficheiro no encontrado. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Ficheiro no encontrado. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Parmetro obrigatrio em falta. . :TEXT_ERROR_INVALID_DRIVE#0% Unidade invlida %c:. . :TEXT_ERROR_BADCOMMAND#2% Comando ou nome de ficheiro no reconhecidos - '%s'. . :TEXT_ERROR_OUT_OF_MEMORY Memria esgotada. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 No possvel alocar memoria. . :TEXT_ERROR_CANNOTPIPE No possvel abrir ficheiro temporrio para redireccionamento. . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Linha #%ld no ficheiro batch '%s' demasiado longa. . :TEXT_ERROR_BFILE_VANISHED#0% Ficheiro batch '%s' no encontrado. . :TEXT_ERROR_BFILE_LABEL#0% Ficheiro batch '%s' no contem a etiqueta '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s falhou para '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% No possvel alterar varivel de ambiente '%s'. Ambiente pode estar cheio. . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Varivel de ambiente '%s' no encontrada. . :TEXT_ERROR_NO_ENVIRONMENT No h ambiente. Pode faltar memria. Use a opo /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% No possvel definir alias '%s'. Pode no existir espao. . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Alias '%s' no encontrado. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 No h espao para alias. Pode faltar memria. . :TEXT_ERROR_SYNTAX_STR#0% Erro de sntaxe. - '%s' . :TEXT_ERROR_SYNTAX Erro de sntaxe. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Nome de ficheiro demasiado longo. - '%s' . :TEXT_ERROR_SELFCOPY#0% No possvel copiar '%s' para si mesmo . :TEXT_ERROR_COMMAND_TOO_LONG Linha de comandos demasiado longa aps expanso. . :TEXT_ERROR_LINE_TOO_LONG Linha de comandos ultrapassa os 125 caracteres. . :TEXT_ERROR_HISTORY_SIZE#1% Tamanho de histrico invlido '%s'. . :TEXT_HISTORY_EMPTY#1 Histrico de linha de comandos vazio. . :TEXT_ERROR_BAD_MCB_CHAIN Cadeia MCB invlida ou sistema incompatvel com DOS. . :TEXT_ERROR_UNDEFINED_ERROR#0% Erro indefinido %d. . :TEXT_ERROR_REGION_WARNING#0% Regio de memria invlida %d ignorada. . :TEXT_ERROR_ON_OR_OFF Deve especificar ON ou OFF. . :TEXT_ERROR_BAD_VARIABLE Especificao de varivel invlida. . :TEXT_ERROR_IN_MISSING#1 FOR: IN em falta. . :TEXT_ERROR_MISSING_PARENTHESES#1 Parntesis em falta. . :TEXT_ERROR_DO_MISSING#1 FOR: DO em falta. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Comando em falta aps DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% No possvel redireccionar entrada de ficheiro '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% No possvel redireccionar sada para ficheiro '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Rediccionamento vazio. . :TEXT_ERROR_INVALID_DATE Data invlida. . :TEXT_ERROR_INVALID_TIME Hora invlida. . :TEXT_ERROR_NO_GOTO_LABEL Etiqueta no especificada em GOTO. . :TEXT_CTTY_NOTIMPLEMENTED Comando CTTY no implementado neste COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% Dispositivo invlido ou sem acesso de leitura-escrita '%s'. . :TEXT_ERROR_CTTY_DUP#0% No foi possvel alterar o descritor do TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED Opo /L no implementada. . :TEXT_ERROR_U_NOTIMPLEMENTED Opo /U no implementada. . :TEXT_ERROR_WRITING_DEST Erro ao escrever para destino. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% No possvel abrir origem '%s' . :TEXT_ERROR_OPEN_FILE#0% No possvel abrir ficheiro '%s' . :TEXT_ERROR_READ_FILE#0% No possvel ler de ficheiro '%s' . :TEXT_ERROR_WRITE_FILE#0% No possvel escrever para ficheiro '%s' . :TEXT_ERROR_LEADING_PLUS Carcter de concatenao '+' no pode preceder os argumentos. . :TEXT_ERROR_TRAILING_PLUS Carcter de concatenao '+' no pode seguir-se aos argumentos. . :TEXT_ERROR_NOTHING_TO_DO Nada por fazer. . :TEXT_ERROR_COPY COPY falhou . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: nome de ficheiro em falta . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: nmero em falta . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: nmero invlido . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Comando em falta . :TEXT_NOT_IMPLEMENTED_YET Ainda no implementado. . :TEXT_FAILED_LOAD_STRINGS No foi possvel carregar mensagens para memria. . :TEXT_MSG_NOTIMPLEMENTED Opo /MSG foi excluda deste COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u itens mostrados. . :TEXT_CORRUPT_COMMAND_LINE Linha de comandos corrompida. Este um erro interno no intrprete de comandos. Por favor, reporte o problema para . . :TEXT_QUOTED_C_OR_K#1 As opes /C e /K no podem estar entre aspas (estas so ignoradas). . :TEXT_INIT_FULLY_QUALIFIED#1% Caminho para COMMAND.COM deve ser completo. Exemplo: C:\\FDOS COMMAND.COM assumir este caminho agora: %s . :TEXT_ERROR_RESTORE_SESSION No foi possvel restaurar sesso e definies locais foram perdidas. Consulte as mensagens de erro acima para compreender este erro. . :TEXT_ERROR_SAVE_SESSION No foi possvel guardar sesso durante chamada ao programa. Consulte as mensagens de erro acima para compreender este erro. . :TEXT_ERROR_CWD_FAILED#1% Unidade %c: no responde. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Troca falhou: Aliases consomem demasiada memria. . :TEXT_ERROR_KSWAP_ALLOCMEM Troca falhou: No possvel alocar memria distante. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Espao para aliases esgotado. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Alias no encontrado: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 No foi possvel inserir alias. . :TEXT_ALIAS_INVALID_NAME#1% Nome de alias invlido '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 No possvel carregar mdulo de contexto ou gestor de erros crticos. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Falta de memria para contexto. Se este erro persistir, tente aumentar buffers internos. . :TEXT_ERROR_CONTEXT_LENGTH#1% Tamanho do contexto (%lu bytes) excede o limite mximo. Redimensionando contexto para %u bytes. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 No foi possvel adicionar informao de estado ao contexto. Este erro pode indicar uma corrupo de memria ou um tamanho mnimo de texto incorrecto. Por favor, reporte o problema para . . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Contexto em falta aps troca. Um novo contexto ser criado mas algumas definies sero perdidas. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Permisso negada . :TEXT_ERROR_NO_SUCH_FILE#1% %s: No existe tal ficheiro ou directrio . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Erro desconhecido . # # Informational messages # :TEXT_MSG_PAUSE#1 Carregue em qualquer teclar para continuar...\ . :TEXT_MSG_HISTORY_SIZE#0% Tamanho do histrico: %d bytes. . :TEXT_MSG_DOSKEY As funcionalidades do DOSKEY j esto activadas. . :TEXT_MSG_ECHO_STATE#0% ECHO est %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY est %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG est %s. . :TEXT_MSG_FDDEBUG_TARGET#0% Sada de DEBUG escrita para '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK est %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR est %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% Autocomplemento de nomes de ficheiros longos est %s . :TEXT_MSG_CURRENT_DATE#0% Data actual: %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Introduza uma nova data (mm%sdd%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Introduza uma nova data (dd%smm%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Introduza uma nova data ([cc]yy%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME#0% Hora actual: %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Intruduza uma nova hora: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% SsNn{CR}{LF}{CBREAK} aabb b b b Todos os ficheiros em '%s' sero eliminados! Deseja continuar (S/N) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 SsNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Sim=ENTER, No=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% SsNnTtAa{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break pressionado.\r Terminar batch '%s' (Sim/No/Todos) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% SsNnTtAa{BREAK}{ENTER}{ESC} aabbccdd d a b Sobrescrever '%s' (Sim/No/Todos/Abortar) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% SsNnTtAa{BREAK}{ENTER}{ESC} aabbccdd d a b Acrescentar a '%s' (Sim/No/Todos/Abortar) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% SsNnTtAa{BREAK}{ENTER}{ESC} aabbccdd d a b Eliminar '%s' (Sim/No/Todos/Abortar) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Pilha de directrios vazia. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Volume na unidade %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% %s . :TEXT_DIR_HDR_VOLUME_NONE no tem etiqueta . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Nmero de srie do volume %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s ficheiro(s)\ . :TEXT_DIR_FTR_BYTES#0% %12s bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Nmero de ficheiros listados: . :TEXT_DIR_FTR_DIRS#1% %10s directrios(s)\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s bytes livres . :TEXT_DIR_DIRECTORY#0% Directrio %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Directrio %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Nenhum caminho de pesquisa definido. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Dom\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Seg\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Ter\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Qua\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Qui\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Sex\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sb\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 nenhum ficheiro eliminado. . :TEXT_MSG_DEL_CNT_FILES_1#1 um ficheiro eliminado. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u ficheiros eliminados. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Comandos internos disponveis: . :TEXT_MSG_SHOWCMD_FEATURES Funcionalidades disponveis: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [aliases] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [entrada avanada] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [histrico] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [autocomplemento de nomes de ficheiro] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [troca] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [iniciar log] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [ltimo directrio] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [nomes de ficheiro longos] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [troca no kernel] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [troca com XMS] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [troca por omisso] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [comandos instalveis] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [suporte para lnguas (NLS)] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [pilha de directrio (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [depurao FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pressione F8 para modo passo-a-passou, ou F5 para ignorar %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Ignorando '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS verso %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Kernel FreeDOS (build 1933 ou anterior) . :TEXT_MSG_VER_LATER_FREEDOS#0% Kernel FreeDOS verso %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2022 Tim Norman e outros. Este programa distribudo na esperana de que possa ser til, mas SEM NENHUMA GARANTIA; sem uma garantia implcita de ADEQUAO a qualquer MERCADO ou APLICAO EM PARTICULAR. Veja a Licena Pblica Geral GNU para mais detalhes. Envie relatrios de erros para . Actualizaes disponveis em . . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2022 Tim Norman e outros. Este programa distribudo na esperana de que possa ser til, mas SEM NENHUMA GARANTIA; sem uma garantia implcita de ADEQUAO a qualquer MERCADO ou APLICAO EM PARTICULAR. Veja a Licena Pblica Geral GNU para mais detalhes. Envie relatrios de erros para . Actualizaes disponveis em . . :TEXT_MSG_VER_DEVELOPERS Este intrprete de comandos foi desenvolvido por muitas pessoas. Ler o ficheiro 'HISTORY.TXT' para mais detalhes. Actualmente mantido por Steffen Kaiser . Envie relatrios de erros para . Actualizaes disponveis em . . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Tentou fechar o intrprete de comandos mas isto no permitdo, talvez por\r ter sido usada a opo /P. Ter de reiniciar o sistema ou, caso esteja num\n sistema multi-tarefa, terminar o processo respectivo manualmente. . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Executvel do FreeCOM no encontrado. Deve fornecer um caminho completo para o COMMAND.COM como primeiro parmetro do COMMAND. Exemplo: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Segmento de ambiente : mximo %5u bytes; livre %5u bytes . :TEXT_MEMORY_CONTEXT#1% Segmento de contexto : mximo %5u bytes; livre %5u bytes . :TEXT_MEMORY_HEAP#1% Heap : livre %5lu bytes . :TEXT_MEMORY_CTXT_ALIAS#1% \tAliases : limite %5u bytes, actual %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_HISTORY#1% \tHistrico : limite %5u bytes, actual %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tPilha de directrios : limite %5u bytes, actual %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_LASTDIR#1% \tltimos directrios : usado %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_BATCH#1% \tAninhamento de batch : usado %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tInformao de troca : usado %5u bytes, %5u itens . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 No foi possvel obter a pgina de cdigos do sistema. . :TEXT_ERROR_SET_CODEPAGE#1 No foi possvel alterar a pgina de cdigos actual. . :TEXT_DISPLAY_CODEPAGE#1% Pgina de cdigos actual: %u. Pgina de cdigos do sistema: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Mostra, altera ou remove aliases. ALIAS [varivel[=][valor]] varivel Especifica o nome do alias. valor Define uma srie de caracteres a associar ao alias. Use ALIAS sem parmetros para mostrar os aliases actuais. . :TEXT_CMDHELP_BEEP Produz um sinal sonoro. . :TEXT_CMDHELP_BREAK Liga ou desliga a verificao de CTRL+C. BREAK [ON | OFF] Use BREAK sem parmetros para mostrar o estado actual. . :TEXT_CMDHELP_CALL#1 Chama um batch a partir de outro. CALL [/S | /N] [/Y] [unidade:][caminho]ficheiro [parmetros] /S Garante troca do FreeCOM. /N Desliga troca do FreeCOM. /Y Liga o rastreamento durante a execuo. parmetros Especifica parmetros passados ao batch. . :TEXT_CMDHELP_CD Mostra ou altera o directrio actual. CHDIR [unidade:][caminho] CHDIR [..] CD [unidade:][caminho] CD [..] CD [-] .. Indica que queremos mudar para o directrio acima. - Muda para o directrio actual (se a funcionalidade estiver ligada). Use CD unidade: para mostrar o directrio actual em determinada unidade. Use CD sem parmetros para mostrar a unidade e directrio actuais. Ver tambm: CDD . :TEXT_CMDHELP_CDD Mostra ou altera a unidade e directrio actuais. CDD [unidade:][caminho] CDD [..] .. Indica que queremos mudar para o directrio acima. - Muda para o directrio actual (se a funcionalidade estiver ligada). Caso uma unidade seja especificada, a unidade actual tambm mudada. Esta a nica diferena em relao aos comandos "CHDIR" e "CD". Use CD sem parmetros para mostrar a unidade e directrio actuais. . :TEXT_CMDHELP_CHCP Mostra ou altera o nmero da pgina de cdigos activa. CHCP [nmero] nmero Especifica o nmero da pgina de cdigos. Use CHCP sem parmetro para mostrar o nmero da pgina de cdigos activa. . :TEXT_CMDHELP_CLS Limpa o visor. CLS . :TEXT_CMDHELP_COMMAND Inicia uma nova cpia do intrprete de comandos. COMMAND [caminho] [dispositivo] [/E:tamanho] [/L:tamanho] [/U:tamanho] [/P] [/MSG] [/LOW] [/Y [/[C|K] comando]] caminho Especifica o caminho completo para o COMMAND.COM. dispositivo Indica o disositivo a utilizar para entrada e sada de comandos. /E:tamanho Determina o tamanho inical do ambiente em bytes. Valor entre 256 e 32768. /L:tamanho Determina o tamanho dos buffers internos em bytes. Valor entre 128 e 1024. Requer opo /P. /U:tamanho Determina o tamanho dos buffers internos em bytes. Valor entre 128 e 255. Requer opo /P. /P Cria intrprete de comandos permanente (no pode ser fechado). /MSG Armazena amensagens de erro em memria. Requer opo /P. /LOW Fora dados residantes a serem mantidos na memria baixa. /Y Avana passo-a-passo em batch passado nos parmetros /C ou /K. /C comando Executa um comando especfico e sai. /K comando Executa um comando especfico a continua aberto. . :TEXT_CMDHELP_COPY Copia um ou mais ficheiros para outra localizao. COPY [/A | /B] origem [/A | /B] [+ source [/A | /B] [+ ...]] [destino [/A | /B]] [/V] [/Y | /-Y] origem Especifica o ficheiro ou ficheiros a serem copiados. /A Indica um ficheiro de texto ASCII. /B Indica um ficheiro binrio. destino Especifica o directrio e/ou nome ficheiro de destino. /V Verifica se os novos ficheiros so escritos correctamente. /Y Suprime a confirmao de sobrescrita de ficheiros existentes. /-Y Liga a confirmao de sobrescrita de ficheiros existentes. A opo /Y pode ser predefinida na varivel de ambiente COPYCMD. Neste caso a opo pode ser desligada usando /-Y na linha de comandos. Para concatenar ficheiros, especifique vrios ficheiros como origem (usando wildcards ou na forma ficheiro1+ficheiro2+...) mas um nico como destino. . :TEXT_CMDHELP_CTTY Altera o dispositivo de terminal usado para controlar o sistema. CTTY dispositivo dispositivo Dispositivo de terminar pretendido (como COM1). . :TEXT_CMDHELP_DATE#1 Mostra ou altera a data do sistema. DATE [/D | data] /D Previne o pedido interactivo de nova data. Use DATE sem parmetros para mostrar a data actual e opcionalmente alter-la. . :TEXT_CMDHELP_DEL#2 Elimina um ou mais ficheiros. DEL ficheiros [/P] [/V] ERASE ficheiros [/P] [/V] ficheiros Especifica o(s) ficheiro(s) a eliminar. /P Pede confirmao antes de eliminar cada ficheiro. /V Mostra o nome de todos os ficheiros eliminados. . :TEXT_CMDHELP_DIR#4 Mostra uma lista de ficheiros e subdirectrios num directrio. DIR [unidade:][caminho][nome] [/P] [/W] [/A[[:]atributos]] [/O[[:]ordem]] [/S] [/B] [/L] /P Pausa aps cada visor cheio de informao. /W Usa formato de listagem alargada. /A Mostra ficheiros com atributos especficos. atributos D Directrios R Ficheros apenas de leitura H Ficheiros escondidos A Files prontos a arquivar S Ficheiros de sistema - Prefixo significando negao /O: Lista ficheiros ordernados. ordem N Por nome S Por tamanho (crescente) E Por extenso D Por data e hora (cronolgicas) G Agrupa directrios - Prefixo significando ordem inversa U No ordenar (idntico a /ONG). /S Mostra ficheiros no directrio e todos os seus subdirectrios. /B Usa formato mnimo (sem cabealho nem sumrio). /L Usa minsculas apenas. /Y ou /4 Mostra anos de 4 dgitos. Opes podem ser predefinidas na varivel de ambiente DIRCMD. Opes predefinidas podem ser desligadas prefixando qualquer opo com '-' na linha de comandos. Por exemplo, /-W para desligar listagem alargada. . :TEXT_CMDHELP_DOSKEY#1 Utilitrio DOSKEY integrado no FreeCOM. Use as teclas Cima e Baixo para navegar o histrico e HISTORY para mostr-lo. Use as teclas Esquerda, Direita, Home e End para navegar dentro de uma linha de comandos e Insert para alternar entre modo de insero e sobreposio. Use a tecla Tab para completar a palavra corrente como nome de ficheiro, ou pressione-a duas vezes para mostrar todos os ficheiros correspondentes. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edita ou recupera linhas de comando e cria macros DOSKEY [/opes...] [nome=[texto]] /BUFSIZE:tamanho Define o tamanho do buffer (por omisso 512). /ECHO:on|off Liga ou desliga expanso de macros (ligada por omisso). /FILE:ficheiro Especifica o ficheiro contendo lista de macros. /HISTORY Mostra todos os comandos armazenados em memria. /INSERT Insere novos caracteres na linha ao escrever. /KEYSIZE:tamanho Define o tamanho do buffer de escrita antecipada (por omisso 15). /LINE:tamanho Define o tamanho mximo do buffer de edio da linha (por omisso 128). /MACROS Lista todas as macros. /OVERSTRIKE Sobrescreve caracteres na linha ao escrever (ligado por omisso). /REINSTALL Instala uma nova cpia do DOSKey. nome Especifica o nome da macro a criar. texto Indica o texto que deve ser associado com a macro. Teclas: Cima/Baixo Recuperar comandos. Esc Limpar comando actual. F7 Mostrar histrico de comandos. ALT+F7 Limpar histrico de comandos. [texto]F8 Procurar por comando comeado por 'texto'. F9 Selecciona um comando pelo nmero. Alt+F10 Limpar definies de macros. Cdigos especiais que podem ser usados em definies de macros: $T Separador de comandos (permite vrios comandos numa macro). $1-$9 Parmetros (Equivalentes a %1-%9 em ficheiros batch). $* Representa todos os parmetros passados macro. . :TEXT_CMDHELP_ECHO Mostra uma mensagem, ou liga e desliga o eco dos comandos. ECHO [ON | OFF] ECHO [mensagem] Use ECHO sem parmetros para mostrar o estado de eco corrente . :TEXT_CMDHELP_EXIT Sai do intrprete de comandos ou de um batch. EXIT . :TEXT_CMDHELP_FOR Executa um comando especfico para cada ficheiro num conjunto. FOR %varivel IN (conjunto) DO comando [parmetros] %varivel Especifica o nome da varivel definida. conjunto Indica o conjunto de ficheiros percorrido. comando Define o comando a ser executado para cada ficheiro. parmetros Define os parmetros passados ao comando. Exemplo: FOR %f IN (a b c) DO ECHO - %f - Para usar o FOR num batch, especifique %%varivel em vez de %varivel. . :TEXT_CMDHELP_GOTO Redirecciona a execuo para a linha de uma etiqueta num batch. GOTO etiqueta Uma etiqueta definida numa linha cotendo apenas ':etiqueta'. . :TEXT_CMDHELP_HISTORY#1 Mostra o contedo do histrico de linhas de comando ou define o seu tamanho. HISTORY [tamanho] tamanho Define um novo tamanho para o buffer do histrico. Use HISTORY sem parmetros para mostrar o contedo actual do histrico. . :TEXT_CMDHELP_IF Executa um comando condionalmente. IF [NOT] ERRORLEVEL nmero comando IF [NOT] texto1==texto2 comando IF [NOT] EXIST ficheiro comando comando Especifica o comando a executar de acordo com a condio. NOT Executar comando apenas a condio seguinte seja falsa. ERRORLEVEL nmero Comando ser executado apenas no caso de o ltimo programa executado ter resultado num cdigo de sada igual pi superior ao valor indicado. texto1==texto2 Comando ser executado caso os dois textos coincidam. EXIST ficheiro Comando ser executado caso o ficheiro indicado exista. . :TEXT_CMDHELP_LFNFOR Liga ou desliga nomes de ficheiro longos no comando FOR e autocomplemento. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Use LFNFOR ou LFNFOR COMPLETE para obter o estado actual da opo. . :TEXT_CMDHELP_LH Carrega um progama na rea de memria superior. LOADHIGH [unidade:][caminho]nome [parmetros] LOADHIGH [/L:regio[,min][;regio2[,min2]...] [/S]] [unidade:][caminho]nome [parmetros] /L Especifica as regies de memria para onde carregar o programa, incluindo opcionalmente o tamanho mnimo de cada regio. /S Reduz UMB ao seu tamanho mnimo ao carregar o programa. . :TEXT_CMDHELP_LOADFIX Carega um programa acima dos primeiros 64KB de memria. LOADFIX [unidade:][caminho]nome Use LOADFIX para carregar um programa caso tenha obtido um erro "Packed file corrupt" ao tentar execut-lo normalmente. . :TEXT_CMDHELP_MD Cria um directrio. MKDIR [unidade:]caminho MD [unidade:]caminho . :TEXT_CMDHELP_PATH Mostra ou altera o caminho de pesquisa de executveis. PATH [[unidade:]caminho[;...]] PATH ; Use PATH ; para limpar todas as definies de caminhos de pesquisa e obrigar o intrprete de comandos a procurar apenas no caminho actual. Use PATH sem parmetros para mostrar a definio actual. . :TEXT_CMDHELP_PAUSE Suspende o processamento, mostrando uma mensagem. PAUSE [mensagem] Caso nenhuma mensagem seja especificada, ser mostrada por omisso a seguinte: "Carregue em qualquer teclar para continuar..." . :TEXT_CMDHELP_PROMPT Altera o pedido da linha de comandos. PROMPT [texto] texto Especifica o pedido a mostrar no incio de cada linha de comandos. Cdigos especiais que podem ser usados na definio: $Q Sinal de igual '='. $$ Cifro '$'. $T Hora actual. $D Data actual. $P Unidade e caminho actuais. $V Nmero de verso do intrprete de comandos. $N Unidade actual. $G Sinal de maior '>'. $L Sinal de menor '<'. $B Barra vertical '|'. $H Retrocesso (apaga carcter anterior). $E Cdigo de escape (cdigo ASCII 27). $_ Quebra de linha (cdigos ASCII 13 e 10). Use PROMPT sem parmetros para restaurar a definio por omisso. . :TEXT_CMDHELP_PUSHD Adiciona o directrio actual pilha de directrios, opcionalmente mudando tambm em seguida o directrio actual. PUSHD [[unidade:]caminho] [unidade:]caminho Indica qual o directrio para onde mudar. Use PUSHD sem parmetros se no pretender mudar o directrio actual. . :TEXT_CMDHELP_POPD Retira um directrio da pilha de directrios e muda para ele. POPD [*] Usando o parmetro '*' a pilha de directrios limpa. . :TEXT_CMDHELP_DIRS Lista o contedo da pilha de directrios. DIRS . :TEXT_CMDHELP_RD Remove um directrio vazio. RMDIR [unidade:]caminho RD [unidade:]caminho . :TEXT_CMDHELP_REM Regista um comentrio num batch ou no CONFIG.SYS. REM [texto] . :TEXT_CMDHELP_REN Renomeia um ou vrios ficheiros ou directrios. RENAME [unidade:][caminho][origem] [destino] REN [unidade:][caminho][origem] [destino] Note que no podem se pode ser especificados caminho ou unidade diferentes para o ficheiro ou directrio de destino. Use o comando MOVE para esse fim. . :TEXT_CMDHELP_SET#1 Mostra, altera ou remove variveis de ambiente. SET [/C] [/P] [/E] [/U] [varivel[=[texto]]] varivel Especifica o nome da varivel de ambiente. texto Define o valor atribudo varivel (ou um comando usando /E). /C Manter maisculas e minsculas no nome da varivel (por omisso o nome passado para maisculas caso a varivel ainda no exista ou mantido caso corresponda a uma varivel existente. /P Pedir um valor ao utilizador e associ-lo varivel. /E Definir o valor da varivel para a sada do comando no texto. /U Converter o valor atribudo varivel para maisculas. . :TEXT_CMDHELP_SHIFT#1 Altera a posio dos parmetros numricos num batch. SHIFT [DOWN] Caso se use DOWN, os parmetros sero em direco ao primeiro (%%0), caso contrrio em direco ao ltimo (%9). . :TEXT_CMDHELP_TIME#1 Mostra ou altera a hora do sistema. TIME [/T | hora] /T Previne o pedido interactivo de nova hora. Use TIME sem parmetros para mostrar a hora actual e opcionalmente alter-la. . :TEXT_CMDHELP_TRUENAME Mostra o caminho completo de um ficheiro ou directrio indicados. TRUENAME [unidade:][caminho][nome] . :TEXT_CMDHELP_TYPE Mostra o contedo de um ficheiro de texto. TYPE [unidade:][caminho]nome . :TEXT_CMDHELP_VER Mostra a verso do intrprete de comandos e outras informaes. VER [/R] [/W] [/D] [/C] /R Informao sobre a verso do kernel e outras. /W Garantia do intrprete de comandos. /D Informao sobre distribuio do intrprete de comandos. /C Contribuidores para o projecto do intrprete de comandos. . :TEXT_CMDHELP_VERIFY Define se o sistema de ficheiros deve verificar a escrita em disco. VERIFY [ON | OFF] Use VERIFY para obter o estado actual desta definio. . :TEXT_CMDHELP_FDDEBUG Ligar ou desligar escrita da informao de depurao ou mostrar o seu estado. FDDEBUG [ON | OFF | ficheiro] Use FDDEBUG sem parmetros para mostrar a definio actual. Se um ficheiro for indicado, toda a informao de depurao ser adicionada nesse ficheiro. Podem ser usados os nomes especiais "stdout" ou "stderr" para especificar as streams de sada e erro por omisso. Esta opo s poder ser ligada se o FreeDOS tiver sido compilado com suporte para informao de depurao. . :TEXT_CMDHELP_VOL Mostra a etiqueta de volume e o nmero de srie do disco, caso existam. VOL [unidade:] Use VOL sem parmetros para mostrar a informao da unidade actual. . :TEXT_CMDHELP_QUESTION#1 Mostra os comandos e funcionalidades disponveis no intrprete de comandos. ? ?comando [parmetros] Sem qualquer comando, so mostrados os comandos e funcionalidades disponveis. Caso seja indicado um comando, ser mostrado um pedido de confirmao antes de execut-lo como se o modo passo-a-passo estivesse activo. . :TEXT_CMDHELP_WHICH Mostra o ficheiro executvel para cada comando especificado. WHICH comandos... . :TEXT_CMDHELP_MEMORY#1 Mostra a memria interna utilizada pelo intrprete de comandos. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 No podem existir caracteres '+' na especificao de destino. . :TEXT_DELETE_FILE#1% Eliminando ficheiro '%s'. . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% No possvel escrever no ficheiro '%s'. Talvez o disco esteja cheio (%lu bytes requeridos). . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% copiado %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% copiado %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM no pode ser um dispositivo: '%s' . :TEXT_ERROR_FCOM_INVALID#0% Este ficheiro no um FreeCOM vlido ou tem uma verso incompatvel: %s . :TEXT_ERROR_LOADING_STRINGS No foi possvel as carregar mensagens para memria, o caminho indicado por %COMSPEC% parece ser invlido. Especifique uma localizao vlida do FreeCOM de onde carregar as mensagens (por exemplo, "C:\\COMMAND.COM"), ou pressione Enter para cancelar o carregamento das mensagens. . :TEXT_TERMINATING Terminando agora. . :TEXT_HIDDEN_CRITER#0% %u pedidos de erros crtico suprimidos. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Cdigo de sada (ERRORLEVEL): %u, motivo: %u (%s) . :TEXT_EXIT_REASON_NEG_1 Erro da API DOS\ . :TEXT_EXIT_REASON_0 terminado normalmente\ . :TEXT_EXIT_REASON_1 terminado por ^Break\ . :TEXT_EXIT_REASON_2 terminado por erro crtico\ . :TEXT_EXIT_REASON_3 tornado residente\ . ================================================ FILE: strings/pt_br.err ================================================ # $Id$ # # Critical error national customization file # # Language: pt/BR # Author: Max Velasques # Traduzido em 19 de agosto 2002 # Por Max Velasques # Site: www.maxfreewares.hpg.com.br ## Strings primarias S2 BLOCK_DEVICE: Erro %1 drive %A: %2 area: %3 S3 CHAR_DEVICE: Erro %1 periferico %A: %3 ## Tipos de operacoes S0 READ: carregando de S1 WRITE: gravando para ## tipos de falhas da area de blocos de perifericos S4 DOS: DOS S5 FAT: FAT S6 ROOT: root S7 DATA: dados ## Strings de acao S8 IGNORE: (I)gnorar S9 RETRY: (T)entar de novo S10 ABORT: (A)bortar S11 FAIL: (F)alha ## teclas associadas com as acoes S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rT KEYS_ABORT: aA KEYS_FAIL: fF ## Strings embutidas S12 QUESTION: ? %. S13 DELIMITER: , %. ## Strings de erro UNKNOWN: Codigo do erro desconhecido S15 0: violacao de protecao-contra-grvacao 1: unidade para driver desconhecida 2: drive nao esta pronto 3: comando desconhecido dado para o driver 4: erro de dados (CRC invalido) 5: tamanho da estrutura de requisicao de driver de periferico e invalido 6: erro de busca 7: tipo de midia desconhecida 8: setor nao encontrado 9: impressora sem papel 10: erro de escrita 11: erro de leitura 12: falha geral 13: violacao de compartilhamento 14: violacao de trava 15: mudanca de disco invalida 16: FCB nao disponivel 17: sobrecarregamento de buffer compartilhado 18: codico de pagina nao combina 19: falta de entrada 20: espaco em disco insuficiente ================================================ FILE: strings/pt_br.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: pt/BR # Author: Max Velasques # # Traduzido em 19 de agosto 2002 # Por Max Velasques # Site: www.maxfreewares.hpg.com.br # # Este arquivo e usado para gerar todas as mensagens que o command.com # mostra. Este arquivo e a entrada para o programa fixstrs, e ele # retorna os arquivos strings.h e strings.dat. O arquivo .DAT e adicionado # ao arquivo command.exe, que e entao renomeado para command.com. O arquivo .H # contem todas as informacoes para o programa mostrar as mensagens. # # O formato deste arquivo e simples. Linhas em branco e linhas iniciando # com "#" sao ignoradas. # Cada mensagem inicia com um rotulo que ira ser usado para referendar # a mensagem no programa. Um rotulo inicia com "dois pontos" ":". # # Todas as linhas depois do rotulo sao mensagens ate uma linha com um # unico "." ou "," na primeira coluna. A diferenca e o que o ponto (".") # significa que sera terminada com um retorno de carro, porem com a # virgula isto nao acontece. # # # # Estas sao as mensagems de erro # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH A opcao e invalida. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH A opcao e invalida. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION A opcao esta mal-formada: '%s' . :TEXT_ERROR_OPT_ARG A opcao '%s' nao pode ter argumentos . :TEXT_ERROR_OPT_NOARG A opcao '%s' precisa ter argumentos . :TEXT_INVALID_NUMBER O numero especificado em '%s' e invalido . :TEXT_ERROR_CLOSE_QUOTE Faltando caracter de fechamento: %c . :TEXT_ERROR_TEMPFILE Impossivel criar arquivo temporario . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Ha muitos parametros. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Ha muitos parametros. . :TEXT_ERROR_INVALID_PARAMETER O parametro e invalido. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Caminho nao encontrado. . :TEXT_ERROR_FILE_NOT_FOUND Arquivo nao encontrado. . :TEXT_ERROR_SFILE_NOT_FOUND Arquivo nao encontrado. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING O paramentro requerido esta faltando. . :TEXT_ERROR_INVALID_DRIVE O drive %c: e invalido. . :TEXT_ERROR_BADCOMMAND Comando ou nome de arquivo invalido. . :TEXT_ERROR_OUT_OF_MEMORY Erro de falta de memoria. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 A alocacao de memoria do DOS falhou. . :TEXT_ERROR_CANNOTPIPE Impossivel canalizar! Impossivel abrir arquivo temporario! . :TEXT_ERROR_LONG_LINE_BATCHFILE A linha #%ld no Arquivo de Lote '%s' e muito longa. . :TEXT_ERROR_BFILE_VANISHED O Arquivo de Lote '%s' nao foi encontrado. . :TEXT_ERROR_BFILE_LABEL O Arquivo de Lote '%s' nao contem o rotulo '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s falhou por '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR Impossive definir variavel de ambiente '%s'. O ambiente esta cheio? . :TEXT_ERROR_ENV_VAR_NOT_FOUND A variavel de ambiente '%s' nao foi encontrada. . :TEXT_ERROR_NO_ENVIRONMENT Nao ha espaco de ambiente. Talves a memoria esteja curta. Especifique a opcao /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 Impossivel definir apelido(alias) '%s'. O espaco de apelido(alias) esta cheio? . :TEXT_ERROR_ALIAS_NOT_FOUND#1 O apelido(alias) '%s' nao foi encontrado. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Nao ha espaco de apelido(alias). Talves a memoria esteja curta. . :TEXT_ERROR_SYNTAX_STR Erro de sintaxe. - '%s' . :TEXT_ERROR_SYNTAX Erro de sintaxe. . :TEXT_ERROR_FILENAME_TOO_LONG Nome de arquivo muito longo. - '%s' . :TEXT_ERROR_SELFCOPY Impossivel copiar '%s' para ele mesmo. . :TEXT_ERROR_COMMAND_TOO_LONG Linha de comando muito longa depois da expansao do apelido(alias)! . :TEXT_ERROR_LINE_TOO_LONG Linha muito longa. Impossivel executar comando. . :TEXT_ERROR_HISTORY_SIZE#1 O tamanho do historico '%s' e invalido. . :TEXT_HISTORY_EMPTY#1 Historico de linha de comando esta vazio. . :TEXT_ERROR_BAD_MCB_CHAIN O encadeamento MCB esta corrompido, ou o sistema MS-DOS e incompativel. . :TEXT_ERROR_UNDEFINED_ERROR O erro %d e indefinido. . :TEXT_ERROR_REGION_WARNING A regiao %d da memoria e ilegal - ignorado. . :TEXT_ERROR_ON_OR_OFF E preciso especificar ON ou OFF. . :TEXT_ERROR_BAD_VARIABLE Especificacao de variavel invalida. . :TEXT_ERROR_IN_MISSING#1 FOR: Faltando IN. . :TEXT_ERROR_MISSING_PARENTHESES#1 Um ou ambos os parenteses estao faltando. . :TEXT_ERROR_DO_MISSING#1 FOR: Faltando DO. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Nao ha comando depois da declaracao DO. . :TEXT_ERROR_REDIRECT_FROM_FILE Impossivel redirecionar entrada do arquivo '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE Impossivel redirecionar saida para arquivo '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 O redirecionamento esta vazio. . :TEXT_ERROR_INVALID_DATE Data invalida. . :TEXT_ERROR_INVALID_TIME Hora invalida. . :TEXT_ERROR_NO_GOTO_LABEL Nenhum rotulo foi especificado para o GOTO. . :TEXT_CTTY_NOTIMPLEMENTED O comando CTTY foi retirado deste COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE O periferico '%s' e invalido, ou nao e de Leitura-Escrita. . :TEXT_ERROR_CTTY_DUP Falha ao mudar descritor de arquivo para TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L ainda nao foi implementado. . :TEXT_ERROR_U_NOTIMPLEMENTED /U ainda nao foi implementado. . :TEXT_ERROR_WRITING_DEST Erro gravando no destino. . :TEXT_ERROR_CANNOT_OPEN_SOURCE Impossivel abrir origem. - '%s' . :TEXT_ERROR_OPEN_FILE Impossivel abrir arquivo '%s' . :TEXT_ERROR_READ_FILE Impossivel ler do arquivo '%s' . :TEXT_ERROR_WRITE_FILE Impossivel gravar para o arquivo '%s' . :TEXT_ERROR_LEADING_PLUS O caracter de concatenacao '+' nao pode ser colado aos argumentos. . :TEXT_ERROR_TRAILING_PLUS O caracter de concatenacao '+' nao pode vir seguido dos argumentos. . :TEXT_ERROR_NOTHING_TO_DO Nada para fazer. . :TEXT_ERROR_COPY COPY falhou. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: faltando nome de arquivo . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: faltando numero . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: numero invalido . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Faltando comando . :TEXT_NOT_IMPLEMENTED_YET Desculpe...ele nao foi implementado ainda. . :TEXT_FAILED_LOAD_STRINGS Falha ao carregar messagens na memoria. . :TEXT_MSG_NOTIMPLEMENTED A opcao /MSG foi retirada deste COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1 %u itens mostrados. . :TEXT_CORRUPT_COMMAND_LINE Linha de comando corrompida. Este e um erro interno e e relacionado como o COMMAND.COM roda no sistena. Por favor avise-nos sobre este erro. . :TEXT_QUOTED_C_OR_K#1 As opcoes /C e /K nao puderam ser utilizadas, elas serao ignoradas. . :TEXT_INIT_FULLY_QUALIFIED#1 O caminho para o COMMAND.COM precisa esta completamente qualificado! Isto inclue a letra do drive e iniciando com uma barra invertida. Por exemplo: C:\\FDOS COMMAND.COM assume este caminho agora: %s . :TEXT_ERROR_RESTORE_SESSION A informacao da sessao nao pode ser restaurada, nenhuma das configuracoes locais serao perdidas. Por favor veja as mensagens de erro para descobrir a razao deste problema. . :TEXT_ERROR_SAVE_SESSION A informacao atual nao pode ser preservada durante a chamada do programa. Por favor veja as mensagens de erro para descobrir a razao deste problema. . :TEXT_ERROR_CWD_FAILED Drive %c: nao esta respondendo ou esta com falta de memoria interna. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Falha quando trocando: Os apelidos(aliases) alocaram muita memoria. . :TEXT_ERROR_KSWAP_ALLOCMEM Falha quando trocando: Impossivel alocar muita memoria. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Fora do espaco de apelidos(aliases). . :TEXT_ERROR_ALIAS_NO_SUCH#1 O apelido(alias) nao foi encontrado: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Falha ao inserir apelido(alias). . :TEXT_ALIAS_INVALID_NAME#1 O nome de apelido(alias) '%s' e invalido. . :TEXT_ERROR_LOADING_CONTEXT#1 Impossivel carregar Modulo de Contexto ou Manipulador de Erros Criticos. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Contexto fora da memoria. Se este erro persistir, considere aumentar o buffer interno, como o do historico, pilha do diretorio, etc. . :TEXT_ERROR_CONTEXT_LENGTH#1 O tamanho total de contextos de %lu bytes excede o limite maximo. Limitando o contexto para %u bytes. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Falha para adicionar informacoes de status no contexto. Esta mensagem de erro pode indicar que a memoria esta corrompida ou o tamanho minimo do contexto determinado esta incorreto. Por favor informe ao sustentadore do FreeCOM em: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 O contexto esta faltando depois da troca. O contexto foi recriado, mas todos os apelido(aliases) foram perdidos. . # # Mensagens de informacao # :TEXT_MSG_PAUSE#1 Pressione qualquer tecla para continuar . . .\ . :TEXT_MSG_HISTORY_SIZE O tamanho do historico e de %d bytes. . :TEXT_MSG_DOSKEY O DOSKEY ja esta ativado no shell. . :TEXT_MSG_ECHO_STATE ECHO esta %s . :TEXT_MSG_VERIFY_STATE VERIFY esta %s . :TEXT_MSG_FDDEBUG_STATE A saida de DEBUG esta %s. . :TEXT_MSG_FDDEBUG_TARGET A saida de DEBUG e impressa para '%s'. . :TEXT_MSG_BREAK_STATE BREAK esta %s . :TEXT_MSG_CURRENT_DATE A data atual e %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Entre a nova data (mm%sdd%s[cc]aa): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Entre a nova data (dd%smm%s[cc]aa): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Entre a nova data ([cc]aa%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME A hora atual e %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Entre uma nova hora: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 SsNs{CR}{LF}{CBREAK} aabb b b b Todos os arquivo em '%s' serao apagados! Voce tem certeza que deseja continuar (S/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 SsNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Sim=ENTER, Nao=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 SsNnTtQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break foi pressionado.\r Voce deseja terminar o Arquivo de Lote '%s' (Sim/Nao/Todos) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 SsNnTtCc{BREAK}{ENTER}{ESC} aabbccdd d a b Deseja sobrescrever '%s' (Sim/Nao/Todos/Cancelar) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 SsNnTtCc{BREAK}{ENTER}{ESC} aabbccdd d a b Deseja apagar '%s' (Sim/Nao/Todos/Cancelar) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY A pilha do diretorio esta vazia. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 O volume no drive %c \ . :TEXT_DIR_HDR_VOLUME_STRING e %s . :TEXT_DIR_HDR_VOLUME_NONE nao tem rotulo . :TEXT_DIR_HDR_SERIAL_NUMBER O Numero de Serie do volume e %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s arquivo(s)\ . :TEXT_DIR_FTR_BYTES %12s bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Total de arquivos listados: . :TEXT_DIR_FTR_DIRS#1 %10s dir(s)\ . :TEXT_DIR_FTR_BYTES_FREE %15s bytes livres . :TEXT_DIR_DIRECTORY Diretorio de %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Diretorio de %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH Caminho=%s . :TEXT_MSG_PATH_NONE#1 Nenhum caminho para procura definida. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Dom\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Seg\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Ter\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Qua\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Qui\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Sex\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sab\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 nenhum arquivo foi removido. . :TEXT_MSG_DEL_CNT_FILES_1#1 um arquivo foi removido. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u arquivos foram removidos. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Comandos internos disponiveis: . :TEXT_MSG_SHOWCMD_FEATURES Caracteristicas disponiveis: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [apelidos] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [entrada avancada] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [historico] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [complemento de nome_de_arquivo] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [trocando] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [iniciando log] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [ultimo diretorio] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS swap] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [padrao para swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [comandos instalaveis] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [pilha de diretorio (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [depurando FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pressione F8 para o modo de trilha, ou F5 para contornar %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC Contornando '%s'. . :TEXT_MSG_VER_DOS_VERSION Versa do DOS %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Kernel do FreeDOS (compilacao 1933 ou anterior) . :TEXT_MSG_VER_LATER_FREEDOS Versao do Kernel do FreeDOS %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman and others. Este programa e distribuido na esperanca de que ele possa ser util, mas SEM NENHUMA GARANTIA; sem nunca implicar em garantia de MERCATIBILIDADE ou AJUSTE PARA UM PROPOSITO PARTICULAR. Veja a GNU General Public License por mais detales. Envie informacoes sobre bugs para freedos-devel@lists.sourceforge.net. Atualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman and others. Este programa e um software livre; voce pode redistribui-lo e/ou modifica-lo sobre os termos da GNU General Public License como publicado pela Free Software Foundation; ou na versao 2 da Licensa, ou (na sua opcao) qualquer versao posterior. Envie informacoes sobre bugs para freedos-devel@lists.sourceforge.net. Atualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS O interpretador decomando do FreeDOS e desenvolvido por muitos programadores, por favor veja para anexar o arquivo HISTORY.TXT. Envie informacoes sobre bugs para freedos-devel@lists.sourceforge.net. Atualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r O shell esta proximo de ser terminado, embora, este seja\r esquecido (usualmente ativando a opcao "/P").\r Voce precisa reiniciar o sisyema ou, se este shell roda em\r um ambiente multi-tarefa, termina este processo/tarefa manualmente.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 O execultavel do FreeCOM nao foi encontrado. Voce precisa especificar o caminho completo para o COMMAND.COM como o primeiro argumento do COMMAND, por instancia: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1 Segmento de ambiente : max %5u bytes; livre %5u bytes . :TEXT_MEMORY_CONTEXT#1 Segmento de Contexto : max %5u bytes; livre %5u bytes . :TEXT_MEMORY_HEAP#1 Pilha : livre %5lu bytes . :TEXT_MEMORY_CTXT_ALIAS#1 \tApelidos : limite %5u bytes, atual %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_HISTORY#1 \tHistorico : limite %5u bytes, current %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_DIRSTACK#1 \tPilha de diretorios : limite %5u bytes, current %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_LASTDIR#1 \tUltimo Dir_cache : usado %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_BATCH#1 \tAninhamento de Batch's : usado %5u bytes, %5u itens . :TEXT_MEMORY_CTXT_SWAPINFO#1 \tInformacoes de Swap : usado %5u bytes, %5u itens . # # Texo de Comandos de Ajuda # :TEXT_CMDHELP_ALIAS Mostra, define, ou remove apelidos. ALIAS [variavel[=][string]] variavel Especifica o nome do apelido. string Especifica uma serie de caracteres para especificar o apelido. Digite ALIAS sem parametros para mostrar os apelidos atuais. . :TEXT_CMDHELP_BEEP Emite um som 'beep'. . :TEXT_CMDHELP_BREAK Define ou limpa a checagem extendida do CTRL+C. BREAK [ON | OFF] Digite BREAK sem parametros para mostrar as configuracoes atuais. . :TEXT_CMDHELP_CALL#1 Roda um arquivo de lote de dentro de outro. CALL [/S | /N] [drive:][caminho]nome_de_arquivo [parametros_do_arquivo] parametros_do_arquivo Especifica qualquer linha-de-comando requerida pelo arquivo de lote que esta sendo chamado. /S forcar, /N nega troca(SWAP) do FreeCOM. . :TEXT_CMDHELP_CD Mostra o nome de ou muda o diretorio atual. CHDIR [drive:][caminho] CHDIR[..] CD [drive:][caminho] CD[..] CD - .. Especifica que voce quer mudar para o diretorio anterior. - Se opcao "ultimo diretorio" esta ativada, muda para o ultimo diretorio. Digite CD drive: para mostrar diretorio atual no drive especificado. Digite CD sem parametros para mostrar o drive e diretorio atual. Veja tambem: CDD . :TEXT_CMDHELP_CDD Mostra o nome de ou muda o drive e diretorio atual. CDD [drive:][path] CDD[..] .. Especifica que voce quer mudar para o diretorio anterior. - Se opcao "ultimo diretorio" esta ativada, muda para o ultimo diretorio. Se drive: e especificado, o drive atual e mudado; esta e a unica diferenca para "CHDIR". Digite CD sem parametros para mostrar o drive e diretorio atual. . :TEXT_CMDHELP_CHCP Mostra ou define o numero de codigo de pagina ativo. CHCP [nnn] nnn Especifica um numero de codigo de pagina. Digite CHCP sem um parametro para mostrar o numero de pagina ativo. . :TEXT_CMDHELP_CLS Limpa a tela. CLS . :TEXT_CMDHELP_COMMAND Inicia uma nova copia do interpretador de comandos do FreeDOS. COMMAND [[drive:]caminho] [periferico] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] comando]] [drive:]path Especifica o diretorio contendo o COMMAND.COM. device Especifica que periferico usar para entrada e saida de comandos. /E:nnnnn Define o tamanho do ambiente inicial environment para nnnnn bytes. (nnnnn deve estar entre 256 e 32,768). /L:nnnn Especifica o tamanho do buffer interno (requer /P). (nnnn dever estar entre 128 e 1,024). /U:nnn Especifica o tamanho do buffer entrada (requer /P). (nnn dever estar entre 128 e 255). /P Faz o interpretador de comandos permanente (nao pode sair). /MSG Grava todas as mensagens de erro na memoria (requer /P). /LOW Obriga o interpretador manter os dados residentes em memoria baixa. /Y Passado atraves de Arquivos de Lotes especificado por /C ou /K. /C command Executa o comando especificado e retorna. /K command Executa o comando especificado e continua rodando. . :TEXT_CMDHELP_COPY Copia um ou mais arquivos para outro lugar. COPY [/A | /B] origem [/A | /B] [+ origem [/A | /B] [+ ...]] [destino [/A | /B]] [/V] [/Y | /-Y] source Especifica o arquivo ou arquivos a serem copiados. /A Indica um arquivo de texto ASCII. /B Indica um arquivo binario. destino Especifica o diretorio e/ou o nome de arquivo para o(s) novo(s) arquivo(s). /V Verifica se os novos arquivos foram gravados corretamente. /Y Suprimir confirmacao de que voce deseja sobrescrever um arquivo de destino ja existente. /-Y Mostra confirmacao de que voce deseja sobrescrever um arquivo de destino ja existente. A opcao /Y pode ser predefinida na variavel de ambiente COPYCMD. Isto pode ser sobrescrito com /-Y na linha de comando. Para juntar arquivos, especifique um unico arquivo para destino, mas multiplos arquivos para a origem (usando o formato arquivo1+arquivo2+arquivo3). . :TEXT_CMDHELP_CTTY Muda o periferico terminal usado para controlar seu sistema. CTTY periferico periferico O periferico terminal que voce quer usar, como a COM1. . :TEXT_CMDHELP_DATE#1 Mostra ou define a data. DATE [/D] [data] Digite DATE sem parametros para mostrar a data atual, e pedir uma nova data. Pressione ENTER para manter a mesma data. /D prevents DATE to become interactive. . :TEXT_CMDHELP_DEL Apagar um ou mais arquivos. DEL [drive:][caminho]nome_do_arquivo [/P] ERASE [drive:][caminho]nome_do_arquivo [/P] [drive:][caminho]nome_do_arquivo Especifica os arquivos a serem apagados. Especifique multiplos arquivos usando wildcards. /P Pede por confirmacao antes de apagar cada arquivo. . :TEXT_CMDHELP_DIR#1 Mostra uma lista de arquivos e subdiretorios em um diretorio. DIR [drive:][caminho][nome_do_arquivo] [/P] [/W] [/A[[:]atributos]] [/O[[:]sortorder]] [/S] [/B] [/L] [drive:][caminho][nome_do_arquivo] Especifica um drive, diretorio, e/ou arquivos para listar. (Nao pode ser adicionado especificacao de arquivos ou multiplas especificacoes.) /P Pausa depois de cada informacao de tela cheia. /W Usa formato de lista largo. /A Mostra arquivos com atributos especificados. [SELECAO DE ATRIBUTOS AINDA NAO IMPLEMENTADA; /A e /ADRHS] attributes D Diretorios R Arquivos somente-para-leitura H Arquivos ocultos A Arquivos pronto para arquivamento S Arquivos do sistema - Prefixo sem significado /O Lista os arquivos em ordem. [AINDA NAO IMPLEMENTADA] sortorder N Por nome (alfabetica) S Por tamanho (pequenos primeiro) E Por extensao (alfabetica) D Por data e hora (novos primeiro) G Grupo de diretorios primeiro - Prefixo para reverter ordem A Por ultima Data de Accesso (novos primeiro) /S Mostra os arquivos em diretorios especificados e em todos os subdiretorios. /B Usa formato simples(sem informacoes de cabecario ou sumario). /L Usa minusculas. /V Modo verboso. /Y Mostra anos com 4 digitos. As opcoes podem ser predefinidas na variavel de ambiente DIRCMD. Sobrescreva as predefinicoes colocando em qualquer opcao um - (hifem) Por exemplo: /-W. . :TEXT_CMDHELP_DOSKEY#1 O utilitario externo DOSKEY foi incorporado ao FreeCOM. Use as teclas de Seta PARA CIMA & PARA BAIXO para chamar o historico e HISTORY para mostra-lo. Use as teclas de Seta PARA ESQUERDA & PARA DIREITA e END & HOME para navegar nas linha de comandos e modifica-los em modo de insercao ou sobrescrever. Use a tecla TAB para completar a palavra atual com nome do arquivo; use ele duas vezes para mostrar todos os arquivos encontrados. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edita e chama novamente linhas de comando, e cria macros. DOSKEY [/opcao ...] [nome_do_macro=[texto]] /BUFSIZE:size Define o tamanho do macro e buffer de comando (default:512) /ECHO:on|off Ativa/desativa echo de expansao de macros (default:on) /FILE:file Especifica arquivos contendo uma lista de macros /HISTORY Mostra todos os comandos gravados na memoria /INSERT Insere novos caracteres na linha quando digitando /KEYSIZE:size Define o tamanho do buffer de digitacao do teclado (default:15) /LINE:size Define o tamanho maximo do buffer de edicao linha (default:128) /MACROS Mostra todos os mascros do DOSKey /OVERSTRIKE Sobrescreve novos caracteres na linha quando digitando (default) /REINSTALL Instala uma nova copia do DOSKEY macroname Especifica um nome para o macro que voce criar text Especifica os comandos que voce que associar ao macro CIMA,BAIXO estas setas re-executam comandos Esc limpa comando atual F7 mostra historico de comandos Alt+F7 limpa historico de comandos [carac]F8 procura comandos iniciados pelo [carac] F9 seleciona um comando pelo seu numero Alt+F10 limpa todas as definicoes de macros Os seguintes sao codigos especiais que voce pode usar na definicoes de macros do DOSKey: $T Separador de Comandos: permite multiplos comandos em um macro $1-$9 Parametros de Arquivos de Lote: equivalente ao %1-%9 em Arquivos de Lotes $* Simbolo substituido por todos os nomes de macro seguintes na linha de comando . :TEXT_CMDHELP_ECHO Mostra mensagens, ou define as saidas dos programas em LIGADO(ON) ou DESLIGADO(OFF). ECHO [ON | OFF] ECHO [mensagem] Digite ECHO sem parametros para mostrar as configuracoes atuais. . :TEXT_CMDHELP_EXIT Fecha o Interpretador de comandos do FreeDOS. EXIT . :TEXT_CMDHELP_FOR Executa um comando especificado para cada arquivo em um conjunto de arquivos. FOR %%variavel IN (set) DO comando [parametros-de-comandos] %%variavel Especifica um parametro substituivel. (set) Especifica um ou mais arquivos. Wildcards podem ser usados. comando Especifica o comando a ser executado para cada arquivo. parametros-de-comandos Especifica os parametros ou opcoes para o comando especificado. Para usar o comando FOR em um arquivo de lote, especifique %%%%variavel ao inves de %%variavel. Por exemplo: FOR %%f IN (---inicio--- a*.* ---fim---) DO ECHO - %%f - . :TEXT_CMDHELP_GOTO Redireciona o interpretador de comando para uma linha rotulada em um arquivo de lote GOTO rotulo rotulo Especifica um texto que sera usado em um arquivo de lote com um rotulo Voce digita um rotulo em uma linha por ele mesmo, iniciado com dois pontos (:). . :TEXT_CMDHELP_HISTORY#1 Comando Historico HISTORY [tamanho] Sem o "tamanho", o conteudo atual do buffer do historico e mostrado. Com o "tamanho", o tamanho buffer do historico e alterado. . :TEXT_CMDHELP_IF Possibilita processamento condicional em arquivos de lote. IF [NOT] ERRORLEVEL numero comando IF [NOT] string1==string2 comando IF [NOT] EXIST nome_de_arquivo comando NOT Especifica que o interpretador de comandos deve executar o comando somente se a condicao for falsa. ERRORLEVEL number Especifica uma condicao verdadeira se o ultimo programa rodado retornou um codigo de saida igual ou maior que o numero especificado. command Especifica que comando que sera executado se a condicao for satisfeita. string1==string2 Especifica uma condicao verdadeira se o texto definido for igual. EXIST filename Especifica uma condicao verdadeira se o nome_de_arquivo especificado existir. . :TEXT_CMDHELP_LH Carrega um programa na area de memoria alta. LOADHIGH [drive:][caminho]nome_de_arquivo [parametros] LOADHIGH [/L:regiao1[,tam_min1][;regiao2[,tam_min2]...] [/S]] [drive:][caminho]nome_de_arquivo [parametros] /L:regiao1[,tam_min1][;regiao2[,tam_min2]]... Especifica a(s) regiao(oes) da memoria para carregar o programa. Regiao1 especifica o numero de primeira regiao da memoria; tam_min1 especifica o tamanho minimo, seja qual for, para a regiao1. Regiao2 e tam_min2 especifica o numero e o tamanho minimo da segunda regiao, seja qual for. Voce pode especificar quantas regioes voce quiser. /S Diminue um UMB para seu tamanho minimo enquanto o program e carregado. [drive:][caminho]nome_de_arquivo Especifica a localizacao e nome do programa. . :TEXT_CMDHELP_LOADFIX Carrega um program alem dos primeiros 64K de memoria, e roda o programa. LOADFIX [drive:][caminho]nome_de_arquivo Use LOADFIX para carregar um programa se voce tiver recebido a mensagem "Pacote de arquivo corrompido" quando tentando carregar em memoria baixa. . :TEXT_CMDHELP_MD Cria um diretorio. MKDIR [drive:]caminho MD [drive:]caminho . :TEXT_CMDHELP_PATH Mostra ou define um caminho procuravel para arquivo executaveis. PATH [[drive:]caminho[;...]] PATH ; Digite PATH ; para limpar todas as configuracoes definidas e direcionar o interpretador para procurar somente no diretorio atual. Digite PATH sem parametros para mostrar os CAMINHOS atualmente definidos. . :TEXT_CMDHELP_PAUSE Suspende o processamento de um arquivo de lote e mostra a mensagem: "Pressiona qualquer tecla para continuar...." ou uma mensagem opcional especificada. PAUSE [mensagem] . :TEXT_CMDHELP_PROMPT Muda o prompt de comando. PROMPT [texto] text Especifica um novo prompt de comando. O prompt pode ser feito de caracteres normais e os seguintes codigos especiais: $Q = (sinal de igual) $$ $ (sinal de dolar) $T Hora atual $D Data atual $P Drive e caminho atual $V O numero da versao do FreeCOM do FreeDOS $N Drive atual $G > (sinal maior-que) $L < (sinal menor-que) $B | (barra) $H Backspace (apaga caracteres anteriores) $E Escape code (Codigo ASCII 27) $_ Retorno de carro e alimentacao de linha Digite PROMPT sem parametros para restaurar as configuracoes padrao. . :TEXT_CMDHELP_PUSHD Armazena o diretorio atual, com a opcao para mudar o diretorio atual. PUSHD [[drive:]caminho] Onde [drive:]caminho e o caminho para onde voce que mudar. . :TEXT_CMDHELP_POPD Retira um diretorio de pilha de diretorios, e muda para ele. POPD [*] O parametro '*' limpa a pilha de diretorios. . :TEXT_CMDHELP_DIRS Mostra o conteudo de uma pilha de diretorios. DIRS . :TEXT_CMDHELP_RD Remove (apaga) um diretorio. RMDIR [drive:]caminho RD [drive:]caminho . :TEXT_CMDHELP_REM Comenta (remarca) comandos em um arquivo de lote ou CONFIG.SYS. REM [comentario] . :TEXT_CMDHELP_REN Renomeia um arquivo/diretorio ou arquivos/diretorios. RENAME [drive:]caminho][diretorio1 | arquivo1] [diretorio2 | arquivo2] REN [drive:][caminho][diretorio1 | arquivo1] [diretorio2 | arquivo2] Note que voce nao pode especificar um novo drive ou caminho para o seu destino. Use o comando MOVE para este proposito. . :TEXT_CMDHELP_SET#1 Mostra, define, ou remove variaveis de ambiente. SET [/C] [variavel=[string]] variavel Especifica o nome da variavel de ambiente. string Especifica uma serie de caracteres para associar a variavel. * Se nenhuma string e especificada, a variavel e removida do ambiente. Digite SET sem parametros para mostrar as variaveis de ambiente atuais. /C obriga a manter o nome da variavel como escrito; por padrao a variavel e em maiuscula, se ela nao e localizada no ambiente, que de outro modo e retornada. . :TEXT_CMDHELP_SHIFT#1 Muda a posicao dos parametros substituiveis em um arquivo de lote. SHIFT [DOWN] Muda a janela de argumentos que sera iniciada (%%0); que de outro modo tomado ate o fim. . :TEXT_CMDHELP_TIME#1 Mostra ou muda a hora do sistema. TIME [/T] [hora] Digite TIME sem parametross para mostrar a hota atual e um prompt para inserir uma nova hora. Pressione ENTER para mantes a mesma hora. /T mostra apenas a HORA, sem solicitar uma nova. . :TEXT_CMDHELP_TRUENAME Mostra o caminho completo do caminho especificado. TRUENAME [drive:][caminho][nome_de_arquivo] . :TEXT_CMDHELP_TYPE Mostra o conteudo de arquivos de texto. TYPE [drive:][caminho]nome_do_arquivo . :TEXT_CMDHELP_VER Mostra a versao do FreeCOM do FreeDOS e outras informacoes. VER [/R] [/W] [/D] [/C] /R Mostra a versao do kernel e outras informacoes. /W Comando do FreeCOM de garantia. /D Comando do FreeCOM com informacoes sobre redistribuicao. /C Comando do FreeCOM com as nomes dos contribuidores. . :TEXT_CMDHELP_VERIFY Chamado para verificar se seus arquivos estao gravados corretamente no disco. VERIFY [ON | OFF] Digite VERIFY sem parametros para mostrar as configuracoes atuais. . :TEXT_CMDHELP_FDDEBUG Se a opcao de depuracao em compilada no FreeDOS, este comando ira ativar/desativar a saida de depuracao, ou mostrar se ele esta ativado/desativado. FDDEBUG [ON | OFF | arquivo] Digite FDDEBUG sem parametros para mostrar a configuracao de depuracao atual. Se um arquivo e especificado, todas as saidas de depuracao e redirecionada para aquele arquivo; a saida e adicionada ao fim do arquivo, se ele ja existir. Os nome especiais "stdout" e "stderr" podem ser usados para redirecionar a saida para a saida padrao ou o canal de erros padrao. . :TEXT_CMDHELP_VOL Mostra o Volume do disco e o Numero de Serie, se eles existem. VOL [drive:] . :TEXT_CMDHELP_QUESTION#1 Mostra uma lista de comandos e caracteristicas disponiveis no FreeCOM. ? ?comando [argumento] A primeira variante mostra qualquer comando interno disponivel. O segundo ira perguntar se voce quer ou nao executar o comando especificado como se o modo de trilha estivesse ativo. . :TEXT_CMDHELP_WHICH Procura e mostra o arquivo executavel para cada comando especificado.. WHICH {comando} . :TEXT_CMDHELP_MEMORY#1 Mostra a memoria interna usada pelo FreeCOM internamente. MEMORY . ================================================ FILE: strings/russian.err ================================================ # $Id$ # # Critical error national customization file # # Language: Russian # Codepage: CP866 # Author: anonymous # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: 訡 %1 %A: %2 : %3 S3 CHAR_DEVICE: 訡 %1 %A: %3 ## kind of operation S0 READ: ⥭ S1 WRITE: ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: ७ S7 DATA: ## action strings S8 IGNORE: ஢ (I) S9 RETRY: (R) S10 ABORT: ࢠ (A) S11 FAIL: 訡 (F) ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: 訡 S15 0: ⪠ 襭 1: ࠩ 2: ⮢ 3: ࠩ 稫 4: 訡 ( CRC) 5: ୠ ࠩ ன⢠ 6: 訡 ᪠ 7: ⨯ ⥫ 8: ᥪ 9: ਭ 稫 㬠 10: 訡 11: 訡 ⥭ 12: 訡 13: 襭 14: 襭 ஢ 15: ୠ ᬥ ᪠ 16: FCB 㯥 17: ९ 饣 18: ᮮ⢥⢨ ࠭ 19: 20: 筮 ᪥ ================================================ FILE: strings/russian.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Russian # Codepage: CP866 # Author: ਩ ⨭, Petr-Akhlamov, # 㧭殢 堩. # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% ⨬ . - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% ⨬ . - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% ⨬ : '%s' . :TEXT_ERROR_OPT_ARG#0% '%s' 㬥 . :TEXT_ERROR_OPT_NOARG#0% '%s' 㬥 . :TEXT_INVALID_NUMBER#0% ୮ ᫮ 㪠 '%s' . :TEXT_ERROR_CLOSE_QUOTE#0% 뢠 窠: %c . :TEXT_ERROR_TEMPFILE ᮧ ६ 䠩 . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% 誮 ࠬ஢. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS 誮 ࠬ஢. . :TEXT_ERROR_INVALID_PARAMETER#0% ⨬ ࠬ. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND . . :TEXT_ERROR_FILE_NOT_FOUND . . :TEXT_ERROR_SFILE_NOT_FOUND#0% . - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% 饭 易⥫ ࠬ. . :TEXT_ERROR_INVALID_DRIVE#0% %c:. . :TEXT_ERROR_BADCOMMAND#2% ⭠ ୮ 䠩 - "%s". . :TEXT_ERROR_OUT_OF_MEMORY 訡. 筮 . . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 뤥 DOS. . :TEXT_ERROR_CANNOTPIPE ७ࠢ : ६ 䠩! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% ப #%ld ⭮ 䠩 '%s' ᫨誮 . . :TEXT_ERROR_BFILE_VANISHED#0% 䠩 '%s' . . :TEXT_ERROR_BFILE_LABEL#0% 䠩 '%s' ᮤন ⪨ '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1% %s ᡮ '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% ⠭ 祭 ६ 㦥 '%s'. , ६ 㦥 ९. . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% ६ 㦥 '%s' . . :TEXT_ERROR_NO_ENVIRONMENT 뤥 ६ 㦥. १ 樥: /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% ᥢ '%s'. , ⠡ ᥢ ९. . :TEXT_ERROR_ALIAS_NOT_FOUND#1% ᥢ '%s' . . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 뤥 ⠡ ᥢ. . :TEXT_ERROR_SYNTAX_STR#0% ⠪᪠ 訡. - '%s' . :TEXT_ERROR_SYNTAX ⠪᪠ 訡. . :TEXT_ERROR_FILENAME_TOO_LONG#0% 䠩 ᫨誮 . - '%s' . :TEXT_ERROR_SELFCOPY#0% ᪮஢ '%s' ᠬ ᥡ . :TEXT_ERROR_COMMAND_TOO_LONG ப ᫨誮 ᫥ ᥢ! . :TEXT_ERROR_LINE_TOO_LONG ப ᫨誮 . 믮 . . :TEXT_ERROR_HISTORY_SIZE#1% ࠧ ਨ ப '%s'. . :TEXT_HISTORY_EMPTY#1 ப . . :TEXT_ERROR_BAD_MCB_CHAIN 窠 MCB ०, ᮢ⨬ MS-DOS ⥬. . :TEXT_ERROR_UNDEFINED_ERROR#0% ⭠ 訡 %d. . :TEXT_ERROR_REGION_WARNING#0% ய饭 ०񭭠 %d. . :TEXT_ERROR_ON_OR_OFF ON OFF. . :TEXT_ERROR_BAD_VARIABLE ୮ 㪠 ६. . :TEXT_ERROR_IN_MISSING#1 FOR: IN. . :TEXT_ERROR_MISSING_PARENTHESES#1 ᪮ 뫨 ய饭. . :TEXT_ERROR_DO_MISSING#1 FOR: DO. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: 㪠 ᫥ ⢥ত DO. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% ७ࠢ 䠩 '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE#0% ७ࠢ 뢮 䠩 '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 ⮥ ७ࠢ. . :TEXT_ERROR_INVALID_DATE ४⭠ . . :TEXT_ERROR_INVALID_TIME ४⭮ ६. . :TEXT_ERROR_NO_GOTO_LABEL 㪠 ⪠ ᫥ GOTO. . :TEXT_CTTY_NOTIMPLEMENTED : CTTY ᪫祭 ⮣ COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE#0% ୮ ⠡쭮 ன⢮ '%s'. . :TEXT_ERROR_CTTY_DUP#0% ਯ 䠩 TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L ॠ. . :TEXT_ERROR_U_NOTIMPLEMENTED /U ॠ. . :TEXT_ERROR_WRITING_DEST 񬭨. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% 㤠 筨. - '%s' . :TEXT_ERROR_OPEN_FILE#0% 㤠 䠩 '%s' . :TEXT_ERROR_READ_FILE#0% 㤠 䠩 '%s' . :TEXT_ERROR_WRITE_FILE#0% 㤠 䠩 '%s' . :TEXT_ERROR_LEADING_PLUS ꥤ '+' । 㬥⮬. . :TEXT_ERROR_TRAILING_PLUS ꥤ '+' ᫥ 㬥⮢. . :TEXT_ERROR_NOTHING_TO_DO 祣 . . :TEXT_ERROR_COPY ஢ . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: 㪠 䠩 . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: 㪠 ᫮ . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: ୮ ᫮ . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: 㪠 . :TEXT_NOT_IMPLEMENTED_YET ... ॠ. . :TEXT_FAILED_LOAD_STRINGS 㧪 ᮮ饭 . . :TEXT_MSG_NOTIMPLEMENTED /MSG ᪫祭 ⮣ COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u 㭪⮢ . . :TEXT_CORRUPT_COMMAND_LINE ०񭭠 ப. ७ 訡 COMMAND.COM. , ᮮ ⮩ 訡. . :TEXT_QUOTED_C_OR_K#1 /C /K 窠 ⮬ ந஢. . :TEXT_INIT_FULLY_QUALIFIED#1% 䠩: COMMAND.COM ! ᮤঠ ᪠ 稭 ⭮ ᮩ . ਬ: C:\\FDOS COMMAND.COM ᯮ : %s . :TEXT_ERROR_RESTORE_SESSION ଠ ᥠ 뫠 ⭮ ﭠ. ᬮ ।騥 ᮮ饭 訡 楫 ᭥ 稭 ⮩ 訡. . :TEXT_ERROR_SAVE_SESSION ଠ ࠭ ⥪饩 ணࠬ. ᬮ ।騥 ᮮ饭 訡 楫 ᭥ 稭 ⮩ 訡. . :TEXT_ERROR_CWD_FAILED#1% %c: ⢥砥. . :TEXT_ERROR_KSWAP_ALIAS_SIZE 祭ﬨ: ᥢ ᫨誮 . . :TEXT_ERROR_KSWAP_ALLOCMEM 祭ﬨ: 뤥 . . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 ௠ ࠭⢮ ᥢ. . :TEXT_ERROR_ALIAS_NO_SUCH#1% 騩 ᥢ: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 ⠢ ᥢ. . :TEXT_ALIAS_INVALID_NAME#1% ୮ ᥢ '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 㧨 ⥪ ࠡ稪 ᪨ 訡. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 ௠ ⥪. ᫨ 訡 㤥  쭥襬, ஡ 㢥 ࠧ ७ ஢, ਬ, ୠ , ⥪ ⠫ .. .. . :TEXT_ERROR_CONTEXT_LENGTH#1% ⥪ ॢᨫ ⨬ । %lu . ࠧ ⥪ ࠧ %u . . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 樨 ᪮ ଠ樨 ⥪. 訡 - ० - ୮ ⠭ 쭮 ࠧ ⥪. , ᢥ ࠧࠡ稪 FreeCOM ⮩ 訡 : freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 ⥪ ᫥ 窨. ⥪ ᮧ , ᥢ 㣠 ଠ, ࠭ ⥪, 뫠 ⭮ ﭠ. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: 饭 . :TEXT_ERROR_NO_SUCH_FILE#1% %s: ⠪ 䠩 ⠫ . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: ⭠ 訡 . # # Informational messages # :TEXT_MSG_PAUSE#1 த . . .\ . :TEXT_MSG_HISTORY_SIZE#0% ୠ ⠢ %d . . :TEXT_MSG_DOSKEY DOSKEY 祭 . . :TEXT_MSG_ECHO_STATE#0% ECHO - %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY - %s . :TEXT_MSG_FDDEBUG_STATE#0% 뢮 DEBUG - %s. . :TEXT_MSG_FDDEBUG_TARGET#0% 뢮 DEBUG ⠭ '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK - %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR - %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFNFOR COMPLETE - %s . :TEXT_MSG_CURRENT_DATE#0% : %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% (%s%s[]): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% (%s%s[]): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% ([]%s%s): \ . :TEXT_MSG_CURRENT_TIME#0% 饥 ६: %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 祭 ६: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% YyNn{CR}{LF}{CBREAK} aabb b b b 䠩 ⠫: '%s' 㤠! 㢥७ (Y/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 YyNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [=ENTER, =ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% YyNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b 뫠 : Control-Break.\r ४ 믮 ⭮ 䠩 '%s' (Yes/No/All)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b १ '%s' (Yes/No/All/Quit) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b ꥤ '%s' (Yes/No/All/Quit) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' (Yes/No/All/Quit) ? \ . :TEXT_UNKNOWN_FILENAME#1 <<>>\ . :TEXT_DIRSTACK_EMPTY ⥪ ⠫ ⮩. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% ⪠ ⮬ %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% - %s . :TEXT_DIR_HDR_VOLUME_NONE . :TEXT_DIR_HDR_SERIAL_NUMBER#0% ਩ ⮬ - %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s 䠩()\ . :TEXT_DIR_FTR_BYTES#0% %12s . :TEXT_DIR_FTR_TOTAL_NUMBER ᥣ 䠩: . :TEXT_DIR_FTR_DIRS#1% %10s ⠫()\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s ᢮ . :TEXT_DIR_DIRECTORY#0% 騩 ⠫: %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% 騩 ⠫: %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 <> \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% =%s . :TEXT_MSG_PATH_NONE#1 㪠 砫 ᪠. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 \ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 䠩 㤠. . :TEXT_MSG_DEL_CNT_FILES_1#1 䠩 㤠. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u 䠩 㤠. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS 㯭 ७ : . :TEXT_MSG_SHOWCMD_FEATURES 㯭 : . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [ᥢ] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [७ ] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [ୠ ] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [ 䠩] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [窠] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [⮪஢] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [᫥ ⠫] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [ 䠩] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [窠 ] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [窠 XMS] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [窠 㬮砭] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [⠭ ] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [⥪ ⠫ (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [⫠ FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 F8 砫 ஢, F5 室: %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% : '%s'. . :TEXT_MSG_VER_DOS_VERSION#0% DOS: %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS (ᡮઠ 1933 ।) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS: %d.%d.%d . :TEXT_MSG_VER_WARRANTY ᪮ ࠢ (C) 1994-2005 ଠ 㣨. ணࠬ ࠭ , 㤥 , - ; ࠧ㬥 ࠭⨩ . 祭 ஡ ᢥ ᬮ ᠫ ⢥ 業 GNU. 訡 뫠 : freedos-devel@lists.sourceforge.net. ᥣ 㯭 http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION ᪮ ࠢ (C) 1994-2005 ଠ 㣨. ᢮ ணࠬ; ୮ ࠭ / ஢ ᮮ⢥⢨ ᠫ쭮 ⢥ 業 GNU, 㡫 ; ᨨ 2, ( 襬 롮)  ᨨ. 訡 뫠 : freedos-devel@lists.sourceforge.net. ᥣ 㯭 http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS ᮧ 窨 FreeDOS ⢮ ࠧࠡ稪. ஡ ᠭ 䠩: HISTORY.TXT. ६ ⢥⢥ ஥  䥭 . 쬠 : freedos-devel@lists.sourceforge.net 訡 뫠 : freedos-devel@lists.sourceforge.net. ᥣ 㯭 http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r 室 窨. 室 , ᪮ 窠 뫠 饭 樥: "/P". १㧨 ⥬ , ᫨ ࠡ⠥ ⨧筮 ।, 㡥 (ਬ, Microsoft (R) Windows 襩 믮塞 FreeCOM ⢥न, ᫨ 㦭, ७ ४ 믮 ⮩ .). . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 믮 䠩 FreeCOM . 㪠 䠩: COMMAND.COM ⢥ ࢮ ࠬ, , ਬ: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% ६ 㦥 : ᨬ %5u ; ᢮ %5u . :TEXT_MEMORY_CONTEXT#1% ⥪ : ᨬ %5u ; ᢮ %5u . :TEXT_MEMORY_HEAP#1% : ᢮ %5lu . :TEXT_MEMORY_CTXT_ALIAS#1% \tᥢ : %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢ . :TEXT_MEMORY_CTXT_HISTORY#1% \tୠ : %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢ . :TEXT_MEMORY_CTXT_DIRSTACK#1% \t⥪ ⠫: %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢ . :TEXT_MEMORY_CTXT_LASTDIR#1% \t᫥ ⠫ : ᯮ %5u , %5u 㭪⮢ . :TEXT_MEMORY_CTXT_BATCH#1% \t 맮 䠩 : ᯮ %5u , %5u 㭪⮢ . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tଠ 窥 : ᯮ %5u , %5u 㭪⮢ . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 㤠 ⥪ ࠭ ⥬. . :TEXT_ERROR_SET_CODEPAGE#1 㤠 ⥪ ࠭. . :TEXT_DISPLAY_CODEPAGE#1% ࠭: %u. ⥬ ࠭: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS 뢮 ࠭, ⠭ 㤠 ᥢ. ALIAS [६[=][ப]] ६ 뢠 ᥢ. ப ᫥⥫쭮 ᨬ ᢮ ᥢ. ALIAS ࠬ஢ ⮡ࠧ ⥪騥 ᥢ. . :TEXT_CMDHELP_BEEP 뢮 㪮 ᨣ. . :TEXT_CMDHELP_BREAK ⠭ ⪠ 䫠 ஫ ⨥ CTRL+C. BREAK [ON | OFF] BREAK ࠬ஢ ᭨ ⥪饥 祭 BREAK. . :TEXT_CMDHELP_CALL#1 맮 ⭮ 䠩 㣮 ⭮ 䠩. CALL [/S | /N] [/Y] [:][]_䠩 [ࠬ] ࠬ 砥 祭, ॡ㥬 ⭮ 䠩. /S 砥, /N 몫砥 FreeCOM. /Y 砥 ० ஢ 믮 . . :TEXT_CMDHELP_CD 뢮 ⥪饩 ४ਨ . CHDIR [:][] CHDIR[..] CD [:][] CD[..] CD - .. 室 த⥫᪨ ⠫. - ᫨ "᫥ ⠫" 㯭, ⢫ 室 ᫥ ⠫. CD : 뢮 ⥪饣 ⠫ 㪠 ᪥. CD ࠬ஢ 뢮 ⥪饣 ᪠ . ⠪: CDD . :TEXT_CMDHELP_CDD 뢮 ⥪饣 ⠫ ᪠ ⥪騩 ⠫. CDD [:][] CDD[..] .. 室 த⥫᪨ ⠫. - ᫨ "᫥ ⠫" 㯭, ⢫ 室 ᫥ ⠫. ᫨ 㪠 :, ந ᬥ ⥪饣 ᪠ 㪠. ⢥ ⫨稥 : "CHDIR". CDD ࠬ஢ 뢮 ⥪饣 ᪠ . . :TEXT_CMDHELP_CHCP 뢮 ⠭ ⨢ ࠭. CHCP [] ࠭. CHCP ࠬ஢ 뢮 ⥪饩 ࠭. . :TEXT_CMDHELP_CLS ⪠ ࠭. CLS . :TEXT_CMDHELP_COMMAND 窨 FreeDOS. COMMAND [[:]] [ன⢮] [/E:] [/L:] [/U:] [/P] [/MSG] [/LOW] [/Y [/[C|K] ]] [:] 砥 ⠫ 䠩: COMMAND.COM. ன⢮ 砥 ன⢮, ᯮ㥬 뢮. /E: ⠭ 砫쭮 ࠧ ६ . (祭: 㦭 ⮡ 뫮 256 32,768). /L: ⠭ 砫쭮 ࠧ ७ ஢ (ॡ ⠪ /P). (祭: 㦭 ⮡ 뫮 128 1,024). /U: ⠭ ࠧ (ॡ ⠪ /P). (祭: 㦭 ⮡ 뫮 128 255). /P 㧪 室 . /MSG ࠭ ᮮ饭 訡 (ॡ ⠪ /P). /LOW 饭 १ 窨 ⤥ . /Y 蠣 믮 ⭮ 䠩, 㪠 १ 樨 /C /K. /C 믮 . /K 믮 த 믮 窨. . :TEXT_CMDHELP_COPY ஢ 䠩 㣮 . COPY [/A | /B] 筨 [/A | /B] [+ 筨 [/A | /B] [+ ...]] [񬭨] [/A | /B]] [/V] [/Y | /-Y] 筨 砥 䠩 ஢. /A 室 䠩  ⥪⮢. /B 室 䠩  . 񬭨 ⠫ ࠧ饭 䠩 / 筮 䠩(). /V ஢ઠ ࠢ쭮 ஢. /Y ⪫祭 ० ⢥ত १ 饣 筮 䠩(/). /-Y 祭 ० ⢥ত १ 饣 筮 䠩. ४⥫ /Y ६ 㦥: COPYCMD. ४⥫ /-Y, ।⢥ ப, ਮ . ꥤ ᪮쪨 䠩 , 㦭 ⢥ 䠩 ᪮쪮 室 䠩 ( ᯮ짮 ᮪ 䠩 ப ଠ: 筨1+筨2+筨3... . :TEXT_CMDHELP_CTTY ன⢠, ᯮ㥬 뢮. CTTY ன⢮ ன⢮ ନ쭮 ன⢮ ᯮ짮 (ਬ, CON, AUX, COM1, COM2, COM3, COM4, PRN, LPT1, LTP2, CLOCK$ :-) ). . :TEXT_CMDHELP_DATE#1 뢮 ⠭ . DATE [/D] [] DATE ࠬ஢ ⥪饥 祭 뤠 祭 . ⨥ ENTER ⠢ 祭 . /D 뢮 . . :TEXT_CMDHELP_DEL#2 䠩. DEL [:][]_䠩 [/P] [/V] ERASE [:][]_䠩 [/P] [/V] [:][]_䠩 砥 䠩(/) 㤠. 襭 ᯮ짮 ⠭ 㤠 䠩. /P 뢮 㤠 䠩. /V 뢮 㤠 䠩. . :TEXT_CMDHELP_DIR#4 뢮 ᯨ᪠ 䠩 ⠫, 室 ⥪饬 ⠫. DIR [:][][_䠩] [/P] [/W] [/A[[:]ਡ]] [/O[[:]஢]] [/S] [/B] [/L] [:][][_䠩] 砥 , / 䠩() 뢮 ࠭ ( 㪠뢠 ᪮쪮 ࠧ殢 䠩). /P 㧠 ᫥ ࠭. /W 뢮 ᯨ᪠ 䠩 ᪮쪮 ⮫殢. /A 뢮 䠩 묨 ਡ⠬ ( 㬮砭 ᪠: /ADHSRA). ਡ D ⠫ R ⮫쪮 ⥭ H 䠩 A , ।祭 S ⥬ 䠩 娢樨 䨪: "-" 祭: "". /O ஢ ᯨ᪠ 䠩 ( 㬮砭 /ONG). ஢ N (䠢⭠) S ࠧ (稭 ) E ७ (䠢⭠) D ६ (稭 G ᯨ᮪ ⠫ ) U ஢ 䨪: "-" 祭: "". ᭮, 뢥 : DIR /O-U, . . ஢? ;-) /S 뢮 䠩 ⠫ ⠫. /B 뢮 ⮫쪮 䠩 ( 뢮 㬬୮ ଠ樨). /L 뢮 ᯨ᪠ ॣ. /Y /4 뢮 . ४⥫ ६ 㦥 DIRCMD. ⮡ ⬥ ⢨, ப ᫥ 䨪ᮬ: "-". ਬ: DIR /-W . :TEXT_CMDHELP_DOSKEY#1 ⨫: DOSKEY 뫠 ⥣஢ FreeCOM. ᯮ ६饭 , ப稢 ᮤন ୠ , ࠭ ப. ६ ப⪨ ENTER 믮  , 室 ப 稫 ୠ . ᯮ ६饭 ࠢ, । ⥪饩 ப. ⨥ : INSERT 砥 몫砥 ० ⠢/१ ᨬ ப. ᫨ : TAB, ந 䠩 ⥪饬 ⠫ ப 㤥 ⥪饣 ᫮ ⠢ 䠩, ஥ - 室 祭 ᫮. ਬ, ᫨ ப: DEL VER : TAB, ப ਬ : DEL VERSION.TXT, ᫮, ⠪ 䠩 ⥪饬 ⠫. ⨢ 砥 祣 ந. ⨥ : TAB 뢮 ࠭ ᯨ᮪ 䠩 ⠫ ⥪饬 ⠫. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 ஢ ப, 맮 । ᮧ ᮢ. DOSKEY [/ ...] [_=[⥪]] /BUFSIZE:ࠧ ⠭ ࠧ ᮢ ( 㬮砭 512) /ECHO:ON|OFF 롮 ० ⮡ࠦ ᮢ ( 㬮砭 ON) /FILE:䠩 뫪 䠩, ᮤঠ騩 ᯨ᮪ ᮢ /HISTORY 뢮 ࠭ , ᮤঠ /INSERT ⠢ ᨬ ।㥬 ப /KEYSIZE:ࠧ ( 㬮砭 15) /LINE:ࠧ ᨬ ࠧ ப ( 㬮砭 128) /MACROS 뢮 ࠭ ᮢ DOSKey /OVERSTRIKE ᨬ (ᯮ 㬮砭) /REINSTALL DOSKey _ ᮧ ⥪ , 室騥 ⠢ ५: : ⠭ ப Esc: ⪠ ⥪饩 ப F7: 뢮 ࠭ ୠ Alt+F7: ⪠ ୠ [ᨬ]F8: ୠ, 稭饩 㪠 ᨬ F9: 롮 Alt+F10: ⪠ । ᮢ 樠 , ᯮ짮 DOSKey: $T ⥫ : ᯥ稢 ᪮쪨 ப $1-$9 ࠬ- ࠬ஢ %1-%9 䠩 $* ⥪⮬, 騬 ப . :TEXT_CMDHELP_ECHO 뢮 ᮮ饭 ४祭 ० ⮡ࠦ ࠭. ECHO [ON | OFF] ECHO [ᮮ饭] ECHO ࠬ஢ ᭨ ⥪騩 ० ⮡ࠦ . . :TEXT_CMDHELP_EXIT 室 窨 FreeDOS. EXIT . :TEXT_CMDHELP_FOR 㪠 䠩 . FOR %%६ IN () DO [ࠬ] %%६ ⠢塞 ࠬ. () , 騩 䠩. ᪠ ᯮ짮 ⠭ . , 믮塞 䠩 . ࠬ ࠬ , 室 믮 . ᯮ짮 : FOR ⭮ 䠩, : %%६ ᫥ ᯮ짮: %%%%६. . :TEXT_CMDHELP_GOTO । ࠢ ⬥祭 ப ⭮ 䠩. GOTO ⪠ ⪠ ⮢ ப, ⭮ 䠩 ஫ ⪨. ⪠ 室 ⤥쭮 ப ⭮ 䠩 稭 . . :TEXT_CMDHELP_HISTORY#1 ୠ . HISTORY [ࠧ] ᫨ 㪠 ࠬ: "ࠧ", ࠭ 뢮 ⥪饥 ᮤন ୠ . ᫨ 㪠 祭 ࠬ: "ࠧ", ࠧ ୠ 㪠 ࠧ. . :TEXT_CMDHELP_IF ᫮ 믮 䠩. IF [NOT] ERRORLEVEL ᫮ IF [NOT] ப1==ப2 IF [NOT] EXIST _䠩 NOT 뢠, 믮 ⮬ 砥, ᫨ ᫮ . ERRORLEVEL ᫮ ᫮ ⨭, ᫨ ᫥ 饭 ணࠬ 訫 , ࠢ ॢ騬 㪠 ᫮. , ᫥ 믮 砥 ⨭ ᫮. ப1==ப2 ᫮ ⨭ ᮢ ப. EXIST _䠩 ᫮ ⨭, ᫨ 㪠 䠩 . . :TEXT_CMDHELP_LFNFOR 砥/⪫砥 䠩 FOR 䠩. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] LFNFOR LFNFOR COMPLETE ࠬ, ⮡ ⮡ࠧ ⥪騥 ன. . :TEXT_CMDHELP_LH 㧪 ண 孥 (UMB). LOADHIGH [:][]_䠩 [ࠬ] LOADHIGH [/L:1[,_ࠧ1][;2[,_ࠧ2]...] [/S]] [:][]_䠩 [ࠬ] /L:1[,_ࠧ1][;2[,_ࠧ2]]... ⥩ , ᫥ 㦠 ணࠬ. 1 । ࢮ ⥩ , _ࠧ1 - 室 ࠧ 1. 2 _ࠧ2 । ࠧ ன . ⢮ 㪠 ⥩ ࠭祭. /S ⨥ UMB 㬠 㧪 ணࠬ. [:][]_䠩 ணࠬ . . :TEXT_CMDHELP_LOADFIX 㧪 ணࠬ 64 믮. LOADFIX [:][]_䠩 ᯮ LOADFIX 㧪 ணࠬ ⮬ 砥, ᫨ 砥 ᮮ饭: "Packed file corrupt" ⪥ 㧪 ணࠬ . . :TEXT_CMDHELP_MD ⠫. MKDIR [:] MD [:] . :TEXT_CMDHELP_PATH 뢮 ࠭ ⠭ ᪠ 믮塞 䠩. PATH [[:][;...]] PATH ; PATH ; ⪨ ⥪饣 ᪠ 믮塞 䠩 ( ⮬ 㤥 ந ᪫⥫쭮 ⥪饬 ⠫). PATH ࠬ஢ 뢮 ࠭ ⥪饣 ᪠ 믮塞 䠩. . :TEXT_CMDHELP_PAUSE ਮ⠭ 믮 ⭮ 䠩 뢮 ᮮ饭: "Press any key to continue...." 㪠 ⢥ ࠬ ᮮ饭. PAUSE [ᮮ饭] . :TEXT_CMDHELP_PROMPT ਣ襭 ப . PROMPT [⥪] ⥪ ਣ襭 ப. ਣ襭 ᨬ ᫥騥 : $Q = ( ࠢ⢠) $$ $ (ᨬ ) $T 饥 ६ $D $P 騥 $V ᨨ 窨 FreeDOS $N 騩 $G > ( "") $L < ( "") $B | (⨪쭠 ) $H Backspace (㤠 ।饣 ᨬ) $E Escape (ASCII 27) $_ ⪨ ॢ ப PROMPT ࠬ஢ ⠭ 室 ਣ襭. . :TEXT_CMDHELP_PUSHD 饭 ⥪ ⠫ ⥪饣 ⠫. ᫨ 㪠 ࠬ, ஬ 饭 ⥪ ⠫ ⥪饣 ⠫ ⢫ 室 㪠 ⢥ ࠬ ⠫. PUSHD [[:]] ࠬ, 㪠 : [:] 砥 ⠫, ३. . :TEXT_CMDHELP_POPD 祭 ⥪ ⠫ ᫥ 񭭮 㤠 ⠫ 室 . POPD [*] ᫨ 㪠 ࠬ: '*', ந ⪠ ⥪ ⠫. . :TEXT_CMDHELP_DIRS 뢮 ࠭ ᮤন ⥪ ⠫. DIRS . :TEXT_CMDHELP_RD ⮦ ⠫. RMDIR [:] RD [drive:]path . :TEXT_CMDHELP_REM 饭 ਥ 䠩 䠩: CONFIG.SYS. REM [਩] . :TEXT_CMDHELP_REN २ 䠩 ⠫. RENAME [:][][⠫1 | _䠩1] [⠫2 | _䠩2] REN [:][][⠫1 | _䠩1] [⠫2 | _䠩2] 㣮 ⠫ १饣 䠩 ⠫ . ⮣ : MOVE. . :TEXT_CMDHELP_SET#1 뢮 ࠭, ⠭ 㤠 ६ 㦥. SET [/C] [/P] [/E] [/U] [६=[ப]] ६ ६ 㦥. ப , ।⠢騩 ᮡ 祭 ६ 㦥. * ᫨ ᫥ ࠢ⢠ 祣 , ६ 㦥 㤥 㤠. SET ࠬ஢ 뢮 ࠭ ᮤন ६ 㦥. /C ࠭ ॣ ६ ࠡ . 㬮砭 ६ । ࠡ⮩ ॢ 孨 ॣ. ᫨ 㪠 : /C, ॢ 孨 ॣ ६ 믮 㤥. /P ᫥ : "SET ६=" ந ० 祭 ६. /E ⠭ ६ ப 뢮 , 㪠 [ப]. /U ॢ 祭 [ப] 孨 ॣ. . :TEXT_CMDHELP_SHIFT#1 ᮤন (ᤢ) ⠢塞 ࠬ஢ ⭮ 䠩. SHIFT [DOWN] DOWN 믮 ᤢ ࠬ஢ 砫 (%%0); 㣨 ந室 ᤢ . . :TEXT_CMDHELP_TIME#1 뢮 ࠭ ⠭ ⥬ ६ TIME [/T] [६] TIME ࠬ஢ 뢮 ࠭ ⥪饣 ६ ᠬ ⠭ ६ ०. ⨥ : ENTER ⠢ ६ . /T ᫨ 㪠 , ࠭ 㤥 뢥 ⥪饥 ६ ६. . :TEXT_CMDHELP_TRUENAME 뢮 ।񭭮 筮 㪠 . TRUENAME [:][][_䠩] . :TEXT_CMDHELP_TYPE 뢮 ࠭ ᮤন ⥪⮢ 䠩. TYPE [:][]_䠩 . :TEXT_CMDHELP_VER 뢮 ᨨ FreeDOS 㣮 ଠ樨. VER [/R] [/W] [/D] [/C] /R 뢮 ᨨ FreeDOS 㣮 ଠ樨. /W ࠭⨨, ।⠢塞 짮⥫ 窨 FreeDOS. /D ଠ ࠭ 窨 FreeDOS. /C ᮪ ࠧࠡ稪, ᮧ 窨 FreeDOS. . :TEXT_CMDHELP_VERIFY ⠭ ஫ ࠢ쭮 䠩 . VERIFY [ON | OFF] VERIFY ࠬ஢ ᭥ ⥪饣 ﭨ 䫠: VERIFY. . :TEXT_CMDHELP_FDDEBUG ᫨ ⫠稪 ஢ FreeDOS, ॢ ० 뢮 ⫠筮 ଠ樨 ﭨ: 祭 : 몫祭, ᮮ , ஢ ⫠稪 . FDDEBUG [ON | OFF | _䠩] FDDEBUG ࠬ஢ ᭥ ⥪饣 ० ⫠筮 뢮. ᫨ 㪠 䠩, 뢮 ⫠筮 ଠ樨 㤥 ந 㪠 䠩. ᫨ 䠩 㦥 , 뢮 㤥 ந . १ࢨ஢ ᥢ 䠩: "stdout" : "stderr" 㪠 ⢥ 䠩 뢮 (뢮 ⫠筮 ଠ樨 砥 㤥 ந ࠭). . :TEXT_CMDHELP_VOL 뢮 ࠭ ਩ ⮬ ⪨ ⮬ ᪠, ᫨ ⥪饬 㪠 ᪥. VOL [:] . :TEXT_CMDHELP_QUESTION#1 뢮 ࠭ ᯨ᪠ ⥩, 㯭 窥. ? ? [ࠬ] ਠ 뢮 ࠭ ᯨ᮪ ⥩, 㯭 窥. ன ਠ 뢮 ࠭ 믮 㪠 , ᫨ ० ஢ . . :TEXT_CMDHELP_WHICH 뢮 ࠭ ᯮ 䠩, ᮮ⢥騩 譥 . ਬ: WHICH Edit Edit C:\FREEDOS\EDIT.EXE WHICH {} . :TEXT_CMDHELP_MEMORY#1 뢮 ⨪ ᯮ짮 ७ FreeCOM. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 筮 䠩 ᮤঠ : '+'. . :TEXT_DELETE_FILE#1% 䠩 "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% 䠩 '%s'; ⭮, ? (ॡ %lu ) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% ᪮஢ %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% ᪮஢ %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM ன⢮: "%s" . :TEXT_ERROR_FCOM_INVALID#0% 䠩  FreeCOM ᮢ⨬ ᨨ: %s . :TEXT_ERROR_LOADING_STRINGS 㤠 㧨 ப , ⭮ %COMSPEC% 㪠 ४⭮ ᯮ. 㣮 ᯮ FreeCOM, ண 㧨 ப, ਬ: C:\\COMMAND.COM Enter, ⮡ ⬥ 㧪 ப. . :TEXT_TERMINATING 襭. . :TEXT_HIDDEN_CRITER#0% %u ᮢ ᪨ 訡 . . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% 室 (ERRORLEVEL): %u, 稭: %u (%s) . :TEXT_EXIT_REASON_NEG_1 訡 DOS API\ . :TEXT_EXIT_REASON_0 訫 ଠ쭮\ . :TEXT_EXIT_REASON_1 襭 ^Break\ . :TEXT_EXIT_REASON_2 襭 ᪮ 訡\ . :TEXT_EXIT_REASON_3 ⠫ १\ . :TEXT_ERROR_EXE_CORRUPT EXE-䠩 ०\ . ================================================ FILE: strings/serbian.err ================================================ # $Id$ # # Critical error national customization file # # Language: Serbian / Yugoslavian # Codepage: 852 # Author: Dejan trbac (strbac@phreaker.net) # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: %&0A%&0A%&0DGreka %1 na drajvu %A: - %3 S3 CHAR_DEVICE: %&0A%&0A%&0DGreka %1 na ureaju %A: - %3 ## kind of operation S0 READ: pri itanju S1 WRITE: pri upisu ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: Root S7 DATA: Podaci ## action strings S8 IGNORE: (I)gnorii S9 RETRY: (P)onovo S10 ABORT: (O)tkaz S11 FAIL: (N)euspeh ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: pP KEYS_ABORT: oO KEYS_FAIL: nN ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Nepoznata greka S15 0: POKUAJ PREKORAENjA ZATITE OD PISANjA 1: NEPOZNATA JEDINICA ZA DRAJVER 2: DRAJV NIJE SPREMAN 3: NEPOZNATA KOMANDA PRENETA DRAJVERU 4: GREKA U PODACIMA (LO CRC) 5: LOA DUINA STRUKTURE ZAHTEVA DRAJVERA UREAJA 6: GREKA PRI TRAENjU (SEEK) 7: NEPOZNATI TIP MEDIJA 8: SEKTOR NIJE PRONAEN 9: U TAMPACU NEMA PAPIRA 10: GREKA PRI PISANjU 11: GREKA PRI ITANjU 12: GENERALNI OTKAZ 13: NARUAVANjE RASPODELE 14: NARUAVANjE BLOKADE 15: NEVAECA PROMENA DISKA 16: FCB JE NEDOSTUPNA 17: PREKORAENjE ZAJEDNIKOG BAFERA 18: NEUSAGLAENOST KODNIH STRANA 19: NEDOVOLjNO ULAZA 20: NEDOVOLjNO DISK PROSTORA ================================================ FILE: strings/serbian.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Serbian / Yugoslavian # Codepage: 852 # Author: Dejan trbac (strbac@phreaker.net) # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH Nevaei prekida - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH Nevaei prekida - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION Loe formirana opcija: '%s' . :TEXT_ERROR_OPT_ARG Opcija '%s' ne moe imati argument. . :TEXT_ERROR_OPT_NOARG Opcija '%s' mora imati argument. . :TEXT_INVALID_NUMBER Nevaei broj naveden u '%s' . :TEXT_ERROR_CLOSE_QUOTE Nedostaje krajnji navodnik: %c . :TEXT_ERROR_TEMPFILE Privremeni fajl ne moe biti kreiran. . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Isuvie parametara - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Isuvie parametara. . :TEXT_ERROR_INVALID_PARAMETER Nevaei parametar - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Putanja nije pronaena. . :TEXT_ERROR_FILE_NOT_FOUND Fajl nije pronaen. . :TEXT_ERROR_SFILE_NOT_FOUND Fajl nije pronaen - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING Potreban parametar nedostaje. . :TEXT_ERROR_INVALID_DRIVE Nevaei drajv - %c: . :TEXT_ERROR_BADCOMMAND#2 Loa komanda ili naziv fajla - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Greka nedostatka memorije. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Alokacija DOS memorije nije uspela. . :TEXT_ERROR_CANNOTPIPE Nemogunost cevovoda! Privremeni fajl ne moe biti otvoren! . :TEXT_ERROR_LONG_LINE_BATCHFILE Linija #%ld u batch fajlu '%s' je preduga. . :TEXT_ERROR_BFILE_VANISHED Batch fajl '%s' nije pronaen. . :TEXT_ERROR_BFILE_LABEL Batch fajl '%s' ne sadri labelu '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s ne uspeva za '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR Promenljiva okruenja '%s' ne moe biti postavljena. Okruenje prepuno? . :TEXT_ERROR_ENV_VAR_NOT_FOUND Promenljiva okruenja '%s' nije pronaena. . :TEXT_ERROR_NO_ENVIRONMENT Nema okruenja. Mogui nedostatak memorije. Navedite /E opciju. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 Alias '%s' ne moe biti postavljen. Prostor za aliase prepun? . :TEXT_ERROR_ALIAS_NOT_FOUND#1 Alias '%s' nije pronaen. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Nema prostora za aliase. Mogui nedostatak memorije. . :TEXT_ERROR_SYNTAX_STR Sintaksna greka - '%s' . :TEXT_ERROR_SYNTAX Sintaksna greka. . :TEXT_ERROR_FILENAME_TOO_LONG Naziv fajla je predugaak - '%s' . :TEXT_ERROR_SELFCOPY Fajl '%s' ne moe biti kopiran u sebe. . :TEXT_ERROR_COMMAND_TOO_LONG Komandna linija je preduga posle razvijanja aliasa! . :TEXT_ERROR_LINE_TOO_LONG Linija je preduga. Komanda ne moe biti izvrena. . :TEXT_ERROR_HISTORY_SIZE#1 Nevaea veliina istorije - '%s' . :TEXT_HISTORY_EMPTY#1 Istorija komandne linije je prazna. . :TEXT_ERROR_BAD_MCB_CHAIN MCB lanac je oteen, ili MS-DOS nekompatibilan sistem. . :TEXT_ERROR_UNDEFINED_ERROR Nedefinisana greka %d. . :TEXT_ERROR_REGION_WARNING Nevaee memorijsko podruje %d - ignorisano. . :TEXT_ERROR_ON_OR_OFF Morate navesti ON ili OFF. . :TEXT_ERROR_BAD_VARIABLE Loe navedena promenljiva. . :TEXT_ERROR_IN_MISSING#1 FOR: nedostaje IN . :TEXT_ERROR_MISSING_PARENTHESES#1 Jedna ili obe zagrade nedostaju. . :TEXT_ERROR_DO_MISSING#1 FOR: nedostaje DO . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Nedostaje komanda posle DO iskaza. . :TEXT_ERROR_REDIRECT_FROM_FILE Ulaz ne moe biti preusmeren na fajl '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE Izlaz ne moe biti preusmeren na fajl '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Prazno preusmerenje. . :TEXT_ERROR_INVALID_DATE Nevaei datum. . :TEXT_ERROR_INVALID_TIME Nevaee vreme. . :TEXT_ERROR_NO_GOTO_LABEL Nema labele navedene za GOTO. . :TEXT_CTTY_NOTIMPLEMENTED Komanda CTTY je izostavljena iz ovog COMMAND.COMa. . :TEXT_ERROR_NORW_DEVICE Nevaei ili ne postojei uitno-upisni ureaj '%s'. . :TEXT_ERROR_CTTY_DUP Neuspeh pri promeni fajl deskriptora na TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED Prekida /L nije implementiran. . :TEXT_ERROR_U_NOTIMPLEMENTED Prekida /U nije implementiran. . :TEXT_ERROR_WRITING_DEST Greka pri upisu na odredite. . :TEXT_ERROR_CANNOT_OPEN_SOURCE Izvor nije mogao biti otvoren - '%s' . :TEXT_ERROR_OPEN_FILE Fajl '%s' nije mogao biti otvoren. . :TEXT_ERROR_READ_FILE Nemogunost itanja iz fajla: '%s' . :TEXT_ERROR_WRITE_FILE Nemogunost upisa u fajl: '%s' . :TEXT_ERROR_LEADING_PLUS Povezujui znak '+' ne moe voditi argumente. . :TEXT_ERROR_TRAILING_PLUS Povezujui znak '+' ne moe pratiti argumente. . :TEXT_ERROR_NOTHING_TO_DO Nema nieg da se uradi. . :TEXT_ERROR_COPY COPY komanda nije uspela. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: nedostaje naziv fajla . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: nedostaje broj . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: nevaei broj . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: nedostaje komanda . :TEXT_NOT_IMPLEMENTED_YET ao nam je. Nije implementirano. . :TEXT_FAILED_LOAD_STRINGS Neuspeh pri uitavanju poruka u memoriju. . :TEXT_MSG_NOTIMPLEMENTED Prekida /MSG nije implementiran. . :TEXT_MSG_ITEMS_DISPLAYED#1 Ukupno izlistano stavki: %u . :TEXT_CORRUPT_COMMAND_LINE Oteena komandna linija. Ovo je interna greka i povezana je sa sistemom u kome radi COMMAND.COM. Molimo vas prijavite ovu greku. . :TEXT_QUOTED_C_OR_K#1 Opcije /C i /K nemogu biti pod navodnicima, ignorisane. . :TEXT_INIT_FULLY_QUALIFIED#1 Putanja do COMMAND.COMa mora biti potpuna! Ovo znai ukljuujui slovo drajva poinjui obrnutom kosom crtom (\\). Na primer: C:\\ COMMAND.COM sada podrazumeva ovu putanju: %s . :TEXT_ERROR_RESTORE_SESSION Informacije o sesiji nisu mogle biti vraene. Sve lokalne postavke su izgubljene. Molimo vas pogledajte gore izjavljene poruke o grekama za mogui razlog nastanka ovog problema. . :TEXT_ERROR_SAVE_SESSION Trenutne informacije nemogu biti ouvane za vreme poziva programa. Molimo vas pogledajte gore izjavljene poruke o grekama za mogui razlog nastanka ovog problema. . :TEXT_ERROR_CWD_FAILED Drajv %c: ne reaguje ili nedostatak interne memorije. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swapping nije uspeo: Aliasi zauzimaju previe memorije. . :TEXT_ERROR_KSWAP_ALLOCMEM Swapping nije uspeo: Daleka memorija ne moe biti alocirana. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Nedostatak prostora za aliase. . :TEXT_ERROR_ALIAS_NO_SUCH#1 Alias '%s' ne postoji. . :TEXT_ERROR_ALIAS_INSERT#1 Greka pri umetanju aliasa. . :TEXT_ALIAS_INVALID_NAME#1 Nevaee ime aliasa '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Manipulator kritinih greaka ili kontekst modul ne moe biti uitan. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Nedostatak memorije za kontekst. Ako ova greka nastavi da se javlja, razmotrite poveanje internog bafera, kao istorije, steka direktorijuma itd. . :TEXT_ERROR_CONTEXT_LENGTH#1 Veliina konteksta prelazi maksimalni limit za %lu bajta. Promena veliine konteksta na %u bajta. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Neuspeh pri dodavanju statusnih informacija u kontekst. Ova greka moe znaiti oteenje memorije ili nepravilno utvrena minimalna veliina konteksta. . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Kontekst nedostaje posle swapa. Kontekst je rekreiran, ali su svi aliasi itd. izgubljeni. . # # Informational messages # :TEXT_MSG_PAUSE#1 Pritisnite bilo koji taster za nastavak...\ . :TEXT_MSG_HISTORY_SIZE Veliina istorije je %d bajta. . :TEXT_MSG_DOSKEY DOSKEY je ve omoguen interno u komandnoj ljusci. Pokrenite DOSKEY /? za vie informacija o implementaciji. . :TEXT_MSG_ECHO_STATE ECHO je %s . :TEXT_MSG_VERIFY_STATE VERIFY je %s . :TEXT_MSG_FDDEBUG_STATE DEBUG izlaz je %s . :TEXT_MSG_FDDEBUG_TARGET DEBUG izlaz se prikazuje na '%s' . :TEXT_MSG_BREAK_STATE BREAK je %s . :TEXT_MSG_CURRENT_DATE Trenutni datum je: %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Unesite novi datum (mm%sdd%s[vv]gg): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Unesite novi datum (dd%smm%s[vv]gg): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Unesite novi datum ([vv]gg%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME Trenutno vreme je: %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Unesite novo vreme: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 DdNn{CR}{LF}{CBREAK} aabb b b b Svi fajlovi u direktorijumu '%s' e biti obrisani! Da li ste sigurni (Da/Ne)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 DdNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [ENTER=Da, ESC=Ne]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 DdNnSs{LF}{CR}{CBREAK}{ESC} aabbcc a a c b Control-Break pritisnuto.\r Prekinuti batch fajl '%s' (Da/Ne/Sve)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 DdNnSsOo{BREAK}{ENTER}{ESC} aabbccdd d a b Pisati preko '%s' (Da/Ne/Svi/Otkaz)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 DdNnSsOo{BREAK}{ENTER}{ESC} aabbccdd d a b Obrisati '%s' (Da/Ne/Svi/Otkaz)? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Stek direktorijuma je prazan. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 Volumen u drajvu %c \ . :TEXT_DIR_HDR_VOLUME_STRING je %s . :TEXT_DIR_HDR_VOLUME_NONE nema labele . :TEXT_DIR_HDR_SERIAL_NUMBER Serijski broj volumena je %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s fajl(a)\ . :TEXT_DIR_FTR_BYTES %12s bajta . :TEXT_DIR_FTR_TOTAL_NUMBER Ukupno prikazano: . :TEXT_DIR_FTR_DIRS#1 %10s dir(a)\ . :TEXT_DIR_FTR_BYTES_FREE %15s bajta slobodno . :TEXT_DIR_DIRECTORY Direktorijum %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Direktorijum %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH PATH=%s . :TEXT_MSG_PATH_NONE#1 Putanja nije definisana. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Ned\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Pon\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Uto\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Sre\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 et\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Pet\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sub\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 Nijedan fajl nije izbrisan. . :TEXT_MSG_DEL_CNT_FILES_1#1 Jedan fajl izbrisan. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u fajla izbrisano. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Dostupne interne komande: . :TEXT_MSG_SHOWCMD_FEATURES Missing: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 Missing \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 Missing \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 Missing \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 Missing \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 Missing \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 Missing \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 Missing \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 Missing \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 Missing \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 Missing \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 Missing \ . :TEXT_SHOWCMD_FEATURE_NLS#1 Missing \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 Missing \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 Missing \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pritisnite F8 za mod pracenja, ili F5 za preskakanje %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC Preskakanje preko '%s' . :TEXT_MSG_VER_DOS_VERSION DOS verzija %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS jezgro (gradnja 1933 ili ranija) . :TEXT_MSG_VER_LATER_FREEDOS FreeDOS jezgro %d.%d.%d . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Ljuska e sada biti prekinuta, iako je ovo zabranjeno\r (obino navoenjem prekidaa "/P").\r Morate restartovati sistem ili, ukoliko ova ljuska radi u\r vieprocesnom okruenju, prekinuti ovaj proces.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Izvrsni fajl komandne ljuske nije pronadjen. Morate navesti potpunu putanju do COMMAND.COMa kao prvi argument COMMANDa, na primer: C:\\ . :TEXT_MEMORY_ENVIRONMENT#1 NA %5u %5u . :TEXT_MEMORY_CONTEXT#1 NA %5u %5u . :TEXT_MEMORY_HEAP#1 NA %5lu . :TEXT_MEMORY_CTXT_ALIAS#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_HISTORY#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_DIRSTACK#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_LASTDIR#1 NA %5u %5u . :TEXT_MEMORY_CTXT_BATCH#1 NA %5u %5u . :TEXT_MEMORY_CTXT_SWAPINFO#1 NA %5u %5u . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Neuspeh pri dobavljanju trenutne kodne strane iz sistema. . :TEXT_ERROR_SET_CODEPAGE#1 Neuspeh pri promeni trenutne kodne strane. . :TEXT_DISPLAY_CODEPAGE#1 Trenutna kodna strana je: %u. Sistemska kodna strana (pravilno) je: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Prikazuje, postavlja, ili uklanja aliase. ALIAS [promenljiva[=][string]] promenljiva Navodi ime aliasa. string Navodi niz karaktera za dodelu aliasu. Pokrenite ALIAS bez parametara za prikaz trenutnih aliasa. Ukoliko string nije naveden, postojei alias se uklanja. . :TEXT_CMDHELP_BEEP Stvara kratak zvuk upozorenja. BEEP . :TEXT_CMDHELP_BREAK Postavlja ili uklanja proirenu CTRL+C proveru. BREAK [ON | OFF] Pokrenite BREAK bez parametara za prikaz trenutne postavke. . :TEXT_CMDHELP_CALL#1 Poziva jedan batch program iz drugog. CALL [/S | /N] [/Y] [drajv:][putanja]fajl [batch-parametri] batch-parametri Navodi informacije sa komandne linije potrebne batch programu. /S ukljuuje dok /N iskljuuje swapping komandne ljuske. /Y omoguava mod praenja prilikom izvrenja komande. . :TEXT_CMDHELP_CD Prikazuje naziv ili menja trenutni direktorijum. CHDIR [drajv:][putanja] CHDIR[..] CD [drajv:][putanja] CD[..] CD - ".." Navodi da elite da promenite direktorijum u roditeljski trenutnog. "-" Vraa se u prethodni direktorijum. Pokrenite "CD drajv:" za prikaz trenutnog dira na navedenom drajvu. Pokrenite CD bez parametara za prikaz trenutnog drajva i direktorijuma. Takoe pogledajte komandu CDD. . :TEXT_CMDHELP_CDD Prikazuje trenutni direktorijum ili menja trenutni direktorijum i drajv. CDD [drajv:][putanja] CDD[..] CDD - ".." Navodi da elite da promenite direktorijum u roditeljski trenutnog. "-" Vraa se u prethodni direktorijum. Ako je "drajv:" naveden, trenutni radni drajv se menja na navedeni. Ovo je jedina razlika u odnosu na "CD" odnosno "CHDIR". Pokrenite CDD bez parametara za prikaz trenutnog drajva i direktorijuma. . :TEXT_CMDHELP_CHCP Prikazuje ili postavlja broj aktivne kodne strane. CHCP [nnn] nnn Navodi broj kodne strane. Pokrenite CHCP bez parametara za prikaz aktivne kodne strane. . :TEXT_CMDHELP_CLS Brie ekran i postavlja standardne atribute boja. CLS . :TEXT_CMDHELP_COMMAND Pokree novu instancu komandne ljuske. COMMAND [[drajv:]putanja] [ureaj] [/E:nnnnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] komanda]] [drajv:]putanja Navodi direktorijum koji sadri COMMAND.COM. ureaj Navodi ureaj za komandni ulaz/izlaz. /E:nnnnn Postavlja poetnu veliinu okruenja na nnnnn bajta. (nnnnn treba biti broj izmeu 256 i 32,768). /P Postavlja novu komandnu ljusku za stalnu (nema izlaza). /LOW Primorava komandnu ljusku da dri svoje stalne podatke u niskoj memoriji. /MSG Uitava sve sistemske poruke u memoriju (zahteva i /P). /Y Koraa kroz batch program naveden sa /C ili /K. /C komanda Izvrava navedenu komandu i vraa se u trenutnu ljusku. /K komanda Izvrava navedenu komandu i nastavlja rad. . :TEXT_CMDHELP_COPY Kopira jedan ili vie fajlova na drugu lokaciju. COPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]] [odredite [/A | /B]] [/V] [/Y | /-Y] izvor Navodi fajl ili fajlove koje treba prekopirati. /A Nagoveta ASCII tekstualni fajl. /B Nagoveta binarni fajl. odredite Navodi direktorijum i/ili naziv fajla za novi(e) fajl(ove). /V Proverava korektnost upisa novih fajlova. /Y Priguava upite za pisanje preko ve postojeih fajlova u odreditu, odgovarajui potvrdno. /-Y Poziva upit za potvrdu pisanja preko ve postojeih fajlova u odreditu. Prekida /Y moe biti naveden u COPYCMD promenljivi okruenja. Ovo moe biti poniteno sa /-Y na komandnoj liniji. Za spajanje fajlova, navedite jedan fajl za odredite, ali vie fajlova za izvor (koriscenjem doker znakova ili fajl1+fajl2+fajl3 formatom). . :TEXT_CMDHELP_CTTY Menja terminalni ureaj korien za kontrolu sistema. CTTY ureaj ureaj Terminalni ureaj koji elite koristiti, kao npr. COM1. . :TEXT_CMDHELP_DATE#1 Prikazuje ili postavlja datum. DATE [/D] [datum] /D odvraa DATE od interaktivnosti. Pokrenite DATE bez parametara za prikaz trenutne postavke datuma i upit za novu. Pritisnite ENTER da zadrite isti datum. . :TEXT_CMDHELP_DEL#2 Brie jedan ili vie fajlova. DEL [drajv:][putanja]fajl [/P] [/V] ERASE [drajv:][putanja]fajl [/P] [/V] [drajv:][putanja]fajl Navodi fajl(ove) za brisanje. Navedite vie fajlova koristei se doker znacima. /P Poziva upit za potvrdu pre brisanja svakog fajla pojedinano. /V Prikazuje sve izbrisane fajlove. . :TEXT_CMDHELP_DIR#4 Prikazuje listu fajlova i pod-direktorijuma u direktorijumu. DIR [drajv:][putanja][fajl] [/P] [/W] [/A[[:]atributi]] [/O[[:]nain]] [/S] [/B] [/L] [/[Y|4]] [drajv:][putanja][fajl] Navodi drajv, direktorijum, i/ili fajlove za listanje. (Moe biti sloena ili viestruka specififikacija fajlova) /A Prikazuje fajlove sa navedenim atributima. (Podraz. /ADHSRA) atributi D Direktorijumi R Read-only (samo za itanje) H Hidden (sakriveni) A Spremni za arhiviranje S Sistemski fajlovi - Prefiks negacije /O Prikazuje fajlove sortirane na navedeni nain. (Podraz. /ONG) nain N Po nazivu S Po veliini E Po ekstenziji D Po datumu i vremenu G Grupie direktorijume - Prefiks inverznog redosleda U Nesortirano /P Pauzira posle svakog punog ekrana informacija. /W Koristi format irokog listanja. /S Prikazuje fajlove u navedenom diru i svim pod-direktorijumima. /B Koristi ogoljeni format (bez zaglavlja i statistike). /L Koristi mala slova. /Y,/4 Prikazuje godinu sa 4 cifre. Prekidai mogu biti navedeni u DIRCMD promenljivi okruenja. Ponitite ve navedene prekidae postavljanjem prefiksa "-". Na primer: /-W. . :TEXT_CMDHELP_DOSKEY#1 DOSKEY je omoguen interno u komandnoj ljusci. Ŀ Taster Funkcija Ŀ Gore/Dole Poziva istoriju. Levo/Desno Navigacija kroz komandnu liniju i/ili dopunjavanje trenutne linije prethodno pozvanom komandom. Home/End Poetak/kraj linije. Insert Promena izmeu moda umetanja i pisanja preko. Tab Dopunjavanje trenutne rei kao naziv fajla. Dvostruki pritisak e prikazati sve odgovarajue fajlove. Komanda HISTORY e prikazati sadraj bafera istorije. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 NA %1 %9 . :TEXT_CMDHELP_ECHO Prikazuje poruke, ili postavlja-uklanja odjek komandi. ECHO [ON | OFF] ECHO [poruka] ECHO. Pokrenite ECHO bez parametara za prikaz trenutne postavke. "ECHO." e ispisati praznu liniju na ekran. . :TEXT_CMDHELP_EXIT Naputa trenutno aktivnu komandnu ljusku. EXIT . :TEXT_CMDHELP_FOR Pokree navedenu komandu za svaki fajl iz navedenog skupa fajlova. FOR %%varijabla IN (skup) DO komanda [parametri] %%varijabla Navodi zamenljivi parametar. (skup) Navodi skup od jednog ili vie fajlova. Doker znaci su dozvoljeni. komanda Navodi komandu za izvrenje nad svakim fajlom iz skupa. parametri Navodi parametre navedene komande. U batch programima, koristite %%%%varijabla umesto %%varijabla. . :TEXT_CMDHELP_GOTO Upuuje komandnu ljusku na liniju odreenu labelom u batch programu. GOTO labela labela Navodi labelu definisanu u trenutnom batch programu. Labelu piete samu na liniji, poinjui dvotakom. . :TEXT_CMDHELP_HISTORY#1 Prikazuje trenutni sadraj bafera istorije. HISTORY . :TEXT_CMDHELP_IF Vri uslovno procesiranje u batch programima. IF [NOT] ERRORLEVEL broj komanda IF [NOT] string1==string2 komanda IF [NOT] EXIST fajl komanda NOT Navodi da komandna ljuska treba da izvri komandu samo ukoliko je uslov netaan. Negacija uslova. ERRORLEVEL broj Vraa TANO ukoliko je prethodno pokrenuti program vratio izlazni kod jednak ili vei od navedenog broja. komanda Navodi komandu koja se treba izvriti ukoliko je uslov zadovoljen. string1==string2 Vraa TANO ukoliko su nizovi znakova jednaki. EXIST fajl Vraa TANO ukoliko fajl sa navedenim imenom postoji. . :TEXT_CMDHELP_LH Uitava program u gornje memorijsko podruje. LOADHIGH [drajv:][putanja]fajl [parametri] LOADHIGH [/L:podruje1[,min_vel1][;podruje2[,min_vel2]...] [/S]] [drajv:][putanja]fajl [parametri] /L:podruje1[,min_vel1][;podruje2[,min_vel2]... Navodi podruje(a) memorije u koje treba uitati program. - podruje1 navodi broj prvog memorijskog podruja. - min_vel1 navodi minimalnu veliinu, ako postoji, za podruje1. - podruje2 navodi broj drugog memorijskog podruja. - min_vel2 navodi minimalnu veliinu, ako postoji, za podruje2. Moete navesti koliko god elite memorijskih podruja. /S Smanjuje UMB do svoje minimalne veliine dok se program uitava. [drajv:][putanja]fajl Navodi lokaciju i naziv programa koji treba uitati. parametri Parametri programa koji se uitava. . :TEXT_CMDHELP_LOADFIX Uitava program iznad prvih 64K memorije i pokree program. LOADFIX [drajv:][putanja]fajl Upotrebite LOADFIX za uitavanje programa ukoliko ste dobili poruku "Packed file corrupt" pri pokuaju uitavanja u nisku memoriju. . :TEXT_CMDHELP_MD Kreira novi direktorijum. MKDIR [drajv:]putanja MD [drajv:]putanja . :TEXT_CMDHELP_PATH Prikazuje ili postavlja putanju za traenje izvrnih fajlova. PATH [[drajv:]putanja[;...]] PATH ; Pokrenite "PATH ;" za brisanje svih putanja i usmerenje komandne ljuske na traenje izvrnih fajlova samo u trenutnom direktorijumu. Pokrenite PATH bez parametara za prikaz trenutne vrednosti. . :TEXT_CMDHELP_PAUSE Zaustavlja procesiranje batch programa i prikazuje poruku: "Pritisnite bilo koji taster za nastavak..." ili navedenu poruku. PAUSE [poruka] . :TEXT_CMDHELP_PROMPT Menja odziv komandnog prompta. PROMPT [tekst] tekst Navodi novi komandni prompt Prompt moe biti sastavljen od znakova i sledeih specijalnih kodova: $Q = (znak za jednako) $$ $ (znak za dolar) $T Trenutno vreme $D Trenutni datum $P Trenutni drajv i putanja $V Verzija komandne ljuske $N Trenutni drajv $G > (znak za vee-od) $L < (znak za manje-od) $B | (znak za cev) $H Backspace (brie prethodni znak) $E Escape kod (ASCII kod 27) $_ CR i LF kodovi (nova linija) Pokrenite PROMPT bez parametara za reset prompta na standardnu postavku. . :TEXT_CMDHELP_PUSHD Gura trenutni direktorijum na vrh steka direktorijuma, uz opciju da promeni trenutni radni direktorijum. PUSHD [[drajv:]putanja] Gde je [drajv:]putanja nova putanja koju elite. . :TEXT_CMDHELP_POPD Skida direktorijum sa vrha steka direktorijuma, i postavlja ga za radni. POPD [*] Opcija '*' brie sadraj steka direktorijuma. . :TEXT_CMDHELP_DIRS Prikazuje sadraj steka direktorijuma. DIRS . :TEXT_CMDHELP_RD Uklanja (brie) direktorijum. RMDIR [drajv:]putanja RD [drajv:]putanja . :TEXT_CMDHELP_REM Obeleava komentar (napomenu) u batch fajlu ili CONFIG.SYSu. REM [komentar] . :TEXT_CMDHELP_REN Menja naziv fajlu ili direktorijumu. RENAME [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2] REN [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2] Doker znaci nisu dozvoljeni. Primetite da ne moete navesti novi drajv ili putanju za odredite. U tu svrhu upotrebite eksternu komandu MOVE. . :TEXT_CMDHELP_SET#1 Prikazuje, postavlja, ili uklanja promenljive okruenja. SET [/C] [/P] [promenljiva=[string]] promenljiva Navodi ime promenljive okruenja. string Navodi niz znakova za dodelu promenljivoj. Ukoliko string nije naveden, promenljiva se uklanja iz okruenja. Pokrenite SET bez parametara za prikaz trenutnih promenljivi okruenja. /C Prisiljava zadravanje navedene veliine slova promenljive. /P Poziva upit sa stringom i dodeljuje korisniki unos promenljivoj. Promenljiva se standardno menja u velika slova, ukoliko se ve ne nalazi u okruenju, inae se navedena veliina slova zadrava. . :TEXT_CMDHELP_SHIFT#1 Menja poziciju zamenljivih parametara u batch fajlu. SHIFT [DOWN] DOWN pomera prozor argumenata prema poetku (%%0). U ostalim sluajevima pomera isti prema kraju. . :TEXT_CMDHELP_TIME#1 Prikazuje ili postavlja sistemsko vreme. TIME [/T] [vreme] /T odvraa TIME od interaktivnosti. Pokrenite TIME bez parametara za prikaz trenutne postavke vremena i upit za novu. Pritisnite ENTER da sauvate isto vreme. . :TEXT_CMDHELP_TRUENAME Prikazuje punu putanju trenutne ili navedene putanje. TRUENAME [[drajv:][putanja][fajl]] . :TEXT_CMDHELP_TYPE Prikazuje sadraj tekstualnih fajlova. TYPE [drajv:][putanja]fajl . :TEXT_CMDHELP_VER Prikazuje verziju komandne ljuske i ostale informacije. VER [/R] [/W] [/D] [/C] /R Verzija jezgra i ostale informacije. /W Garancija komandne ljuske. /D Informacije o pravilima redistribuiranja. /C Imena saradnika. . :TEXT_CMDHELP_VERIFY Postavlja ili uklanja dodatne provere korektnosti upisa fajlova na disk. VERIFY [ON | OFF] Pokrenite VERIFY bez parametara za prikaz trenutne postavke. . :TEXT_CMDHELP_FDDEBUG NA . :TEXT_CMDHELP_VOL Prikazuje labelu volumena i serijski broj, ukoliko isti postoje. VOL [drajv:] . :TEXT_CMDHELP_QUESTION#1 Prikazuje listu komandi i osobina dostupnih u ljusci. ? ?komanda [argument] Prva varijanta prikazuje dostupne komande i osobine ljuske. Druga varijanta e izneti upit da li se navedena komanda treba izvriti, kao da je mod praenja aktivan. . :TEXT_CMDHELP_WHICH Trai i prikazuje izvrne fajlove za svaku navedenu komandu. WHICH {komanda} . :TEXT_CMDHELP_MEMORY#1 NA . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 Odredite COPY ne sme sadrati plus ('+') znakove. . :TEXT_DELETE_FILE#1 Brisanje fajla "%s". . ================================================ FILE: strings/slovene.err ================================================ # $Id$ # # Critical error national customization file # # Language: Slovene # Codepage: 852 # Author: Matej Horvat (http://matejhorvat.si/) # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Napaka pri %1 pogona %A: obmoje %2: %3 S3 CHAR_DEVICE: Napaka pri %1 naprave %A: %3 ## kind of operation S0 READ: branju S1 WRITE: pisanju ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: korena S7 DATA: podatkov ## action strings S8 IGNORE: (P)rezri S9 RETRY: (Z)nova S10 ABORT: (O)pusti S11 FAIL: (S)podleti ## keys associated with the actions S14 (compacted) KEYS_IGNORE: pP KEYS_RETRY: zZ KEYS_ABORT: oO KEYS_FAIL: sS ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Neznana koda napake S15 0: poskus prekritve zaite pred pisanjem 1: neznana enota za gonilnik 2: pogon ni pripravljen 3: gonilnik je prejel neznan ukaz 4: podatkovna napaka (napaen CRC) 5: napana dolina strukture zahteve za gonilnik 6: napaka pri iskanju 7: neznana vrsta medija 8: sektorja ni mogoe najti 9: tiskalnik nima papirja 10: napaka pri pisanju 11: napaka pri branju 12: splona napaka 13: prekritev deljenja 14: prekritev zaklepa 15: neveljavna zamenjava diskete 16: FCB ni na voljo 17: medpomnilnik za deljenje prepoln 18: neujemanje kodiranj 19: ni ve vhoda 20: ni dovolj prostora na disku ================================================ FILE: strings/slovene.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Slovene # Codepage: 852 # Author: Matej Horvat (http://matejhorvat.si/) # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Neveljavna monost /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Neveljavna monost /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Nepravilno oblikovana monost "%s" . :TEXT_ERROR_OPT_ARG#0% Monost "%s" ne more imeti argumenta . :TEXT_ERROR_OPT_NOARG#0% Monost "%s" mora imeti argument . :TEXT_INVALID_NUMBER#0% Neveljavna tevilka v monosti "%s" . :TEXT_ERROR_CLOSE_QUOTE#0% Manjka konni narekovaj: %c . :TEXT_ERROR_TEMPFILE Ni mogoe ustvariti zaasne datoteke . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% Preve parametrov: %s . :TEXT_ERROR_TOO_MANY_PARAMETERS Preve parametrov. . :TEXT_ERROR_INVALID_PARAMETER#0% Neveljaven parameter: %s . :TEXT_ERROR_PATH_NOT_FOUND Poti ni mogoe najti. . :TEXT_ERROR_FILE_NOT_FOUND Datoteke ni mogoe najti. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Datoteke ni mogoe najti: %s . :TEXT_ERROR_REQ_PARAM_MISSING#0% Zahtevan parameter manjka. . :TEXT_ERROR_INVALID_DRIVE#0% Neveljaven pogon %c:. . :TEXT_ERROR_BADCOMMAND#2% Neveljaven ukaz ali datoteka: %s . :TEXT_ERROR_OUT_OF_MEMORY Ni dovolj spomina. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Ni mogoe dodeliti spomina za DOS. . :TEXT_ERROR_CANNOTPIPE Ni mogoe preusmerjati izhoda; ni mogoe odpreti zaasne datoteke. . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% Vrstica %ld v datoteki %s je predolga. . :TEXT_ERROR_BFILE_VANISHED#0% Ukazne datoteke "%s" ni mogoe najti. . :TEXT_ERROR_BFILE_LABEL#0% Ukazna datoteka %s ne vsebuje oznake %s. . :TEXT_ERROR_DIRFCT_FAILED#1% %s ni uspel za "%s". . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% Ni mogoe nastaviti okoljske spremenljivke %s. Je okolje polno? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% Okoljske spremenljivke %s ni mogoe najti. . :TEXT_ERROR_NO_ENVIRONMENT Ni okolja. Morda ni dovolj spomina. Uporabite monost /E. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% Ni mogoe nastaviti sopomenke "%s". Je spomin za sopomenke poln? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% Sopomenke "%s" ni mogoe najti. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Ni prostora za sopomenke. Morda ni dovolj spomina. . :TEXT_ERROR_SYNTAX_STR#0% Sintaktina napaka: %s . :TEXT_ERROR_SYNTAX Sintaktina napaka. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Predolgo ime datoteke: %s . :TEXT_ERROR_SELFCOPY#0% Datoteke %s ni mogoe kopirati nase. . :TEXT_ERROR_COMMAND_TOO_LONG Ukazna vrstica je zaradi raziritve sopomenk postala predolga! . :TEXT_ERROR_LINE_TOO_LONG Ukazna vrstica je dalja od 125 znakov. . :TEXT_ERROR_HISTORY_SIZE#1% Neveljavna velikost zgodovine: %s . :TEXT_HISTORY_EMPTY#1 Zgodovina je prazna. . :TEXT_ERROR_BAD_MCB_CHAIN Veriga MCB je pokodovana ali pa sistem ni zdruljiv z MS-DOS. . :TEXT_ERROR_UNDEFINED_ERROR#0% Nedefinirana napaka %d. . :TEXT_ERROR_REGION_WARNING#0% Illegal memory region %d - ignored. . :TEXT_ERROR_ON_OR_OFF Treba je doloiti ON ali OFF. . :TEXT_ERROR_BAD_VARIABLE Neveljavna specifikacija spremenljivke. . :TEXT_ERROR_IN_MISSING#1 IN manjka v ukazu FOR. . :TEXT_ERROR_MISSING_PARENTHESES#1 En ali ve oklepajev manjka. . :TEXT_ERROR_DO_MISSING#1 DO manjka v ukazu FOR. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 Besedi DO v ukazu FOR ne sledi ukaz. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% Ni mogoe preusmeriti vhoda iz datoteke %s. . :TEXT_ERROR_REDIRECT_TO_FILE#0% Ni mogoe preusmeriti izhoda v datoteko %s. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Prazna preusmeritev. . :TEXT_ERROR_INVALID_DATE Neveljaven datum. . :TEXT_ERROR_INVALID_TIME Neveljaven as. . :TEXT_ERROR_NO_GOTO_LABEL Ni doloene oznake za GOTO. . :TEXT_CTTY_NOTIMPLEMENTED Ta COMMAND.COM ne vsebuje ukaza CTTY. . :TEXT_ERROR_NORW_DEVICE#0% Naprava "%" ni veljavna ali pa ne omogoa branja in pisanja. . :TEXT_ERROR_CTTY_DUP#0% Failed to change file descriptors to TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L e ni podprt. . :TEXT_ERROR_U_NOTIMPLEMENTED /U e ni podprt. . :TEXT_ERROR_WRITING_DEST Napaka pri pisanju na cilj. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Ni mogoe odpreti izvora: %s . :TEXT_ERROR_OPEN_FILE#0% Ni mogoe odpreti datoteke "%s" . :TEXT_ERROR_READ_FILE#0% Ni mogoe brati iz datoteke "%s" . :TEXT_ERROR_WRITE_FILE#0% Ni mogoe pisati v datoteko "%s" . :TEXT_ERROR_LEADING_PLUS Znak za zdruevanje, "+", ne more stati pred datotekami. . :TEXT_ERROR_TRAILING_PLUS Znak za zdruevanje, "+", ne more slediti datotekam. . :TEXT_ERROR_NOTHING_TO_DO Ni za postoriti. . :TEXT_ERROR_COPY COPY ni uspel . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: manjka ime datoteke . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: manjka tevilo . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: neveljavno tevilo . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: manjka ukaz . :TEXT_NOT_IMPLEMENTED_YET Ta funkcija e ni podprta. . :TEXT_FAILED_LOAD_STRINGS Ni bilo mogoe naloiti sporoil v spomin. . :TEXT_MSG_NOTIMPLEMENTED Ta COMMAND.COM ne vsebuje monosti /MSG. . :TEXT_MSG_ITEMS_DISPLAYED#1% Prikazanih %u elementov. . :TEXT_CORRUPT_COMMAND_LINE Pokodovana ukazna vrstica. To je notranja napaka in je povezana s sistemom, v katerem se izvaja COMMAND.COM. Prosimo, da to napako sporoite. . :TEXT_QUOTED_C_OR_K#1 Monosti /C in /K ni mogoe citirati, ker se ne upotevata. . :TEXT_INIT_FULLY_QUALIFIED#1% Pot do COMMAND.COM mora biti absolutna! To pomeni, da mora vsebovati rko pogona, ki ji sledi "\\". Primer: C:\\FDOS COMMAND.COM trenutno uporablja to pot: %s . :TEXT_ERROR_RESTORE_SESSION The session information could not be restored, any local settings are lost. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_SAVE_SESSION The current information cannot be preserved during the call of the program. Please refer to above error messages for the reason of this problem. . :TEXT_ERROR_CWD_FAILED#1% Pogon %c: se ne odziva. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Izmenjava ni uspela: sopomenke zavzemajo preve spomina. . :TEXT_ERROR_KSWAP_ALLOCMEM Izmenjava ni uspela: ni mogoe dodeliti oddaljenega spomina. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Ni ve prostora za sopomenke. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Sopomenka "%s" ne obstaja. . :TEXT_ERROR_ALIAS_INSERT#1 Ni bilo mogoe vstaviti sopomenke. . :TEXT_ALIAS_INVALID_NAME#1% Neveljavno ime sopomenke "%s". . :TEXT_ERROR_LOADING_CONTEXT#1 Cannot load Context module or Critical Error handler. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Context out of memory. If this error persists, consider to increase some internal buffer, such as history, direcory stack etc. . :TEXT_ERROR_CONTEXT_LENGTH#1% Velikost konteksta znaa %lu bajtov, kar je veje od omejitve. Spremenjena bo na %u bajtov. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Failed to add status information into context. This error may indicate memory corruption or an incorrectly determined minimum size of the context. Please inform the maintainer of FreeCOM at: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Kontekst je ob izmenjavi izginil. Bil je ponovno ustvarjen, toda vse sopomenke itd. so izgubljene. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: dostop zavrnjen . :TEXT_ERROR_NO_SUCH_FILE#1% %s: datoteka ali imenik ne obstaja . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: neznana napaka . # # Informational messages # :TEXT_MSG_PAUSE#1 Pritisnite katerokoli tipko\ . :TEXT_MSG_HISTORY_SIZE#0% Velikost zgodovine je %d bajtov. . :TEXT_MSG_DOSKEY Funkcije DOSKEY so e omogoene. . :TEXT_MSG_ECHO_STATE#0% ECHO je %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY je %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG output is %s. . :TEXT_MSG_FDDEBUG_TARGET#0% DEBUG output is printed to '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK je %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR je %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN Complete is %s . :TEXT_MSG_CURRENT_DATE#0% Trenutni datum je %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Vnesite nov datum (mm%sdd%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Vnesite nov datum (dd%smm%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Vnesite nov datum ([cc]yy%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME#0% Trenutni as je %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Vnesite nov as: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% DdNn{CR}{LF}{CBREAK} aabb b b b Vse datoteke v imeniku "%s" bodo izbrisane. Ste prepriani (D/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 DdNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Da=ENTER, Ne=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% DdNnVvQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Ctrl+Break pritisnjen.\r Prehenam izvajati "%s" (Da/Ne/Vsi)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% DdNnVvPp{BREAK}{ENTER}{ESC} aabbccdd d a b Naj zamenjam "%s" (Da/Ne/Vse/Prekini)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% DdNnVvPp{BREAK}{ENTER}{ESC} aabbccdd d a b Append to '%s' (Da/Ne/Vse/Prekini) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% DdNnVvPp{BREAK}{ENTER}{ESC} aabbccdd d a b Naj izbriem "%s" (Da/Ne/Vse/Prekini)? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Imeniki sklad je prazen. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% Nosilec na pogonu %c \ . :TEXT_DIR_HDR_VOLUME_STRING#0% je %s . :TEXT_DIR_HDR_VOLUME_NONE nima oznake . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Serijska tevilka nosilca je %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s datotek\ . :TEXT_DIR_FTR_BYTES#0% %12s bajtov . :TEXT_DIR_FTR_TOTAL_NUMBER tevilo izpisanih datotek: . :TEXT_DIR_FTR_DIRS#1% %10s imenikov\ . :TEXT_DIR_FTR_BYTES_FREE#0% %13s bajtov prostih . :TEXT_DIR_DIRECTORY#0% Imenik %s . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% Imenik %s . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Pot iskanja ni definirana. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 ned\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 pon\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 tor\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 sre\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 et\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 pet\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 sob\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 0 datotek odstranjenih. . :TEXT_MSG_DEL_CNT_FILES_1#1 1 datoteka odstranjena. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u datotek odstranjenih. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Vgrajeni ukazi: . :TEXT_MSG_SHOWCMD_FEATURES Funkcije, ki so na voljo: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [sopomenke] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [izboljan vnos] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [zgodovina] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [dokonavanje imen datotek] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [izmenjava] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start logging] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [prejnji imenik] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [dolga imena datotek] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [izmenjava z jedrom] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS izmenjava] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [default to swap] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [namestljivi ukazi] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [imeniki sklad (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [razhroevanje FreeCOMa] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pritisnite F8 za nain sledenja ali F5 za preskoitev %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% Preskakujem %s. . :TEXT_MSG_VER_DOS_VERSION#0% DOS verzija %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Jedro FreeDOS (izgradnja 1933 ali stareja) . :TEXT_MSG_VER_LATER_FREEDOS#0% Jedro FreeDOS, verzija %d.%d.%d . :TEXT_MSG_VER_WARRANTY (C) 1994-2005 Tim Norman in drugi. Ta program je razpeavan v upanju, da bo komu uporaben, toda BREZ KAKRNEGAKOLI JAMSTVA; cel brez jamstva PRODAJNOSTI ali PRIMERNOSTI ZA KATERIKOLI NAMEN. Za ve podrobnosti glejte Splono dovoljenje GNU (GNU GPL). Poroajte o hroih na freedos-devel@lists.sourceforge.net. Posodobitve so na voljo na http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION (C) 1994-2005 Tim Norman in drugi. To je prosta programska oprema; razpeavate in/ali spreminjate jo lahko pod pogoji, navedenimi v Splonem dovoljenju GNU (GNU GPL), ki ga je izdala organizacija Free Software Corporation; slediti morate pogojem verzije 2 ali noveje. Poroajte o hroih na freedos-devel@lists.sourceforge.net. Posodobitve so na voljo na http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS FreeCOM, FreeDOSovo ukazno lupino, razvija veliko ljudi; glejte priloeno datoteko HISTORY.TXT. Poroajte o hroih na freedos-devel@lists.sourceforge.net. Posodobitve so na voljo na http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r The shell is about to be terminated, though, this is\r forbidden (usually by enabling the "/P" option).\r You must reboot the system or, if this shell runs in\r a multitasking environment, terminate this process/task manually.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM executable not found. You must specify the complete path to COMMAND.COM as the first argument of COMMAND, for instance: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Okoljski segment: omejitev %5u bajtov; %5u bajtov prostih . :TEXT_MEMORY_CONTEXT#1% Segment konteksta: omejitev %5u bajtov; %5u bajtov prostih . :TEXT_MEMORY_HEAP#1% Heap: %5lu bajtov prostih . :TEXT_MEMORY_CTXT_ALIAS#1% \tSopomenke: omejitev %5u bajtov, trenutno %5u, %5u elementov . :TEXT_MEMORY_CTXT_HISTORY#1% \tZgodovina: omejitev %5u bajtov, trenutno %5u, %5u elementov . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tImeniki sklad: omejitev %5u bajtov, trenutno %5u, %5u elementov . :TEXT_MEMORY_CTXT_LASTDIR#1% \tPrejnji imenik: porabljenih %5u bajtov, %5u elementov . :TEXT_MEMORY_CTXT_BATCH#1% \tBatch nesting : porabljenih %5u bajtov, %5u elementov . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tSwapinfo : porabljenih %5u bajtov, %5u elementov . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Ni mogoe dobiti podatka o trenutno izbranem kodiranju. . :TEXT_ERROR_SET_CODEPAGE#1 Ni mogoe zamenjati kodiranja. . :TEXT_DISPLAY_CODEPAGE#1% Trenutno izbrano kodiranje je %u. The system codepage (properly) is: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Prikae, nastavlja, ali odstranjuje sopomenke. ALIAS [sopomenka[=][definicija]] sopomenka Doloi ime sopomenke. definicija Doloi niz znakov, v katere bo sopomenka razirjena. Vnesite ALIAS brez parametrov, da vidite trenutno definirane sopomenke. . :TEXT_CMDHELP_BEEP Zapiska. BEEP . :TEXT_CMDHELP_BREAK Sets or clears extended CTRL+C checking. BREAK [ON | OFF] Type BREAK without a parameter to display the current BREAK setting. . :TEXT_CMDHELP_CALL#1 Calls one batch program from another. CALL [/S | /N] [/Y] [pogon:][pot]datoteka [batch-parameters] batch-parameters Specifies any command-line information required by the batch program. /S enforces, /N denies swapping of FreeCOM. /Y enables tracemode during execution of the command. . :TEXT_CMDHELP_CD Prikae ime trenutnega imenika ali pa ga spremeni. CHDIR [pogon:][pot] CHDIR[..] CD [pogon:][pot] CD[..] CD - .. Gre v nadrejeni imenik. - Gre v prejnji imenik, e je ta funkcija omogoena. Vnesite CD pogon:, da vidite trenutni imenik doloenega pogona. Vnesite CD brez parametrov, da vidite trenutni pogon in imenik. Glej tudi: CDD . :TEXT_CMDHELP_CDD Prikae ime trenutnega pogona in imenika ali pa ju spremeni. CDD [pogon:][pot] CDD[..] .. Gre v nadrejeni imenik. - Gre v prejnji imenik, e je ta funkcija omogoena. e je doloen samo pogon, se spremeni trenutni pogon; to je edina razlika med CDD in CHDIR. Vnesite CDD brez parametrov, da vidite trenutni pogon in imenik. . :TEXT_CMDHELP_CHCP Prikae ali spremeni trenutno kodiranje znakov (kodno stran). CHCP [nnn] nnn Doloi kodiranje. Vnesite CHCP brez parametra, da vidite trenutno izbrano kodiranje. . :TEXT_CMDHELP_CLS Izprazni zaslon. CLS . :TEXT_CMDHELP_COMMAND Zaene novo kopijo FreeCOMa. COMMAND [[pogon:]pot] [naprava] [/E:n] [/L:n] [/U:n] [/P] [/MSG] [/LOW] [/Y [/[C|K] ukaz]] [pogon:]pot Doloi imenik, ki vsebuje COMMAND.COM. naprava Doloi napravo, ki naj bo uporabljena za vhod in izhod. /E:nnnnn Nastavi zaetno velikost okolja na n bajtov. (n naj bo med 256 in 32768) /L:n Doloi velikost notranjih struktur (zahteva /P). (n naj bo med 128 in 1024) /U:n Doloi velikost spomina za vhod (zahteva /P) (n naj bo med 128 in 255) /P Naredi novo lupino trajno (ne da se je konati). /MSG Shrani vsa sporoila o napakah v spominu (zahteva /P). /LOW Prisili lupino, da shrani stalen del v niji del spomina. /Y Koraka skozi ukazno datoteko, ki jo doloi /C ali /K. /C ukaz Izvede naveden ukaz in se kona. /K ukaz Izvede naveden ukaz in nadaljuje z izvajanjem. . :TEXT_CMDHELP_COPY Kopira eno ali ve datotek na drugo lokacijo. COPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]] [cilj [/A | /B]] [/V] [/Y | /-Y] izvor Doloi datoteke, ki naj se kopirajo. /A Doloi ASCII datoteko z besedilom. /B Doloi binarno datoteko. cilj Doloi imenik in/ali ime za nove datoteke. /V Preveri, ali so se datoteke pravilno zapisale. /Y Ne vpraa, ali elite zamenjati obstojeo ciljno datoteko. /-Y Vpraa, ali elite zamenjati obstojeo ciljno datoteko. Monost /Y je lahko prednastavljena v spremenljivki COPYCMD. Onemogoite jo lahko z /-Y na ukazni vrstici. Da zdruite ve datotek v eno, doloite samo eno ciljno datoteko, toda ve izvornih datotek (z nadomestnimi znaki ali kot datoteka1+datoteka2+datoteka3). . :TEXT_CMDHELP_CTTY Zamenja terminal, s katerim upravljate sistem. CTTY naprava naprava Terminal, ki ga elite uporabljati, npr. COM1. . :TEXT_CMDHELP_DATE#1 Prikae ali nastavi datum. DATE [/D] [datum] Vnesite DATE brez parametrov, da vidite trenutni datum in istoasno nastavite novega. Pritisnite Enter, da obdrite isti datum. /D onemogoi interaktivnost. . :TEXT_CMDHELP_DEL#2 Izbrie eno ali ve datotek. DEL [pogon:][pot]datoteka [/P] [/V] ERASE [pogon:][pot]datoteka [/P] [/V] [pogon:][pot]datoteka Doloi datoteko za izbris. Ve datotek doloite z nadomestnimi znaki. /P Vpraa za potrditev, preden izbrie vsako datoteko. /V Prikae izbrisane datoteke. . :TEXT_CMDHELP_DIR#4 Prikae seznam datotek in podimenikov v imeniku. DIR [pogon:][pot][datoteka] [/P] [/W] [/A[[:]atributi]] [/O[[:]razvrstitev]] [/S] [/B] [/L] [/LFN] [/Y|/4] [pogon:][pot][datoteka] Doloi pogon, imenik, in/ali datoteke, ki naj bodo prikazane. Uporabite lahko nadomestne znake ali ve izrazov. /P Se ustavi po vsakem zaslonu informacij. /W irok seznam. /A Prikae datoteke z doloenimi atributi. atributi D imeniki R datoteke samo za branje H skrite datoteke A datoteke, pripravljene za arhiviranje S sistemske datoteke - predpona "ne" /O Doloi vrstni red. razvrstitev N po imenu (abecedno) S po velikosti (manji najprej) E po konnici (abecedno) D asovno (stareji najprej) G najprej imeniki - predpona za obratni vrstni red A po asu zadnjega dostopa (stareji najprej) /S Prikae datoteke v doloenem imeniku in vseh podimenikih. /B Minimalistien format (brez glave in povzetka). /L Uporabi male rke. /LFN Prikae dolga imena datotek. /Y ali /4 Prikae letnice s 4 tevkami. Monosti so lahko prednastavljene v spremenljivki DIRCMD. Onemogoite jih lahko tako, da pred monostjo vnesete "-", npr. /-W. . :TEXT_CMDHELP_DOSKEY#1 Funkcije programa DOSKEY zdaj vsebuje FreeCOM. S tipkama gor in dol brskate po zgodovini, z ukazom HISTORY pa vidite celotno zgodovino vpisanih ukazov. S tipkami levo, desno, Home, in End se pomikate po ukazni vrstici. S tipko Insert preklapljate med nainom vrivanja in prepisovanja. S tipko Tab dokonate ime datoteke na podlagi trenutno vneene besede; e jo pritisnete dvakrat, boste videli vse datoteke, ki se z njo ujemajo. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edits command lines, recalls command lines, and creates macros DOSKEY [/switch ...] [macroname=[text]] /BUFSIZE:size Sets size of macro and command buffer (default:512) /ECHO:on|off Enables/disables echo of macro expansions (default:on) /FILE:file Specifies file containing a list of macros /HISTORY Displays all commands stored in memory /INSERT Inserts new characters into line when typing /KEYSIZE:size Sets size of keyboard type-ahead buffer (default:15) /LINE:size Sets maximum size of line edit buffer (default:128) /MACROS Displays all DOSKey macros /OVERSTRIKE Overwrites new characters onto line when typing (default) /REINSTALL Installs a new copy of DOSKey macroname Specifies a name for a macro you create text Specifies commands you want to assign to the macro UP,DOWN arrows recall commands Esc clears current command F7 displays command history Alt+F7 clears command history [chars]F8 searches for command beginning with [chars] F9 selects a command by number Alt+F10 clears macro definitions The following are special codes you can use in DOSKey macro definitions: $T Command separator: allows multiple commands in a macro $1-$9 Batch parameters: equivalent to %1-%9 in batch programs $* Symbol replaced by everything following macro name on the command line . :TEXT_CMDHELP_ECHO Prikazuje sporoila ali omogoi ali onemogoi izpisovanje ukazov. ECHO [ON | OFF] ECHO [sporoilo] Vnesite ECHO brez parametrov, da izveste trenutno stanje ECHO. . :TEXT_CMDHELP_EXIT Kona FreeCOM, razen e je ta bil naloen z monostjo /P. EXIT . :TEXT_CMDHELP_FOR Izvede doloen ukaz za vsako datoteko v mnoici datotek. FOR %%spremenljivka IN (mnoica) DO ukaz [parametri] %%spremenljivka Doloi ime spremenljivke. (mnoica) Doloi mnoico ene ali ve datotek. Uporabite lahko nadomestne znake. ukaz Doloi ukaz, ki naj bo izveden za vsako datoteko. parametri Doloi parametre za naveden ukaz. V ukazni datoteki vnesite %%%%spremenljivka namesto %%spremenljivka. Primer: FOR %%f IN (---zaetek--- a*.* ---konec---) DO ECHO - %%f - . :TEXT_CMDHELP_GOTO V ukazni datoteki nadaljuje izvajanje od oznaene vrstice. GOTO oznaka oznaka Doloi oznako vrstice. Oznaka v vrstici stoji sama, zane pa se z dvopijem. . :TEXT_CMDHELP_HISTORY#1 Zgodovina vneenih ukazov. HISTORY [velikost] Brez velikosti je prikazana celotna zgodovina vneenih ukazov. Z velikostjo se spremeni velikost spomina, posveenega zgodovini. . :TEXT_CMDHELP_IF V ukazni datoteki izvede ukaz, e je izpolnjen doloen pogoj. IF [NOT] ERRORLEVEL tevilo ukaz IF [NOT] niz1==niz2 ukaz IF [NOT] EXIST datoteka ukaz NOT Doloi, naj ukazna lupina izvede ukaz, e pogoj ni izpolnjen. ERRORLEVEL tevilo Ukaz se bo izvedel, e je zadnji izvedeni ukaz vrnil napako, katere koda je enaka ali veja od navedenega tevila. niz1==niz2 Ukaz se bo izvedel, e se niza ujemata. EXIST datoteka Ukaz se bo izvedel, e datoteka obstaja. ukaz Doloi ukaz, ki naj bo izveden, e je pogoj izpolnjen. . :TEXT_CMDHELP_LFNFOR Vkljui ali izkljui dolga imena datotek v ukazu FOR ali dokonavanje imen datotek. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Vnesite LFNFOR ali LFNFOR COMPLETE brez parametra, da vidite trenutno nastavitev LFNFOR. . :TEXT_CMDHELP_LH Naloi program v gornji spomin. LOADHIGH [pogon:][pot]datoteka [parametri] LOADHIGH [/L:regija1[,minVelikost1][;regija2[,minVelikost2]...] [/S]] [pogon:][pot]datoteka [parametri] /L:regija1[,minVelikost1][;regija2[,minVelikost2]... Doloi regijo oz. regije spomina, v katere naj se naloi program. Regija1 doloi tevilo prve regije, minVelikost1 doloi minimalno velikost (e sploh) za regijo1. Regija2 in minVelikost2 doloita tevilo in minimalno velikost druge regije, e obstaja. Regij lahko doloite, kolikor elite. /S Skri UMB na minimalno velikost, medtem ko se program nalaga. [pogon:][pot]datoteka Doloi lokacijo in ime programa. . :TEXT_CMDHELP_LOADFIX Naloi program nad prvih 64K spomina in ga izvede. LOADFIX [pogon:][pot]datoteka Uporabite LOADFIX, e ste prejeli sporoilo "Packed file corrupt", ko ste ga poskuali naloiti v nizek del spomina. . :TEXT_CMDHELP_MD Ustvari imenik. MKDIR [pogon:]pot MD [pogon:]pot . :TEXT_CMDHELP_PATH Prikae ali spremeni seznam imenikov, v katerih se iejo programi. PATH [[pogon:]pot[;...]] PATH ; Vnesite PATH ;, da izpraznite seznam in ukaete lupini, naj programe ie le v trenutnem imeniku. Vnesite PATH brez parametrov, da vidite trenutni seznam programskih imenikov. . :TEXT_CMDHELP_PAUSE Zaasno prekine izvajanje ukazne datoteke in prikae sporoilo "Pritisnite katerokoli tipko" oz. doloeno sporoilo. PAUSE [sporoilo] . :TEXT_CMDHELP_PROMPT Spremeni ukazni poziv. PROMPT [besedilo] besedilo Doloi novi ukazni poziv. Poziv je lahko sestavljen iz katerihkoli znakov in naslednjih posebnih kod: $Q = (enaaj) $$ $ (dolar) $T trenutni as $D trenutni datum $P trenutni pogon in imenik $V verzija FreeCOMa $N trenutni pogon $G > ("ve kot") $L < ("manj kot") $B | (navpina rta) $H brisalka (izbrie prejnji znak) $E escape (ASCII znak 27) $_ prelom vrstice Vnesite PROMPT brez parametrov, da ukazni poziv ponastavite. . :TEXT_CMDHELP_PUSHD Potisne trenutni imenik na imeniki sklad z monostjo spreminjanja trenutnega imenika. PUSHD [[pogon:]pot] kjer je [pogon:]pot pot, v katero elite. . :TEXT_CMDHELP_POPD Vzame imenik z imenikega sklada in ga doloi za trenutni imenik. POPD [*] Parameter "*" poisti imeniki sklad. . :TEXT_CMDHELP_DIRS Prikae vsebino imenikega sklada. DIRS . :TEXT_CMDHELP_RD Odstrani (izbrie) prazen imenik. RMDIR [pogon:]pot RD [pogon:]pot . :TEXT_CMDHELP_REM Oznauje komentarje (opombe) v ukazni datoteki ali CONFIG.SYS. REM [komentar] . :TEXT_CMDHELP_REN Preimenuje eno ali ve datotek oz. imenikov. RENAME [pogon:][pot][imenik1 | datoteka1] [imenik2 | datoteka2] REN [pogon:][pot][imenik1 | datoteka1] [imenik2 | datoteka2] Pri novem imenu ne morete doloiti novega pogona oz. poti; za ta namen uporabite ukaz MOVE. . :TEXT_CMDHELP_SET#1 Prikae, nastavi, ali odstrani okoljsko spremenljivko. SET [/C] [/P] [/E] [/U] [spremenljivka[=[niz]]] spremenljivka Doloi ime spremenljivke. niz Doloi vrednost spremenljivke. e niz ni doloen, se spremenljivka odstrani iz okolja. Vnesite SET brez parametrov, da vidite trenutne vrednosti vseh spremenljivk. Vnesite SET in ime spremenljivke, da vidite njeno vrednost. /C obdri velike in male rke: navadno se ime datoteke spremeni v velike rke, e spremenljivka e obstaja. /P pozove uporabnika, da vnese niz, in ga dodeli spremenljivki. /E nastavi spremenljivko na prvo vrstico izhoda programa, ki ga doloa niz. /U spremeni vse rke niza v velike rke. . :TEXT_CMDHELP_SHIFT#1 Changes the position of replaceable parameters in a batch file. SHIFT [DOWN] DOWN shifts the argument window toward the beginning (%%0); otherwise toward the end. . :TEXT_CMDHELP_TIME#1 Prikae ali nastavi as. TIME [/T] [as] Vnesite TIME brez parametrov, da vidite trenutni as in istoasno nastavite novega. Pritisnite Enter, da obdrite starega. /T onemogoi interaktivnost. . :TEXT_CMDHELP_TRUENAME Prikae polno ime doloene poti. TRUENAME [pogon:][pot][datoteka] . :TEXT_CMDHELP_TYPE Prikae vsebino datoteke z besedilom. TYPE [pogon:][pot]datoteka . :TEXT_CMDHELP_VER Prikae verzijo FreeCOMa in druge informacije. VER [/R] [/W] [/D] [/C] /R Prikae verzijo jedra in druge informacije. /W Prikae informacije o jamstvu. /D Prikae pogoje za razpeavanje FreeCOMa. /C Prikae sodelujoe pri razvoju FreeCOMa. . :TEXT_CMDHELP_VERIFY Pove datotenemu sistemu, naj preveri, ali se datoteke pravilno zapiejo na disk. VERIFY [ON | OFF] Vnesite VERIFY brez parametrov, da vidite trenutno stanje VERIFY. . :TEXT_CMDHELP_FDDEBUG If debugging is compiled into FreeDOS, this command will turn debug output on or off, or tell you if it is on or off. FDDEBUG [ON | OFF | datoteka] Type FDDEBUG without a parameter to display the current debug output setting. If a file is specified, all debug output is redirected into that file; the output is appended to the file, if it already exists. The special names "stdout" and "stderr" may be used to redirect the output to the standard output or standard error stream. . :TEXT_CMDHELP_VOL Prikae oznako nosilca in njegovo serijsko tevilko, e ta obstajata. VOL [pogon:] . :TEXT_CMDHELP_QUESTION#1 Prikae seznam ukazov in funkcij, ki so na voljo v FreeCOMu. ? ?ukaz [parametri] Prva oblika prikae vse vgrajene ukaze in funkcije. Druga oblika vpraa, ali naj izvede doloen ukaz, kot v nainu sledenja. . :TEXT_CMDHELP_WHICH Poie in prikae datoteko za vsak doloen ukaz. WHICH ukaz... . :TEXT_CMDHELP_MEMORY#1 Prikae FreeCOMov notranji spomin. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 Cilj za ukaz COPY ne sme vsebovati znakov "+". . :TEXT_DELETE_FILE#1% Briem datoteko "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% Ni mogoe pisati v datoteko "%s"; je morda disk poln? (potrebnih je %lu bajtov) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% %lu/???K kopiranih\r\ . :TEXT_COPY_COPIED#0% %lu/%luK kopiranih\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM ne more biti naprava: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Ta datoteka ni veljaven FreeCOM ali pa ni zdruljiva verzija: %s . :TEXT_ERROR_LOADING_STRINGS Failed to load the strings resource into memory, the location pointed to in %COMSPEC% seems to be invalid. Please specify another location of FreeCOM to try to load the strings from, e.g.: C:\\COMMAND.COM or just hit enter to cancel to load the strings. . :TEXT_TERMINATING Poteka prekinitev. . :TEXT_HIDDEN_CRITER#0% %u Critical Error requests suppressed. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Exit code (ERRORLEVEL): %u, reason: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS API napaka\ . :TEXT_EXIT_REASON_0 terminated normally\ . :TEXT_EXIT_REASON_1 terminated by ^Break\ . :TEXT_EXIT_REASON_2 terminated by critical error\ . :TEXT_EXIT_REASON_3 gone resident\ . ================================================ FILE: strings/spanish.err ================================================ # $Id$ # # Critical error national customization file # # Language: 8bit CP850, CP858 Spanish (Spain) # Author: FreeCOM maintainer # Translation: Aitor SANTAMARIA MERINO # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Error %1 en unidad %A: %2 rea: %3 S3 CHAR_DEVICE: Error %1 en dispositivo %A: %3 ## kind of operation S0 READ: leyendo desde S1 WRITE: escribiendo a ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: raz S7 DATA: datos ## action strings S8 IGNORE: (I)gnorar S9 RETRY: (R)eintentar S10 ABORT: (A)bortar S11 FAIL: (F)allo ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: rR KEYS_ABORT: aA KEYS_FAIL: fF ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Cdigo de error desconocido S15 0: intento de violacin de la proteccin contra escritura 1: unidad no vlida para este dispositivo 2: unidad no lista 3: instruccin desconocida para el controlador 4: error de datos (error en CRC) 5: longitud errnea de la estructura de peticin al controlador 6: error de bsqueda 7: tipo de soporte desconocido 8: sector no encontrado 9: la impresora no tiene papel 10: error de escritura 11: error de lectura 12: error general 13: violacin de permisos de archivo compartido 14: violacin de proteccin 15: cambio en disco no vlido 16: FCB no est disponible 17: desbordamiento del buffer de acceso compartido 18: el cdigo de pgina no concuerda 19: fuera de la entrada 20: espacio en disco insuficiente ================================================ FILE: strings/spanish.lng ================================================ # $Id: SPANISH.LNG,v 1.00 2003/10/12 (based on DEFAULT 1.14) # # FreeCOM national customization file # # Language: 8bit CP850, CP858 Spanish (Spain) # Author: FreeCOM maintainer # Translation: Aitor SANTAMARIA MERINO # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH Modificador no vlido. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH Modificador no vlido. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION Argumento no vlido: '%s' . :TEXT_ERROR_OPT_ARG La opcin '%s' no puede tener un argumento . :TEXT_ERROR_OPT_NOARG La opcin '%s' requiere un argumento . :TEXT_INVALID_NUMBER Nmero especificado no vlido en '%s' . :TEXT_ERROR_CLOSE_QUOTE Falta cerrado de comillas: %c . :TEXT_ERROR_TEMPFILE No se puede crear archivo temporal . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Demasiados parmetros. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Demasiados parmetros. . :TEXT_ERROR_INVALID_PARAMETER Parmetro no vlido. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Ruta no encontrada. . :TEXT_ERROR_FILE_NOT_FOUND Archivo no encontrado. . :TEXT_ERROR_SFILE_NOT_FOUND Archivo no encontrado. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING Falta parmetro obligatorio. . :TEXT_ERROR_INVALID_DRIVE Unidad no vlida %c:. . :TEXT_ERROR_BADCOMMAND#2 Orden o nombre de archivo no reconocido - "%s". . :TEXT_ERROR_OUT_OF_MEMORY No hay memoria suficiente. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Error en peticin de la memoria DOS requerida. . :TEXT_ERROR_CANNOTPIPE No se puede redireccionar (no se puede abrir archivo temporal) . :TEXT_ERROR_LONG_LINE_BATCHFILE La lnea #%ld en el archivo por lotes '%s' es demasiado larga. . :TEXT_ERROR_BFILE_VANISHED Archivo por lotes '%s' no encontrado. . :TEXT_ERROR_BFILE_LABEL El archivo por lotes '%s' no contiene la etiqueta '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s fracas para '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR No se puede establecer la variable de entorno '%s'. El espacio de almacenamiento puede estar lleno. . :TEXT_ERROR_ENV_VAR_NOT_FOUND Variable de entorno '%s' no encontrada. . :TEXT_ERROR_NO_ENVIRONMENT No hay espacio de entorno, quiz por falta de memoria. Use la opcin /E . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 No se puede establecer el alias '%s'. Quiz no hay espacio para alias. . :TEXT_ERROR_ALIAS_NOT_FOUND#1 Alias '%s' no encontrado. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 No hay espacio para alias. Posiblemente falte memoria. . :TEXT_ERROR_SYNTAX_STR Error de sintaxis. - '%s' . :TEXT_ERROR_SYNTAX Error de sintaxis. . :TEXT_ERROR_FILENAME_TOO_LONG Nombre de archivo demasiado largo. - '%s' . :TEXT_ERROR_SELFCOPY No se puede copiar '%s' en s mismo . :TEXT_ERROR_COMMAND_TOO_LONG La lnea de rdenes es demasiado larga tras la expansin de los aliases . :TEXT_ERROR_LINE_TOO_LONG Lnea demasiado larga. No se puede ejecutar la orden. . :TEXT_ERROR_HISTORY_SIZE#1 Tamao no vlido del historial '%s'. . :TEXT_HISTORY_EMPTY#1 El historial de la lnea de rdenes est vaco. . :TEXT_ERROR_BAD_MCB_CHAIN La cadena MCB est corrompida, o el sistema no es compatible con MS-DOS. . :TEXT_ERROR_UNDEFINED_ERROR Error indefinido %d. . :TEXT_ERROR_REGION_WARNING Regin de memoria no vlida %d - ser ignorada. . :TEXT_ERROR_ON_OR_OFF Se debe especificar ON u OFF. . :TEXT_ERROR_BAD_VARIABLE Especificacin de variable no vlida. . :TEXT_ERROR_IN_MISSING#1 FOR: se requiere IN. . :TEXT_ERROR_MISSING_PARENTHESES#1 Falta uno o ambos parntesis. . :TEXT_ERROR_DO_MISSING#1 FOR: se requiere DO. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: No hay instruccin despus de DO. . :TEXT_ERROR_REDIRECT_FROM_FILE No se puede redirigir la entrada desde el archivo '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE No se puede redirigir la salida al archivo '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Redireccin nula. . :TEXT_ERROR_INVALID_DATE Fecha no vlida. . :TEXT_ERROR_INVALID_TIME Hora no vlida. . :TEXT_ERROR_NO_GOTO_LABEL No se ha especificado etiqueta para GOTO. . :TEXT_CTTY_NOTIMPLEMENTED La orden CTTY se ha excludo en esta versin de COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE Dispositivo no vlido o no de lectura/escritura: '%s'. . :TEXT_ERROR_CTTY_DUP No se pudo cambiar los descriptores de archivo a TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L an no est implementado. . :TEXT_ERROR_U_NOTIMPLEMENTED /U an no est implementado. . :TEXT_ERROR_WRITING_DEST Error al escribir al archivo de destino. . :TEXT_ERROR_CANNOT_OPEN_SOURCE No se puede abrir archivo origen. - '%s' . :TEXT_ERROR_OPEN_FILE No se puede abrir archivo origen '%s' . :TEXT_ERROR_READ_FILE No se puede leer desde el archivo '%s' . :TEXT_ERROR_WRITE_FILE No se puede escribir al archivo '%s' . :TEXT_ERROR_LEADING_PLUS El carcter de concatenacin '+' no puede preceder el argumento. . :TEXT_ERROR_TRAILING_PLUS El carcter de concatenacin '+' no puede suceder el argumento. . :TEXT_ERROR_NOTHING_TO_DO No hay nada que hacer. . :TEXT_ERROR_COPY COPY fracas . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: falta nombre de archivo . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: falta nmero . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: nmero no vlido . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: se requiere una instruccin . :TEXT_NOT_IMPLEMENTED_YET An no est implementado. . :TEXT_FAILED_LOAD_STRINGS No se pueden cargar los mensajes en memoria. . :TEXT_MSG_NOTIMPLEMENTED La opcin /MSG ha sido excluda de esta versin de COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1 Se visualizaron %u objetos. . :TEXT_CORRUPT_COMMAND_LINE Lnea de rdenes no vlida. Error interno relacionado con el COMMAND.COM en ejecucin. Por favor, informar de este error. . :TEXT_QUOTED_C_OR_K#1 Las opciones /C y /K no pueden ser entrecomilladas y se ignorarn. . :TEXT_INIT_FULLY_QUALIFIED#1 La ruta hasta COMMAND.COM debe ser completa. Debe incluir el nmero de unidad y comenzar por barra inclinada. Por ejemplo: C:\\FDOS COMMAND.COM asumir esta nueva ruta: %s . :TEXT_ERROR_RESTORE_SESSION La informacin sobre la sesin no ha podido ser restaurada, y cualquier modificacin local se ha perdido. Consultar los mensajes de error indicados arriba para entender el motivo de este problema. . :TEXT_ERROR_SAVE_SESSION La informacin actual no se preservar durante la llamada del programa. Consultar los mensajes de error indicados arriba para entender el motivo de este problema. . :TEXT_ERROR_CWD_FAILED#1% La unidad %c: no responde. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Fallo en el intercambio: los alias requieren demasiada memoria. . :TEXT_ERROR_KSWAP_ALLOCMEM Fallo en el intercambio: no se puede solicitar memoria lejana. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 No hay espacio de alias suficiente. . :TEXT_ERROR_ALIAS_NO_SUCH#1 El alias '%s' no existe . :TEXT_ERROR_ALIAS_INSERT#1 No se pudo registrar el alias. . :TEXT_ALIAS_INVALID_NAME#1 Nombre de alias '%s' no vlido. . :TEXT_ERROR_LOADING_CONTEXT#1 No se pudo cargar el mdulo del contexto o el gestor de error crtico. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 No hay memoria para el contexto. Si este fallo persiste, puede intentar aumentar los bferes internos (historial, pila de directorios, etc.) . :TEXT_ERROR_CONTEXT_LENGTH#1 El tamao del contexto excede en %lu el lmite mximo. Se asumir un tamao de %u bytes. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 No se pudo registrar informacin sobre estado en el contexto. Este error podra indicar corrupcin de memoria o tamao mnimo de contexto no vlido. Por favor, informar al mantenedor de FreeCOM en: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Contexto no hallado tras el intercambio. Se crear uno nuevo, aunque las alias, etc. locales se han perdido. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: Permiso denegado . :TEXT_ERROR_NO_SUCH_FILE#1% %s: No existe tal archivo o diretorio . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Error desconocido . # # Informational messages # :TEXT_MSG_PAUSE#1 Presione cualquier tecla para continuar . . .\ . :TEXT_MSG_HISTORY_SIZE El tamao del historial es %d bytes. . :TEXT_MSG_DOSKEY Las caractersticas de DOSKEY estn ya presentes en el intrprete. . :TEXT_MSG_ECHO_STATE El estado de ECHO es %s . :TEXT_MSG_VERIFY_STATE El estado de VERIFY es %s . :TEXT_MSG_FDDEBUG_STATE La salida de DEBUG es %s. . :TEXT_MSG_FDDEBUG_TARGET La salida de DEBUG se imprimir a '%s'. . :TEXT_MSG_BREAK_STATE El estado de BREAK es %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR es %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% Autocompletar con LFN (nombres largos de archivo) es %s . :TEXT_MSG_CURRENT_DATE La fecha actual es %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Introduzca la nueva fecha (mm%sdd%s[ss]aa): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Introduzca la nueva fecha (dd%smm%s[ss]aa): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Introduzca la nueva fecha ([ss]aa%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME La hora actual es %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Introduzca la nueva hora: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 SsNn{CR}{LF}{CBREAK} aabb b b b Todos los archivos en '%s' sern eliminados Desea continuar (S/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 SsNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [S=ENTER, No=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 SsNnTtQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Se presion Control-Break.\r Desea terminar el proceso por lotes '%s' (S/No/Todo) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 SsNnTtCc{BREAK}{ENTER}{ESC} aabbccdd d a b Desea sobreescribir '%s' (S/No/Todo/Cancelar) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% SsNnTtCc{BREAK}{ENTER}{ESC} aabbccdd d a b Aadir a '%s' (S/No/Todo/Cancelar) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 SsNnTtCc{BREAK}{ENTER}{ESC} aabbccdd d a b Desea eliminar '%s' (S/No/Todo/Cancelar) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY La pila de directorios est vaca. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 El volumen de la unidad %c \ . :TEXT_DIR_HDR_VOLUME_STRING es %s . :TEXT_DIR_HDR_VOLUME_NONE no tiene etiqueta . :TEXT_DIR_HDR_SERIAL_NUMBER El nmero de serie del volumen es %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s archivo(s)\ . :TEXT_DIR_FTR_BYTES %12s bytes . :TEXT_DIR_FTR_TOTAL_NUMBER Nmero total de archivos listados: . :TEXT_DIR_FTR_DIRS#1 %10s directorio(s)\ . :TEXT_DIR_FTR_BYTES_FREE %15s bytes libres . :TEXT_DIR_DIRECTORY Directorio de %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Directorio de %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH PATH=%s . :TEXT_MSG_PATH_NONE#1 No se ha definido una ruta de bsqueda. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Dom\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Lun\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Mar\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Mi\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Jue\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Vie\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sb\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 no se han eliminado archivos. . :TEXT_MSG_DEL_CNT_FILES_1#1 un archivo eliminado. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u archivos eliminados. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS rdenes internas disponibles: . :TEXT_MSG_SHOWCMD_FEATURES Caractersticas disponibles: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [alias] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [edicin de rdenes avanzada] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [historial] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [autocompletar nombres de archivo] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [intercambio] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start logging] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [ltimo directorio utilizado] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [nombres largos de archivo] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [kernel swap] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [intercambio con XMS] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [intercambio por defecto] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [rdenes instalables] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [pila de directorios (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [depuracin de FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pulse F8 para confirmacin individual, o F5 para omitir %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC Omitiendo '%s'. . :TEXT_MSG_VER_DOS_VERSION Versin del DOS %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS Ncleo de FreeDOS (build 1933 o anterior) . :TEXT_MSG_VER_LATER_FREEDOS Ncleo de FreeDOS versin %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman y otros. Este programa se distribuye con la esperanza de que sea til, pero SIN NINGUNA GARANTA, incluso sin la garanta MERCANTIL implcita o sin garantizar la CONVENIENCIA PARA UN PROPSITO PARTICULAR. Vase la Licencia Pblica General de GNU para ms detalles. Enve informes de errores a freedos-devel@lists.sourceforge.net. Las actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman y otros. Este programa es software libre. Puede redistribuirlo y/o modificarlo bajo los trminos de la Licencia Pblica General de GNU segn es publicada por la Free Software Foundation, bien la versin 2 de dicha Licencia o bien (segn su eleccin) cualquier versin posterior. Enve informes de errores a freedos-devel@lists.sourceforge.net. Las actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS El intrprete de rdenes de FreeDOS ha sido desarrollado por varios programadores, refirase al archivo adjunto HISTORY.TXT para ms detalles. Traduccin al espaol por Aitor Santamara Merino mailto:nls@freedos.org Enve informes de errores a freedos-devel@lists.sourceforge.net. Las actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r El intrprete va a ser abortado, aunque esto no\r est permitido (habitualmente por el modificador "/P").\r Deber reiniciar su equipo, o si est ejecutndose en\r un entorno multitarea, terminar este proceso/tarea manualmente.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 El ejecutable de FreeCOM no ha sido encontrado. Deber especificar la ruta completa hacia COMMAND.COM como primer argumento para COMMAND, por ejemplo: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1 Segmento de entorno : max %5u bytes; libre %5u bytes . :TEXT_MEMORY_CONTEXT#1 Segmento de contexto : max %5u bytes; libre %5u bytes . :TEXT_MEMORY_HEAP#1 Montculo (heap) : free %5lu bytes . :TEXT_MEMORY_CTXT_ALIAS#1 \tAlias : lmite %5u bytes, actual %5u bytes, %5u objetos . :TEXT_MEMORY_CTXT_HISTORY#1 \tHistorial : lmite %5u bytes, actual %5u bytes, %5u objetos . :TEXT_MEMORY_CTXT_DIRSTACK#1 \tPila de directorios : lmite %5u bytes, actual %5u bytes, %5u objetos . :TEXT_MEMORY_CTXT_LASTDIR#1 \tCach para ltimo directorio : usado %5u bytes, %5u objetos . :TEXT_MEMORY_CTXT_BATCH#1 \tAnidamiento de proc. por lotes : usado %5u bytes, %5u objetos . :TEXT_MEMORY_CTXT_SWAPINFO#1 \tInformacin de intercambio : usado %5u bytes, %5u objetos . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Error al obtener el cdigo de pgina actual del sistema. . :TEXT_ERROR_SET_CODEPAGE#1 Error al cambiar el cdigo de pgina actual. . :TEXT_DISPLAY_CODEPAGE#1 El cdigo de pgina actual es %u. El cdigo de pgina del sistema (apropiado) es: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Visualiza, establece o elimina alias. ALIAS [variable[=][cadena]] variable Nombre del alias. cadena Secuencia de caracteres a asignar al alias. Introduzca ALIAS sin parmetros para visualizar los alias activos. . :TEXT_CMDHELP_BEEP Produce una seal acstica. . :TEXT_CMDHELP_BREAK Activa o desactiva la comprobacin extendida de Control+C. BREAK [ON | OFF] Introduzca BREAK sin parmetros para ver el estado actual de BREAK. . :TEXT_CMDHELP_CALL#1 Invoca a un archivo de proceso por lotes desde otro. CALL [/S | /N] [unidad:][ruta]nombre-archivo [parmetros] parmetros Parmetros cualesquiera requeridos por el archivo de proceso por lotes. /S y /N fuerza e inhibe el intercambio de FreeCOM. . :TEXT_CMDHELP_CD Muestra o cambia el directorio activo. CHDIR [drive:][path] CHDIR[..] CD [drive:][path] CD[..] CD - .. Especifica al directorio padre como directorio a cambiar. - Con la caracterstica "ltimo directorio" activada, cambia al ltimo directorio. Introduzca CD unidad: para visualizar el directorio activo de la unidad especificada. Introduzca CD sin parmetros para visualizar el directorio activo de la unidad activa. Vase tambin: CDD . :TEXT_CMDHELP_CDD Muestra o cambia el nombre de la unidad y directorio activos. CDD [unidad:][ruta] CDD[..] .. Especifica al directorio padre como directorio a cambiar. - Con la caracterstica "ltimo directorio" activada, cambia al ltimo directorio. Si se introduce unidad:, se modifica la unidad activa; sta es la nica diferencia con "CHDIR". Introduzca CDD sin parmetros para visualizar el directorio activo de la unidad activa. . :TEXT_CMDHELP_CHCP Muestra o cambia el cdigo de pgina del sistema. CHCP [nnn] nnn Nmero del cdigo de pgina. Introduzca CHCP sin parmetros para visualizar el cdigo de pgina del sistema. . :TEXT_CMDHELP_CLS Borra la pantalla. CLS . :TEXT_CMDHELP_COMMAND Inicia una nueva copia del intrprete de rdenes de FreeDOS. COMMAND [[unidad:]ruta] [disp] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] orden]] [unidad:]ruta Especifica el directorio que contiene a COMMAND.COM. disp Indica el dispositivo a usar para entrada/salida de rdenes. /E:nnnnn Establece el tamao inicial del entorno a nnnnn bytes. (nnnnn debe estar comprendido entre 256 y 32.768). /L:nnnn Especifica el tamao interno de los bfers (requiere /P). (nnnn debe estar comprendido entre 128 y 1.024). /U:nnn Especifica el tamao del bfer de entrada (requiere /P). (nnn debe estar comprendido entre 128 y 255). /P Hace el nuevo intrprete permanente (no se puede salir). /MSG Almacena los mensajes de error en memoria (requiere /P). /LOW Fuerza al intrprete a mantener sus datos residentes en el rea de memoria baja. /Y Ejecuta el programa BATCH especificado por /C o /K. /C orden Ejecuta la orden especificada y sale. /K command Ejecuta la orden especificada y se mantiene en ejecucin. . :TEXT_CMDHELP_COPY Copia uno o ms archivos a otro lugar. COPY [/A | /B] origen [/A | /B] [+ origen [/A | /B] [+ ...]] [destino [/A | /B]] [/V] [/Y | /-Y] origen Especifica los archivos que sern copiados /A Indica que se trata de un archivo de texto ASCII. /B Indica que se trata de un archivo binario. destino Especifica el nuevo directorio y/o nombre para los archivos. /V Verifica que los archivos han sido copiados correctamente. /Y Elimina la confirmacin de sobreescritura de archivos ya existentes en destino. /-Y Solicita obligatoriamente confirmacin de sobreescritura de archivos ya existentes en destino. La opcin /Y puede estar presente en la variable de entorno COPYCMD, y puede ser ignorada especificando /-Y en la lnea de rdenes Para concatenar archivos, especifique un nombre de archivo destino, pero mltiples archivos en origen (usando comodines o bien arch1+arch2+arch3). . :TEXT_CMDHELP_CTTY Cambia el dispositivo terminal usado para controlar el sistema. CTTY dispositivo dispositivo Dispositivo terminal que desea usar, por ejemplo COM1. . :TEXT_CMDHELP_DATE#1 Muestra o establece la fecha. DATE [/D] [fecha] Introduzca DATE sin parmetros para visualizar la fecha actual y la peticin de una nueva fecha. Presione ENTER para mantener la misma fecha. /D impide que DATE acte de forma interactiva. . :TEXT_CMDHELP_DEL#2 Elimina uno o ms archivos. DEL [unidad:][ruta]archivo [/P] [/V] ERASE [unidad:][ruta]archivo [/P] [/V] [unidad:][ruta]archivo Especifica el/los archivo/s a eliminar. Utilice varios archivos utilizando comodines. /P Solicita confirmacin antes de borrar cada archivo. /V Visualiza los archivos eliminados. . :TEXT_CMDHELP_DIR#4 Muestra un listado de archivos y subdirectorios en un directorio. DIR [unidad:][ruta][archivo] [/P] [/W] [/A[[:]atributos]] [/O[[:]orden]] [/S] [/B] [/L] [unidad:][ruta][archivo] Especifica la unidad, directorio y/o archivos a listar. (Puede ser una especificacin de archivo mejorada, o mltiples especificaciones de archivo.) /P Efecta una pausa despus de cada llenado completo de pantalla. /W Usa formato de lista ancho. /A Muestra los archivos con los atributos especificados. (por defecto se considera /ADHSRA) atributos D Directorios R Archivos de slo lectura H Archivos ocultos A Archivos listos para archivar S Archivos de sistema - Prefijo para negacin /O Muestra los archivos ordenados. orden N Alfabtico por nombre S Por tamao (desde el menor) E Alfabtico por extensin D Por fecha/hora (desde el ms ant.) G Agrupar directorios - Prefijo para invertir el orden U Desordenado (orden natural) (Por defecto: /ONG) /S Muestra los archivos en el directorio y todos sus subdirectorios. /B Usa formato simple (sin cabecera y resumen). /L Muestra el contenido en minsculas. /Y o /4 Muestra el ao con cuatro dgitos Los modificadores se pueden preestablecer en la variable de entorno DIRCMD. Sus valores se pueden sobreescribir con el prefijo - antes del modificador (por ejemplo, /-W). . :TEXT_CMDHELP_DOSKEY#1 La utilidad externa DOSKEY es ahora parte de FreeCOM. Utilice las teclas de movimiento de cursor ARRIBA y ABAJO para recuperar el historial de lneas, y HISTORY para visualizarlo. Utilice las teclas de movimiento de cursor DERECHA e IZQUIERDA, y las teclas INICIO y FIN para navegar en la lnea, y utilize INS para conmutar entre los modos sobreescritura e insercin. Utilice la tecla TAB para completar la palabra actual a un nombre de archivo; presinela dos veces para mostrar todos los archivos coincidentes. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Edita y recupera lneas de rdenes, y crea macros. DOSKEY [/opcin ...] [nombre_macro=[cadena]] /BUFSIZE:n Establece a n el tamao del buffer de macros y rdenes (por defecto: 512) /ECHO:on|off Activa o desactiva el eco en la expansin de macros (por defecto: ON) /FILE:archivo Indica un archivo que contiene una lista de macros /HISTORY Visualiza las rdenes almacenadas en memoria /INSERT Inserta nuevos caracteres en la lnea al mecanografiar /KEYSIZE:m Establece a m el tamao del buffer de teclado (por defecto: 15) /LINE:k Establece a k el tamao mximo del buffer de edicin de lneas (por defecto: 128) /MACROS Muestra todas las macros de DOSKEY /OVERSTRIKE Sustituye nuevos caracteres en la lnea al mecanografiar (por defecto) /REINSTALL Instala una nueva copia de DOSKey nombre_macro Establece un nombre para una nueva macro cadena Establece las rdenes a asignar a la macro cursor ARRIBA y ABAJO para recuperar las lneas de rdenes Esc borra la lnea de rdenes actual F7 visualiza el historial de lneas de rdenes Alt+F7 elimina el historial de lneas de rdenes [cars.]F8 busca la primera lnea que comienza por [cars.] F9 elegir una lnea de rdenes por nmero Alt+F10 elimina todas las definiciones de macros Los siguientes son cdigos especiales que puede incluir en las definiciones de macros de DOSKey: $T Separador de rdenes: permite ms de una rden en una macro $1-$9 Parmetros Batch: equivalente a %1-%9 en programas batch $* Smbolo que se reemplazar por todo lo que sigue al nombre de la macro en la lnea de rdenes . :TEXT_CMDHELP_ECHO Muestra mensajes, o activa/desactiva la repeticin (eco) de la lnea de rdenes ECHO [ON | OFF] ECHO [mensaje] Introduzca ECHO sin parmetros para visualizar el estado actual del eco. . :TEXT_CMDHELP_EXIT Sale de la interfaz de rdenes de FreeDOS. EXIT . :TEXT_CMDHELP_FOR Ejecuta la orden especificada para cada archivo en un conjunto de archivos. FOR %%variable IN (set) DO command [command-parameters] %%variable Especifica una variable a ser reemplazada. (conjunto) Especifica un conjunto de archivos. Se admiten comodines. orden Especifica la orden que se ejecutar para cada archivo. parmetros Parmetros opcionales que la orden pueda requerir. Para usar FOR en un programa batch, usar %%%%variable en lugar de %%variable. . :TEXT_CMDHELP_GOTO Redirige la ejecucin de un programa batch a una cierta lnea etiquetada. GOTO etiqueta etiqueta Especifica una cadena de caracteres usada como etiqueta. Una etiqueta se crea en una lnea exclusiva que comienza con el carcter dos puntos (:) seguido del nombre de la etiqueta. . :TEXT_CMDHELP_HISTORY#1 Historial de rdenes. HISTORY [tamao] Sin "tamao", muestra los contenidos del historial de rdenes actual. Con "tamao", modifica el tamao del buffer para el historial. . :TEXT_CMDHELP_IF Ejecucin condicional en programas batch. IF [NOT] ERRORLEVEL nmero orden IF [NOT] cadena1==cadena2 orden IF [NOT] EXIST nombrearchivo orden NOT La orden slo se ejecutar si la condicin es falsa. ERRORLEVEL nmero La condicin es verdadera si el programa anterior devolvi un cdigo de salida igual o mayor al nmero especificado. orden Especifica la orden que se ejecutar si la condicin se verifica. cadena1==cadena2 La condicin es verdadera si ambas cadenas coinciden. EXIST nombrearchivo La condicin es verdadera si el archivo dado existe. . :TEXT_CMDHELP_LFNFOR Activa/Desactiva nombres largos de archivo para FOR o para autocompletar. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Introduzca LFNFOR o LFNFOR COMPLETE sin parmetros para mostrar el estado actual de LFNFOR. . :TEXT_CMDHELP_LH Carga un programa en memoria superior. LOADHIGH [unidad:][ruta]nombrearchivo [parmetros] LOADHIGH [/L:regin1[,tamMn1][;regin2[,tamMn2]...] [/S]] [unidad:][ruta]nombrearchivo [parmetros] /L:regin1[,tamMn1][;regin2[,tamMn2]]... Especifica las regiones de memoria donde cargar el programa. Regin1 especifica el nmero de la primera regin de memoria; tamMn1 especifica en su caso el tamao mnimo de la regin. Regin2 especifica el nmero de la segunda regin de memoria; tamMn2 especifica en su caso el tamao mnimo de la regin y as sucesivamente. Se pueden indicar tantas regiones como se desee. /S Reduce un bloque de memoria superior a su tamao mnimo mientras el programa se carga. [unidad:][ruta]nombrearchivo Especifica la localizacin y nombre del programa. . :TEXT_CMDHELP_LOADFIX Carga un programa por encima de los primeros 64KB de memoria y lo ejecuta. LOADFIX [unidad:][ruta]nombrearchivo Utilice LOADFIX para cargar un programa para el que se obtiene el mensaje de error "Packed file corrupt" (programa comprimido corrupto) al tratar de cargarlo en memoria. . :TEXT_CMDHELP_MD Crea un directorio. MKDIR [unidad:]ruta MD [unidad:]ruta . :TEXT_CMDHELP_PATH Establece o muestra una lista de rutas alternativas para archivos ejecutables. PATH [[unidad:]ruta[;...]] PATH ; Introduzca PATH ; para eliminar todas las rutas alternativas, e indicar al intrprete que slo debe utilizar el directorio actual. Introduzca PATH sin parmetros para mostrar las rutas alternativas actuales. . :TEXT_CMDHELP_PAUSE Suspende la ejecucin de un programa batch hasta la pulsacin de una tecla, y muestra el siguiente mensaje: "Presione cualquier tecla para continuar . . ." o cualquier otro mensaje especificado. PAUSE [mensaje] . :TEXT_CMDHELP_PROMPT Modifica el indicador de rdenes. PROMPT [cadena] cadena Especifica el nuevo indicador de rdenes. El indicador puede constar de caracteres normales, y los siguientes cdigos especiales: $Q = (signo de igualdad) $$ $ (signo de dlar) $T Hora actual $D Fecha actual $P Unidad y ruta actual $V Versin del intrprete de rdenes de FreeDOS $N Unidad actual $G > (signo de mayor-que) $L < (signo de menor-que $B | (barra vertial) $H Retroceso (elimina el carcter anterior) $E Cdigo escape (cdigo ASCII 27) $_ Retorno de carro e incremento de lnea Introduzca PROMPT sin parmetros para restablecer el indicador por defecto. . :TEXT_CMDHELP_PUSHD Vuelca el directorio actual a la pila de directorios (con la posibilidad de cambiar previamente a dicho directorio). PUSHD [[unidad:]ruta] Donde [unidad:]ruta es la nueva ruta a la que deseas cambiar. . :TEXT_CMDHELP_POPD Recupera un directorio de la pila de directorios, y cambia a l. POPD [*] El parmetro '*' borra la pila de directorios. . :TEXT_CMDHELP_DIRS Muestra los contenidos de la pila de directorios. DIRS . :TEXT_CMDHELP_RD Elimina un directorio. RMDIR [unidad:]ruta RD [unidad:]ruta . :TEXT_CMDHELP_REM Realiza comentarios en un archivo batch o en CONFIG.SYS. REM [comentario] . :TEXT_CMDHELP_REN Renombra uno o varios archivos o directorios. RENAME [unidad:][ruta][directorio1 | archivo1] [directorio2 | archivo2] REN [unidad:][ruta][directorio1 | archivo1] [directorio2 | archivo2] Ntese que no se permite establecer una nueva unidad o ruta en destino. Utilice la orden MOVE para tal propsito. . :TEXT_CMDHELP_SET#1 Muestra, establece o elimina variables de entorno. SET [/C] [variable=[valor]] variable Especifica el nombre de la variable de entorno. string Especifica una serie de caracteres a asignar como valor. * Si no se especifica un valor, la variable de entorno se elimina. Introduzca SET sin parmetros para mostrar las variables de entorno actuales. /C fuerza la distincin entre maysculas y minsculas. Por defecto, el nombre de variable se pasa a maysculas si no se encontraba previamente en el entorno, en cuyo caso, su estado se mantiene. . :TEXT_CMDHELP_SHIFT#1 Modifica la posicin de parmetros reemplazables en un programa batch. SHIFT [DOWN] DOWN desplaza la lista de argumentos hacia el principio (%%0); en caso caso contrario, hacia el final. . :TEXT_CMDHELP_TIME#1 Establece o muestra la hora del sistema. TIME [/T] [hora] Introduzca TIME sin parmetros para mostrar la hora actual, y preguntar por una nueva. Pulse ENTER para mantener la misma hora. /T impide que TIME funcione de forma interactiva. . :TEXT_CMDHELP_TRUENAME Muestra la ruta completa hacia el archivo especificado. TRUENAME [unidad:][ruta][nombrearchivo] . :TEXT_CMDHELP_TYPE Muestra el contenido de archivos de texto. TYPE [unidad:][ruta]nombrearchivo . :TEXT_CMDHELP_VER Muestra la versin del intrprete de rdenes de FreeDOS y otra informacin. VER [/R] [/W] [/D] [/C] /R Muestra la versin del kernel y otra informacin. /W Muestra la garanta del intrprete de rdenes de FreeDOS. /D Muestra informacin sobre la redistribucin del intrprete. /C Muestra la lista de contribuidores al intrprete de rdenes. . :TEXT_CMDHELP_VERIFY Indica al sistema de archivos de FreeDOS que debe verificar la correcta escritura de archivos al disco. VERIFY [ON | OFF] Introduzca VERIFY sin parmetros para visualizar el estado actual de VERIFY. . :TEXT_CMDHELP_FDDEBUG Si se compila FreeDOS con soporte para depuracin, esta orden activa o desactiva la produccin de mensajes de depuracin, o indica su estado. FDDEBUG [ON | OFF | archivo] Indique FDDEBUG sin parmetros para visualizar el estado actual. Si se especifica un archivo, todas las salidas se redirigirn a dicho archivo; los mensajes se aadirn al final del archivo si ste existe. Los nombres especiales "stdout" and "stderr" se pueden utilizar para redirigir la salida hacia las salidas estndar de datos y de errores. . :TEXT_CMDHELP_VOL Muestra la etiqueta de volumen y el nmero de serie de un disco, si existen. VOL [unidad:] . :TEXT_CMDHELP_QUESTION#1 Muestra la lista de rdenes y caractersticas disponibles en el intrprete. ? ?orden [argumentos] La primera variante muestra las rdenes internas y caractersticas disponibles. La segunda variante pregunta si se debe o no ejecutar la orden especificada, como si estuviera activado el modo de bsqueda de errores. . :TEXT_CMDHELP_WHICH Busca el ejecutable para la orden dada, y lo muestra. WHICH {orden} . :TEXT_CMDHELP_MEMORY#1 Muestra la memoria que FreeCOM usa internamente MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 El parmetro de destino de COPY no debe contener el carcter suma ('+'). . :TEXT_DELETE_FILE#1 Eliminando archivo "%s". . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% No se puede escribir el archivo '%s'; Probablemente el disco est lleno (se requieren %lu bytes) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% copiados %luKB/???KB\r\ . :TEXT_COPY_COPIED#0% copiados %luKB/%luKB\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM no puede ser un dispositivo: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Este archivo no es un FreeCOM vlido, o la versin no es compatible: %s . :TEXT_ERROR_LOADING_STRINGS Error al cargar las cadenas de caracteres en memoria, la ruta indicada en %COMSPEC% no parece vlida. Por favor, especifique otra ruta hacia FreeCOM para tratar de recargar las cadenas, por ejemplo: C:\\COMMAND.COM o pulse ENTER para cancelar la carga de dichas cadenas. . :TEXT_TERMINATING Abortando ejecucin. . :TEXT_HIDDEN_CRITER#0% Se han eliminado %u peticiones de Error Crtico. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% Cdigo de salida (ERRORLEVEL): %u, motivo: %u (%s) . :TEXT_EXIT_REASON_NEG_1 Error en el API del DOS\ . :TEXT_EXIT_REASON_0 salida con normalidad\ . :TEXT_EXIT_REASON_1 salida por ^Break\ . :TEXT_EXIT_REASON_2 salida por error crtico\ . :TEXT_EXIT_REASON_3 salida residente en memoria\ . ================================================ FILE: strings/strings/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak TOP2LVL = 1 TOP = ../.. !include "$(TOP)/config.mak" all : $(CFG) strings.lib !include "strings.mak" strings.lib: ../strings.h ../strings.err strings.rsp $(STRINGS_DEPS) echo Making STRINGS library $(RMFILES) strings.lib $(AR) strings.lib @strings.rsp $(LIBLIST) strings.lst $(CP) strings.lib .. $(CP) strings.lst .. ================================================ FILE: strings/swedish.err ================================================ # Critical error national customization file # # Language: Swedish / CP850 # Author: Oscar Molin # # ## Primary strings S2 BLOCK_DEVICE: Fel %1 enhet %A: %2 omrde: %3 S3 CHAR_DEVICE: Fel %1 enhet %A: %3 ## kind of operation S0 READ: lser frn S1 WRITE: skriver till ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: Rot S7 DATA: Data ## action strings S8 IGNORE: (I)gnorera S9 RETRY: (N)ytt frsk S10 ABORT: (A)vbryt S11 FAIL: (M)isslyckas ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: nN KEYS_ABORT: aA KEYS_FAIL: mM ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Oknd fel-kod S15 0: frsk att bryta skrivskyddet 1: oknd typ fr drivrutin 2: enhet inte klar 3: drivrutin fick oknt kommando 4: datafel (fel CRC) 5: ogiltig strukturlngd p drivrutinsbegran 6: skfel 7: oknd mediatyp 8: sektorn hittades inte 9: slut p papper i skrivaren 10: skrivfel 11: lsfel 12: allmnt fel 13: delningsfel 14: ls fel 15: felaktigt diskbyte 16: FCB ej tillgnglig 17: verspill av delningsbuffert 18: kodsida stmmer inte 19: ingen indata 20: otillrckligt diskutrymme ================================================ FILE: strings/swedish.lng ================================================ # # # FreeCOM national customization file # # Language: Swedish / CP850 # Author: Oscar Molin # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH Felaktig vxel. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH Felaktig vxel. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION Ogiltig parameter: '%s' . :TEXT_ERROR_OPT_ARG '%s' kan inte ha ngra parametrar . :TEXT_ERROR_OPT_NOARG '%s' Mste ha en parameter . :TEXT_INVALID_NUMBER Ogiltigt nummer angivet i '%s' . :TEXT_ERROR_CLOSE_QUOTE Saknar omslutande citattecken: %c . :TEXT_ERROR_TEMPFILE Kunde inte skapa temporr fil . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Fr mnga parametrar. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Fr mnga parametrar. . :TEXT_ERROR_INVALID_PARAMETER Felaktig parameter. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Skvgen finns inte. . :TEXT_ERROR_FILE_NOT_FOUND Kunde inte hitta filen. . :TEXT_ERROR_SFILE_NOT_FOUND Kunde inte hitta filen. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING Erfordrad parameter saknas. . :TEXT_ERROR_INVALID_DRIVE Felaktig enhet %c:. . :TEXT_ERROR_BADCOMMAND#2 Felaktigt kommando eller filnamn - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Det finns inte tillrckligt med minne. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Allokering av DOS-minne misslyckades. . :TEXT_ERROR_CANNOTPIPE Kan inte ppna temporr fil! . :TEXT_ERROR_LONG_LINE_BATCHFILE Rad #%ld i kommandofil '%s' r fr lng. . :TEXT_ERROR_BFILE_VANISHED Kommandofil '%s' hittades inte. . :TEXT_ERROR_BFILE_LABEL Kommandofil '%s' innehller inte etiketten '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s misslyckades fr '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR Kunde inte ange miljvariabeln '%s'. Miljomrdet fullt? . :TEXT_ERROR_ENV_VAR_NOT_FOUND Miljvariabeln '%s' hittades inte. . :TEXT_ERROR_NO_ENVIRONMENT Inget miljomrde. Minnet kanske r slut. Ange /E vxeln. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 Kan inte ange alias '%s'. Alias kanske r full? . :TEXT_ERROR_ALIAS_NOT_FOUND#1 Alias '%s' hittades inte. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Inget alias-utrymme. Minnet kan vara slut. . :TEXT_ERROR_SYNTAX_STR Syntaxfel. - '%s' . :TEXT_ERROR_SYNTAX Syntaxfel. . :TEXT_ERROR_FILENAME_TOO_LONG Filnamnet r fr lngt. - '%s' . :TEXT_ERROR_SELFCOPY Kan inte kopiera '%s' till sig sjlv . :TEXT_ERROR_COMMAND_TOO_LONG Kommandoraden fr lng efter aliasutkning! . :TEXT_ERROR_LINE_TOO_LONG Raden r fr lng. Kan inte kra kommando. . :TEXT_ERROR_HISTORY_SIZE#1 Felaktig storlek '%s'. . :TEXT_HISTORY_EMPTY#1 Det inga lagrade kommandon hittades. . :TEXT_ERROR_BAD_MCB_CHAIN MCB kedja korrupt, eller inte FreeDOS-kompatibelt system. . :TEXT_ERROR_UNDEFINED_ERROR Oknt fel %d. . :TEXT_ERROR_REGION_WARNING Ogiltig minnesregion %d - ignoreras. . :TEXT_ERROR_ON_OR_OFF ON eller OFF mste anges. . :TEXT_ERROR_BAD_VARIABLE Felaktig variabel angiven. . :TEXT_ERROR_IN_MISSING#1 FOR: IN saknas. . :TEXT_ERROR_MISSING_PARENTHESES#1 En eller bda parenteserna saknas. . :TEXT_ERROR_DO_MISSING#1 FOR: DO saknas. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Inget kommando efter DO. . :TEXT_ERROR_REDIRECT_FROM_FILE Kan inte skicka indata frn filen '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE Kan inte skicka utdata till filen '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Tom omdirigering. . :TEXT_ERROR_INVALID_DATE Felaktigt datum. . :TEXT_ERROR_INVALID_TIME Felaktig tid. . :TEXT_ERROR_NO_GOTO_LABEL Ingen etikett angiven fr GOTO. . :TEXT_CTTY_NOTIMPLEMENTED CTTY-kommandot finns inte i denna COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE Felaktig eller ingen ls/skriv-enhet '%s'. . :TEXT_ERROR_CTTY_DUP Kunde inte ndra filbeskrivning fr TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L vxeln r nnu inte implementerad. . :TEXT_ERROR_U_NOTIMPLEMENTED /U vxeln r nnu inte implementerad. . :TEXT_ERROR_WRITING_DEST Kunde inte skriva till mlenhet. . :TEXT_ERROR_CANNOT_OPEN_SOURCE Kunde inte ppna mlenhet. - '%s' . :TEXT_ERROR_OPEN_FILE Kunde inte ppna filen '%s' . :TEXT_ERROR_READ_FILE Kunde inte lsa frn filen '%s' . :TEXT_ERROR_WRITE_FILE Kunde inte skriva till filen '%s' . :TEXT_ERROR_LEADING_PLUS Parametrar fr inte brja med ihopsttningstecknet '+'. . :TEXT_ERROR_TRAILING_PLUS Ihopsttningstecknet '+' fr inte spra parametrar. . :TEXT_ERROR_NOTHING_TO_DO Inget att utfra. . :TEXT_ERROR_COPY COPY misslyckades . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: filnamn saknas . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: nummer saknas . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: ogiltigt nummer . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Kommando saknas . :TEXT_NOT_IMPLEMENTED_YET Frlt oss...inte implementerat n. . :TEXT_FAILED_LOAD_STRINGS Kunde inte ladda meddelanden i minnet. . :TEXT_MSG_NOTIMPLEMENTED Vxeln /MSG har exkluderats frn COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1 %u objekt visas. . :TEXT_CORRUPT_COMMAND_LINE Korrupt kommandorad. Detta r ett internt fel som r relaterat till det system som COMMAND.COM krs i. Var god rapportera detta fel. . :TEXT_QUOTED_C_OR_K#1 Vxlarna /C och /K fr inte omslutas av citattecken, de ignorerades. . :TEXT_INIT_FULLY_QUALIFIED#1 Skvgen fr COMMAND.COM mste vara fullstndig! Det betyder att den ska innehlla enhetsbokstav och brja med ett baktsnedstreck. Till exempel: C:\\FDOS COMMAND.COM antar nu denna skvg: %s . :TEXT_ERROR_RESTORE_SESSION Sessions-informationen kunde inte terstllas, alla lokala instllningar har gtt frlorade. Se felmeddelanden ovan fr anledningen till detta problem. . :TEXT_ERROR_SAVE_SESSION Aktuell information kan inte sparas nr programmet anvnds. Se felmeddelanden ovan fr anledningen till detta problem. . :TEXT_ERROR_CWD_FAILED Enhet %c: svarar inte eller det interna minnet r slut. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Speglingen misslyckades: Alias allokerar fr mycket minne. . :TEXT_ERROR_KSWAP_ALLOCMEM Speglingen misslyckades: Kunde inte allokera bortre minnet. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Slut p alias-utrymme. . :TEXT_ERROR_ALIAS_NO_SUCH#1 Alias finns inte: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Kunde inte stta in alias. . :TEXT_ALIAS_INVALID_NAME#1 Ogiltigt namn p alias: '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Kunde inte ladda Context modulen eller Critical Error-hanteraren. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Context har slut p minne. Om felet kvarstr kan ni frska med att ka ngon intern buffer, som historikbufferten eller katalogstacken. . :TEXT_ERROR_CONTEXT_LENGTH#1 Storleken p context %lu byte verskrider max-sprren. ndrar storlek p context %u byte. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Kunde inte lgga till statusinformation till context. Detta fel kan indikera korrupt minne eller felaktig uppskattning av minimistorleken p context. Var god informera prefekten fr FreeCOM p: freecom@freedos.org . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Context-informationen r borta efter spegling. Context terskapas men alla alias etc. har gtt frlorade. . # # Informational messages # :TEXT_MSG_PAUSE#1 Tryck p valfri tangent fr att fortstta . . .\ . :TEXT_MSG_HISTORY_SIZE Historikbuffertens storlek r %d byte. . :TEXT_MSG_DOSKEY DOSKEY funktioner r redan aktiverade i prompten. . :TEXT_MSG_ECHO_STATE ECHO r %s . :TEXT_MSG_VERIFY_STATE VERIFY r %s . :TEXT_MSG_FDDEBUG_STATE DEBUG utmatning r %s. . :TEXT_MSG_FDDEBUG_TARGET DEBUG utmatning skrivs ut till '%s'. . :TEXT_MSG_BREAK_STATE BREAK r %s . :TEXT_MSG_CURRENT_DATE Nuvarande datum r %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Skriv in nytt datum (mm%sdd%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Skriv in nytt datum (dd%smm%s[cc]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Skriv in nytt datum ([cc]yy%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME Nuvarande tid r %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Skriv in ny tid: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 JjNn{CR}{LF}{CBREAK} aabb b b b Alla filer i '%s' kommer att tas bort! Vill ni frtstta (J/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 JjNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [Ja=RETUR, Ja=ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 JaNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Ctrl+Break.\r Avbryt kommandofil '%s' (Ja/Nej/Avbryt alla) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 JjNnAaFf{BREAK}{ENTER}{ESC} aabbccdd d a b Skriv ver '%s' (Ja/Nej/Alla/Fortstt) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 JjNnAaFf{BREAK}{ENTER}{ESC} aabbccdd d a b Ta bort '%s' (Ja/Nej/Alla/Fortstt) ? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Katalogstacken r tom. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 Volymen i enhet %c \ . :TEXT_DIR_HDR_VOLUME_STRING r %s . :TEXT_DIR_HDR_VOLUME_NONE saknar etikett . :TEXT_DIR_HDR_SERIAL_NUMBER Volymen har serienummer %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s fil(er)\ . :TEXT_DIR_FTR_BYTES %12s byte . :TEXT_DIR_FTR_TOTAL_NUMBER Totalt antal visade filer: . :TEXT_DIR_FTR_DIRS#1 %10s kat\ . :TEXT_DIR_FTR_BYTES_FREE %15s byte lediga . :TEXT_DIR_DIRECTORY Katalog i %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Katalog i %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH PATH=%s . :TEXT_MSG_PATH_NONE#1 Ingen katalog att ska i. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Sn\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Mn\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Tis\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Ons\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Tor\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Fre\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Lr\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 ingen fil togs bort. . :TEXT_MSG_DEL_CNT_FILES_1#1 en fil togs bort. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u filer togs bort. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Tillgngliga interna kommandon: . :TEXT_MSG_SHOWCMD_FEATURES Tillgngliga funktioner: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [alias] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [utkad inmatning] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [historik] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [filnamns-komplettering] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [spegling] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [start-loggning] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [fregende katalog] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [krnspegling] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS-spegling] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [spegling som standard] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [kommandon att installera] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [katalogstack (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM debug] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Tryck F8 fr sprningslge, eller F5 fr att hoppa ver %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC Hoppar ver '%s'. . :TEXT_MSG_VER_DOS_VERSION DOS version %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS-krna (bygge 1933 eller tidigare) . :TEXT_MSG_VER_LATER_FREEDOS FreeDOS-krna version %d.%d.%d . :TEXT_MSG_VER_WARRANTY Copyright (C) 1994-2001 Tim Norman och andra. Detta program distribueras i hop om att det ska vara anvndbart, men UTAN NGON GARANTI; utan ens pstdd garanti om att det PASSAR FR ETT VISST SYFTE. Se GNU General Public License fr mer detaljer. Felrapporter skickas till freedos-freecom@lists.sourceforge.net. Uppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION Copyright (C) 1994-2001 Tim Norman och andra. Detta 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. Felrapporter skickas till freedos-freecom@lists.sourceforge.net. Uppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS FreeDOS kommandoprompt har utvecklats av mnga personer, se HISTORY.TXT fr mer detaljerad information. Nuvarande prefekt r Steffen Kaiser mailto:freecom@freedos.org Felrapporter skickas till freedos-freecom@lists.sourceforge.net. Uppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Kommandoprompten hller p att avslutas, trots att detta\r r frbjudet (vanligtvis genom att anvnda "/P" vxeln).\r Ni mste starta om datorn, eller om prompten krs i en \r multitaskingsmilj, stnga av processen manuellt.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM:s programfil hittades inte. Ni mste ange fullstndig skvg till COMMAND.COM som frsta parameter i COMMAND, till exempel: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1 Miljsegment : max %5u byte; ledigt %5u byte . :TEXT_MEMORY_CONTEXT#1 Kontext-segment : max %5u byte; ledigt %5u byte . :TEXT_MEMORY_HEAP#1 Heap : ledigt %5lu byte . :TEXT_MEMORY_CTXT_ALIAS#1 \tAlias : grns %5u byte, nuvarande %5u byte, %5u objekt . :TEXT_MEMORY_CTXT_HISTORY#1 \tHistorik : grns %5u byte, nuvarande %5u byte, %5u objekt . :TEXT_MEMORY_CTXT_DIRSTACK#1 \tKatalogstack : grns %5u byte, nuvarande %5u byte, %5u objekt . :TEXT_MEMORY_CTXT_LASTDIR#1 \tFregende kat : anvnt %5u byte, %5u objekt . :TEXT_MEMORY_CTXT_BATCH#1 \tKommandonstling : anvnt %5u byte, %5u objekt . :TEXT_MEMORY_CTXT_SWAPINFO#1 \tSpelingsinfo : anvnt %5u byte, %5u objekt . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Kunde inte hmta kodsida frn systemet. . :TEXT_ERROR_SET_CODEPAGE#1 Kunde inte ndra aktuellt kodsida. . :TEXT_DISPLAY_CODEPAGE#1 Aktuell kodsida r %u. Systemets kodsida r: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Visar, anger eller tar bort alias. ALIAS [variabel[=][strng]] variabel Anger namn p alias. strng Anger en serie tecken som ges till alias. ALIAS utan parametrar visar aktuella alias. . :TEXT_CMDHELP_BEEP Gr ett pip-ljud. . :TEXT_CMDHELP_BREAK Anger eller tar bort utkad CTRL+C kontroll. BREAK [ON | OFF] BREAK utan parametrar visar aktuellt BREAK-instllning. . :TEXT_CMDHELP_CALL#1 Anropar ett kommandofil frn ett annat. CALL [/S | /N] [/Y] [enhet:][skvg]filnamn [kommandofilsparametrar] kommandofilsparametrar Anger kommandoradsinformation som kommandofilen behver. /S tvingar, /N frbjuder spegling av FreeCOM. /Y aktiverar sprningslge under utfrandet av kommandot. . :TEXT_CMDHELP_CD Visar namnet p, eller ndrar, aktuell katalog. CHDIR [enhet:][skvg] CHDIR[..] CD [enhet:][skvg] CD[..] CD - .. Anger att ni nskar ndra aktuell katalog moderkatalogen. - Om "fregende katalog"-funktionen r p byts aktuell katalog ut med fregende katalog. CD enhet: visar vilken katalog som r den aktuella p angiven enhet. CD utan parametrar visar aktuell enhet och katalog. Se ven: CDD . :TEXT_CMDHELP_CDD Visar namnet p, eller ndrar, aktuell katalog och enhet. CDD [enhet:][skvg] CDD[..] .. Anger att ni nskar ndra aktuell katalog moderkatalogen. - Om "fregende katalog"-funktionen r p byts aktuell katalog ut med fregende katalog. Om enhet: anges ndras aktuell arbetsenhet; detta r den enda skillnaden jmfrt mot "CHDIR". CDD utan parametrar visar aktuell enhet och katalog. . :TEXT_CMDHELP_CHCP Visar eller anger nummer fr aktiv kodsida. CHCP [nnn] nnn Anger ett nummer fr en kodsida. CHCP utan parametrar visar nummer fr aktiv kodsida. . :TEXT_CMDHELP_CLS Rensar skrmen. CLS . :TEXT_CMDHELP_COMMAND Startar en ny kopia av FreeCOM kommandoprompt. COMMAND [[enhet:]skvg] [enhet] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] kommando]] [enhet:]skvg Anger skvg som innehller COMMAND.COM. enhet Anger en hrdvaruenhet att anvnda fr indata och utdata. /E:nnnnn Anger startstorleken p miljn till nnnnn byte. (nnnnn br vara mellan 256 och 32,768). /L:nnnn Anger lngd p interna buffertar (krver /P). (nnnn br vara mellan 128 och 1,024). /U:nnn Anger buffertlngd fr indata (krver /P). (nnn br vara mellan 128 och 255). /P Gr den nya kommandoprompten permanent (kan ej avslutas). /MSG Lagrar alla felmeddelanden i minnet (krver /P). /LOW Resident data behlls i det lga minnesomrdet. /Y Stegar igenom kommandofil med /C eller /K. /C kommando Utfr angivet kommando och tergr till programmet. /K kommando Utfr angivet kommando och fortstter kra.. . :TEXT_CMDHELP_COPY Kopierar en eller flera filer till en annan plats COPY [/A | /B] klla [/A | /B] [+ klla [/A | /B] [+ ...]] [ml [/A | /B]] [/V] [/Y | /-Y] klla Anger den eller de filer som ska kopieras. /A Indikerar att filen r en ASCII-textfil. /B Indikerar att filen r en binr fil. klla Anger katalog och/eller filnamn fr de nya filerna. /V Verifierar att nya filer skrivs korrekt. /Y Bekrftelse krvs inte fr att skriva ver en befintlig fil /-Y Bekrftelse krvs fr att skriva ver en befintlig fil Vxeln /Y kan vara frinstlld i miljvariabeln COPYCMD. Det kan sidosttas med /-Y i kommandoraden Lgg ihop filer genom att ange en enstaka fil som ml men flera som klla (anvnd jokertecken eller formatet fil1+fil2+fil3). . :TEXT_CMDHELP_CTTY ndrar den enhet som anvnds fr att kontrollera systemet. CTTY enhet enhet Enheten ni vill anvnda, t ex COM1. . :TEXT_CMDHELP_DATE#1 Visar eller anger datum DATE [/D] [datum] DATE utan parametrar visar aktuellt datum och frgar efter ett nytt. Tryck RETUR fr att behlla samma datum. /D hindrar DATE frn att bli interaktivt. . :TEXT_CMDHELP_DEL#2 Tar bort en eller flera filer. DEL [enhet:][skvg]filnamn [/P] [/V] ERASE [enhet:][skvg]filnamn [/P] [/V] [enhet:][skvg]filnamn Anger fil eller filer att ta bort. Flera filer anges med jokertecken. /P Krver bekrftelse vid borttagning av fil. /V Visar alla borttagna filer. . :TEXT_CMDHELP_DIR#4 Visar en lista med filer och underkataloger i en katalog. DIR [enhet:][skvg][filnamn] [/P] [/W] [/A[[:]attribut]] [/O[[:]sortorder]] [/S] [/B] [/L] [enhet:][skvg][filnamn] Anger enhet, katalog och/eller filer att visa. (Kan vara utkad eller flertalig filspecifikation) /P Visar en del i taget av listan, om denna inte ryms p skrmen. /W Visar filer och kataloger i kolumner. /A Visar endast filer med angivet attribut. (standard r /ADHSRA) attribut D Kataloger R Skrivskyddade filer H Dolda filer A Arkivklara filer S Systemfiler - Prefix fr inte /O Ger lista enligt sortorder. sortorder N Efter namn (alfabetisk) S Efter storlek (minst frst) E Efter tillgg (alfabetisk) D Datum och tid (ldst frst) G Gruppera kataloger frst - Prefix fr omvnd ordning U Osorterade (Standard r /ONG) /S Visar filer i angiven katalog och filerna i dess underkataloger. /B Enkelt format (Ingen inledande information och sammanfattning). /L Anvnder gemener. /Y eller /4 Visa 4-siffriga rtal. Vxlar kan frinstllas med miljvariabeln DIRCMD. sidostt dessa vxlar med - (bindestreck), till exempel /-W. . :TEXT_CMDHELP_DOSKEY#1 Det externa DOSKEY-verktyget finns inbyggt i FreeCOM. Anvnd UPP- och NEDPIL fr att terkalla historiken och HISTORY fr att visa den. Anvnd VNSTER- och HGERPIL samt END och HOME fr att navigera inom kommandoraden och anvnd INSERT fr att vxla mellan verskrivnings- och infogningslge. Tryck TAB fr att komplettera aktuellt ord som filnamn; tryck tv gnger fr att visa alla matchande filer. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Redigerar kommandorader, terkallar kommandorader, och skapar makron DOSKEY [/vxel ...] [makronamn=[text]] /BUFSIZE:storlek Anger storlek p makro- och kommandobufferten (standard:512) /ECHO:ON|OFF Anger ECHO ON/OFF i makron (standard:ON) /FILE:fil Anger fil med lista ver makron /HISTORY Visar alla kommandon som lagrats i minnet /INSERT Stter in nya tecken i raden nr ni skriver /KEYSIZE:storlek Anger storleken p tangentbordets type-ahead-buffert (standard:15) /LINE:storlek Anger maximal storlek p radredigerings buffert (standard:128) /MACROS Visar alla DOSKey-makron /OVERSTRIKE Skriver ver gamla tecken med nya nr ni skriver (standard) /REINSTALL Installerar en ny kopia av DOSKey makronamn Namnet p makrot som skapas text Kommandon som ni vill ha i makron UPP- och NEDPIL terkallar kommandon ESC tar bort aktuellt kommando F7 visar lagrade kommandon Alt+F7 tar bort lagrade kommandon [tecken]F8 sker efter kommando som brjar med [tecken] F9 vljer kommando med nummer Alt+F10 rensar alla makrodefinitioner Specialkoder ni kan anvnda i DOSKey makrodefinitioner: $T Kommando separator: tillter flera kommandon i samma makro $1-$9 kommandofilsparametrar: likvrdiga med %1-%9 i kommandofil $* Utvidgad till allt som str p kommandoraden efter makrots namn . :TEXT_CMDHELP_ECHO Visar meddelanden, eller styr hurvida kommandon som krs ska visas visas p skrmen. ECHO [ON | OFF] ECHO [meddelande] ECHO utan parametrar visar aktuell ECHO-instllning. . :TEXT_CMDHELP_EXIT Avslutar FreeDOS kommandoprompt. EXIT . :TEXT_CMDHELP_FOR Kr angivet kommando fr varje fil i en grupp av filer. FOR %variabel IN (grupp) DO kommando [kommandoparametrar] %variabel Anger en utbytbar parameter. (grupp) Anger en eller flera filer. Jokertecken fr anvndas. kommando Anger kommandot som ska utfras fr varje fil. kommandoparametrar Anger parametrar och/eller vxlar fr det angivna kommandot. Fr att anvnda FOR kommandot i ett kommandofil, ange %%variabel istllet fr %variabel. . :TEXT_CMDHELP_GOTO Styr kommandoprompten till en rad med given etikett i ett kommandofil. GOTO etikett etikett Anger en textstrng som anvnds i kommandofil som etikett. Ni skriver etiketten fr sig sjlv p en rad, med ett kolon fre. . :TEXT_CMDHELP_HISTORY#1 Historikkommando. HISTORY [storlek] Utan "storlek" visas det aktuella innehllet i historikbufferten fr kommandoraden. Med "storlek" s ndras storleken p historikbufferten. . :TEXT_CMDHELP_IF Kr ett kommando i ett kommandoprogram om ett villkor r sant. IF [NOT] ERRORLEVEL tal kommando IF [NOT] strng1==strng2 kommando IF [NOT] EXIST filnamn kommando NOT Anger att kommandoprompten ska utfra kommandot bara om villkoret r falskt. ERRORLEVEL tal Anger att villkoret r sant om det sista programmet som krts returnerat en slutkod som r lika med eller strre n det angivna talet. kommando Anger ett kommando som ska utfras om villkoret har uppntts. strng1==strng2 Anger att villkoret r sant om de angivna textstrngarna r lika. EXIST filnamn Anger att villkortet r sant om det angivna filnamnet existerar. . :TEXT_CMDHELP_LH Laddar ett program till det vre minnesomrdet. LOADHIGH [enhet:][skvg]filnamn [parametrar] LOADHIGH [/L:region1[,minstorlek1][;region2[,minstorlek2]...] [/S]] [enhet:][skvg]filnamn [parametrar] /L:region1[,minstorlek1][;region2[,minstorlek2]]... Anger de regioner av minnet dit programmet ska laddas. Region1 Anger numret fr den frsta minnesregionen; minstorlek1 anger minimistorleken, om ngon, fr region1. Region2 and minstorlek2 anger nummer och minimistorlek fr den andra regionen osv. Ni kan ange hur mnga regioner ni vill. /S Krymper en UMB till minimal storlek medans programmet laddas. [enhet:][skvg]filnamn Anger plats och namn fr programmet. . :TEXT_CMDHELP_LOADFIX Laddar ett program ovanfr de frsta 64K i minnet, och kr programmet. LOADFIX [enhet:][skvg]filnamn Anvnd LOADFIX fr att ladda ett program om ni har ftt meddelandet "Packad fil korrupt" nr det laddas i det lgre minnesomrdet. . :TEXT_CMDHELP_MD Skapar en katalog. MKDIR [enhet:]skvg MD [enhet:]skvg . :TEXT_CMDHELP_PATH Visar eller anger de kataloger i vilka FreeCOM sker efter krbara filer. PATH [[enhet:]skvg[;...]] PATH ; Skriv PATH ; om ni vill rensa alla skvgsinstllningar och bara ska i den aktuella katalogen. PATH utan parametrar visar aktuell skvg. . :TEXT_CMDHELP_PAUSE Avbryter bearbetningen av ett kommandoprogram och visar meddelandet: "Tryck p valfri tangent fr att fortstta..." eller valfritt eget meddelande. PAUSE [meddelande] . :TEXT_CMDHELP_PROMPT ndrar kommandoprompten. PROMPT [text] text Bestmmer den nya promptens utseende. Prompten kan best av vanliga tecken och fljande specialtecken: $Q = (lika med-tecken) $$ $ (dollartecken) $T Aktuell tid $D Aktuellt datum $P Aktuell enhet och skvg $V FreeDOS kommandoprompts versionsnumber $N Aktuell enhet $G > (strre n-tecken) $L < (mindre n-tecken) $B | (vertikalstreck) $H Backsteg (raderar fregende tecken) $E Escape-tecken (ASCII-kod 27) $_ Vagnretur och ny rad PROMPT utan parametrar terstller promptens standardutseende. . :TEXT_CMDHELP_PUSHD Lgger nuvarande katalog till katalogstacken, med valet att ndra nuvarande arbetskatalog. PUSHD [[enhet:]skvg] Dr [enhet:]skvg r en skvg till det ni vill ndra. . :TEXT_CMDHELP_POPD Tar en katalog frn katalogstacken, och ndras till den. POPD [*] Jockertecken ('*') parametern rensar katalogstacken. . :TEXT_CMDHELP_DIRS Visar innehllet i en katalog. DIRS . :TEXT_CMDHELP_RD Tar bort en katalog. RMDIR [enhet:]skvg RD [enhet:]skvg . :TEXT_CMDHELP_REM Markerar kommentarer i ett kommandoprogram eller CONFIG.SYS. REM [kommentar] . :TEXT_CMDHELP_REN Byter namn p en eller flera filer/kataloger. RENAME [enhet:][skvg][katalognamn1 | filnamn1] [katalognamn2 | filnamn2] REN [enhet:][skvg][katalognamn1 | filnamn1] [katalognamn2 | filnamn2] Ni kan inte ange enhet eller skvg fr mlfil/katalog. Anvnd kommandot MOVE fr detta syfte. . :TEXT_CMDHELP_SET#1 Visar, anger eller tar bort miljvariabler. SET [/C] [/P] [variabel=[strng]] variabel Anger miljvariabelns namn. strng Anger en serie tecken som tilldelas variabeln * Om ingen strng anges tas angiven miljvariabel bort. SET utan parametrar visar aktuella miljvariabler. /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. /P Frgar anvndaren efter en strng som sen ges till variabeln. . :TEXT_CMDHELP_SHIFT#1 ndrar numreringen av de utbytbara parametrarna i kommandoprogram. SHIFT [DOWN] DOWN Flyttar parameter mot brjan (%%0); annars mot slutet. . :TEXT_CMDHELP_TIME#1 Visar eller stller in systemklockan. TIME [/T] [tid] Skriv TIME utan parametrar fr att visa nuvarande tidsinstllning och frga efter ny instllning. Tryck RETUR fr att behlla samma tid. /T hindrar TIME frn att bli interaktiv. . :TEXT_CMDHELP_TRUENAME Visar hela skvgen fr given skvg. TRUENAME [enhet:][skvg][filnamn] . :TEXT_CMDHELP_TYPE Visar innehllet i textfiler. TYPE [enhet:][skvg]filnamn . :TEXT_CMDHELP_VER Visar FreeDOS kommandoprompt version och annan information. VER [/R] [/W] [/D] [/C] /R Visar krnversion och annan information. /W FreeDOS kommandoprompt garanti. /D FreeDOS kommandoprompt omdistributionsinformation. /C FreeDOS kommandoprompt medhjlpare. . :TEXT_CMDHELP_VERIFY Sger t FreeDOS-filsystemet att verifiera att data skrivs korrekt p disken. VERIFY [ON | OFF] Skriv VERIFY utan parametrar fr att visa nuvarande VERIFY-instllning. . :TEXT_CMDHELP_FDDEBUG Om debug (felskning) r inkompilerat i FreeDOS, s kan detta kommando stnga av eller sl p utmatning av debug-information, eller visa om det r ON eller OFF. FDDEBUG [ON | OFF | fil] Skriv FDDEBUG utan parameter fr att visa nuvarande instllningar fr utmatning av debug-information. Om en fil specificeras kommer all debug-information att skickas till den filen; utmatningen lggs till sist i filen, om den redan finns. De speciella namnen "stdout" och "stderr" kan anvndas fr att vidarebefordra utmatningen till strmmen standard out eller standard error. . :TEXT_CMDHELP_VOL Visar diskens volymetikett och serienummer, om de finns. VOL [enhet:] . :TEXT_CMDHELP_QUESTION#1 Visar en lista p kommandon och funktioner som finns tillgngliga i prompten. ? ?kommando [parameter] Den frsta varianten visar tillgngliga interna kommandon och funktioner. Den andra kommer frga om det givna kommandot ska kras som om sprningslge vore aktiverat. . :TEXT_CMDHELP_WHICH Sker och visar den exekverbara filen fr varje givet kommando. WHICH {kommando} . :TEXT_CMDHELP_MEMORY#1 Visar det interna minnet som anvnds av FreeCOM internt MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 Mlet fr COPY fr inte innehlla plus ('+') tecken. . :TEXT_DELETE_FILE#1 Tar bort fil "%s". . ================================================ FILE: strings/turkish.err ================================================ # $Id$ # # Critical error national customization file # # Language: Turkish # Codepage: ASCII (7bit) / CP857 # Author: Emir SARI # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: Hata - %1 %A srcs: %2 alan: %3 S3 CHAR_DEVICE: Hata - %1 %A srcs: %3 ## kind of operation S0 READ: Okunma konumu: S1 WRITE: Yazlma konumu: ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: Kk S7 DATA: Veri ## action strings S8 IGNORE: (Y)ok say S9 RETRY: Yeniden (d)ene S10 ABORT: (p)tal S11 FAIL: (B)aarsz say ## keys associated with the actions S14 (compacted) KEYS_IGNORE: yY KEYS_RETRY: dD KEYS_ABORT: pP KEYS_FAIL: bB ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Bilinmeyen hata kodu S15 0: Yazma korumas ihlal giriimi 1: Src iin bilinmeyen birim 2: Src hazr deil 3: Srcye bilinmeyen bir komut verildi 4: Veri hatas (yanl CRC) 5: Yanl aygt srcs talep yaps boyutu 6: Arama hatas 7: Bilinmeyen ortam tr 8: Kesim bulunamad 9: Yazcda kt kalmad 10: Yazma hatas 11: Okuma hatas 12: Genel sorun 13: Paylam ihlali 14: Kilitleme ihlali 15: Geersiz disk deiimi 16: FCB mevcut deil 17: Paylam nbellei yetersiz 18: Sayfa kodu uyumazl 19: Giri sonu 20: Yetersiz disk alan ================================================ FILE: strings/turkish.lng ================================================ # $Id: DEFAULT.lng 1277 2006-09-04 19:40:42Z blairdude $ # # FreeCOM national customization file # # Language: Turkish # Codepage: ASCII (7bit) / CP857 # Author: Emir SARI # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retrieve the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # If there is a percent sign (%) appended to the version, the printf() # format string %-style placeholders are compared for the strings. The # sign need to be set in DEFAULT.lng only. # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carriage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause a user interaction. Those ones should be in sync # with the issued text. To define how to interpret a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitrary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readability of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH#0% Geersiz anahtar. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH#0% Geersiz anahtar. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION#0% Yanl oluturulmu seenek: '%s' . :TEXT_ERROR_OPT_ARG#0% '%s' seeneinin bamsz deikeni olamaz. . :TEXT_ERROR_OPT_NOARG#0% '%s' seeneinin bamsz bir deikeni olmal. . :TEXT_INVALID_NUMBER#0% '%s' gesinde geersiz say belirtimi. . :TEXT_ERROR_CLOSE_QUOTE#0% Eksik kapatma trnak imi: %c . :TEXT_ERROR_TEMPFILE Geici dosya oluturulamad. . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0% ok fazla parametre. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS ok fazla parametre. . :TEXT_ERROR_INVALID_PARAMETER#0% Geersiz parametre. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Yol bulunamad. . :TEXT_ERROR_FILE_NOT_FOUND Dosya bulunamad. . :TEXT_ERROR_SFILE_NOT_FOUND#0% Dosya bulunamad. - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING#0% Gerekli parametre eksik. . :TEXT_ERROR_INVALID_DRIVE#0% Geersiz src %c:. . :TEXT_ERROR_BADCOMMAND#2% Yanl komut veya dosya ad - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Bellek yetersiz hatas. .BATCHFILE :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 DOS belleinin ayrlmas baarsz oldu. . :TEXT_ERROR_CANNOTPIPE Kanal oluturulamad! Geici dosya alamad! . :TEXT_ERROR_LONG_LINE_BATCHFILE#0% '%s' toplu i dosyasnda #%ld. satr ok uzun. . :TEXT_ERROR_BFILE_VANISHED#0% Toplu i dosyas '%s' bulunamad. . :TEXT_ERROR_BFILE_LABEL#0% '%s' toplu i dosyas, '%s' etiketini iermemekte. . :TEXT_ERROR_DIRFCT_FAILED#1% %s, '%s' iin baarsz oldu. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR#0% '%s' ortam deikeni ayarlanamad. Ortam dolu olmasn? . :TEXT_ERROR_ENV_VAR_NOT_FOUND#0% '%s' ortam deikeni bulunamad. . :TEXT_ERROR_NO_ENVIRONMENT Ortam yok. Bellek yetersiz olabilir. /E seeneini belirtin. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1% '%s' armas ayarlanamad '%s'. Arma alan dolu olmasn? . :TEXT_ERROR_ALIAS_NOT_FOUND#1% '%s' armas bulunamad. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Arma alan yok. Bellek yetersiz olabilir. . :TEXT_ERROR_SYNTAX_STR#0% Szdizim hatas. - '%s' . :TEXT_ERROR_SYNTAX Szdizim hatas. . :TEXT_ERROR_FILENAME_TOO_LONG#0% Dosya ad ok uzun. - '%s' . :TEXT_ERROR_SELFCOPY#0% '%s' kendi zerine kopyalanamaz. . :TEXT_ERROR_COMMAND_TOO_LONG Arma geniletilmesinden sonra komut satr ok uzun! . :TEXT_ERROR_LINE_TOO_LONG Komut satr 125 karakterden uzun. . :TEXT_ERROR_HISTORY_SIZE#1% Geersiz tarihe boyutu '%s'. . :TEXT_HISTORY_EMPTY#1 Komut satr tarihesi bo. . :TEXT_ERROR_BAD_MCB_CHAIN MCB zinciri bozuk, veya MS-DOS ile uyumlu olmayan bir sistem. . :TEXT_ERROR_UNDEFINED_ERROR#0% Tanmsz hata %d. . :TEXT_ERROR_REGION_WARNING#0% Geersiz bellek alan %d - yok sayld. . :TEXT_ERROR_ON_OR_OFF ON veya OFF belirtilmesi gerekiyor. . :TEXT_ERROR_BAD_VARIABLE Yanl deiken belirtildi. . :TEXT_ERROR_IN_MISSING#1 FOR: IN eksik. . :TEXT_ERROR_MISSING_PARENTHESES#1 Bir veya her iki parantez eksik. . :TEXT_ERROR_DO_MISSING#1 FOR: DO eksik. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: DO ardndan hibir komut girilmemi. . :TEXT_ERROR_REDIRECT_FROM_FILE#0% kt, '%s' dosyasndan ynlendirilemedi. . :TEXT_ERROR_REDIRECT_TO_FILE#0% kt, '%s' dosyasna ynlendirilemedi. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Bo yeniden ynlendirme. . :TEXT_ERROR_INVALID_DATE Geersiz tarih. . :TEXT_ERROR_INVALID_TIME Geersiz zaman. . :TEXT_ERROR_NO_GOTO_LABEL GOTO iin hibir etiket belirtilmemi. . :TEXT_CTTY_NOTIMPLEMENTED CTTY komutu bu COMMAND.COM'dan hari tutuldu. . :TEXT_ERROR_NORW_DEVICE#0% '%s' geersiz veya okuma-yazma aygt deil. . :TEXT_ERROR_CTTY_DUP#0% Dosya tanmlayclarn '%s' TTY'ye deitirilmeleri baarsz. . :TEXT_ERROR_L_NOTIMPLEMENTED /L henz eklenmemi. . :TEXT_ERROR_U_NOTIMPLEMENTED /U henz eklenmemi. . :TEXT_ERROR_WRITING_DEST Hedefe yazma srasnda hata. . :TEXT_ERROR_CANNOT_OPEN_SOURCE#0% Kaynan almas baarsz oldu. - '%s' . :TEXT_ERROR_OPEN_FILE#0% '%s' dosyas alamad . :TEXT_ERROR_READ_FILE#0% '%s' dosyasndan okuma baarsz oldu . :TEXT_ERROR_WRITE_FILE#0% '%s' dosyasna yazma baarsz oldu . :TEXT_ERROR_LEADING_PLUS Birletirme karakteri '+' bamsz deikenlerin nnde olamaz. . :TEXT_ERROR_TRAILING_PLUS Birletirme karakteri '+' bamsz deikenlerin sonunda olamaz. . :TEXT_ERROR_NOTHING_TO_DO Yaplacak bir ey yok. . :TEXT_ERROR_COPY COPY baarsz oldu. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: Eksik dosya ad. . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: Eksik say. . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: Geersiz say. . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: Eksik komut. . :TEXT_NOT_IMPLEMENTED_YET zr dileriz, zellik henz mevcut deil. . :TEXT_FAILED_LOAD_STRINGS letilerin bellee yklenmesi baarsz oldu. . :TEXT_MSG_NOTIMPLEMENTED /MSG seenei bu COMMAND.COM'dan dlanmtr. . :TEXT_MSG_ITEMS_DISPLAYED#1% %u ge grntlendi. . :TEXT_CORRUPT_COMMAND_LINE Bozuk komut satr. Bu dahili bir hatadr ve COMMAND.COM'un alt sistemle ilgilidir. Ltfen bu hatay rapor edin. . :TEXT_QUOTED_C_OR_K#1 /C ve /K seenekleri eklenemez, grmezden gelindiler. . :TEXT_INIT_FULLY_QUALIFIED#1% COMMAND.COM'a giden yolun tamamen belirtilmi olmas gerekmektedir! Bu, src harfinin kullanlmas ve ters eik izgi ile balanmas demektir. rnein: C:\\FREEDOS COMMAND.COM imdi bu yolu varsaymaktadr: %s . :TEXT_ERROR_RESTORE_SESSION Oturum verileri geri alnamad, tm yerel ayarlar kaybedildi. Ltfen bu sorunun sebebini renmek iin yukardaki hata iletilerini okuyun. . :TEXT_ERROR_SAVE_SESSION Gncel veriler programn arlnda muhafaza edilemedi. Ltfen bu sorunun sebebini renmek iin yukardaki hata iletilerini okuyun. . :TEXT_ERROR_CWD_FAILED#1% %c: srcs yant vermiyor. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Takas baarsz oldu: Armalar ok fazla bellek ayryor. . :TEXT_ERROR_KSWAP_ALLOCMEM Takas baarsz oldu: Uzak bellek ayrlamad. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Arma alan yetersiz. . :TEXT_ERROR_ALIAS_NO_SUCH#1% Byle bir arma yok: '%s' . :TEXT_ERROR_ALIAS_INSERT#1 Arma eklenmesi baarsz oldu. . :TEXT_ALIAS_INVALID_NAME#1% Geersiz arma ad '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Balam modl veya Kritik Hata Yneticisi yklenemedi. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Balam bellei yetersiz. Bu hata srerse herhangi bir i arabellei artrmay dnn, rnein tarihe, dizin yn vs. gibi. . :TEXT_ERROR_CONTEXT_LENGTH#1% Balamn boyutu %lu bayta eriiyor ve azami snr geiyor. Balam %u bayt olarak yeniden boyutlandrlyor. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Balama durum verileri eklenmesi baarsz oldu. Bu hata bellek bozukluunu veya yanl belirlenmi asgari balam boyutuna iaret edebilir. Ltfen FreeCOM gelitiricilerine u adresten bu konuda bilgi verin: freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Takas sonras balam eksik. Balam tekrar oluturuldu; ancak tm armalar vs. kaybedildi. . :TEXT_ERROR_PERMISSION_DENIED#1% %s: zin reddedildi . :TEXT_ERROR_NO_SUCH_FILE#1% %s: Byle bir dosya veya dizin yok . :TEXT_ERROR_UNKNOWN_ERROR#1% %s: Bilinmeyen hata . # # Informational messages # :TEXT_MSG_PAUSE#1 Srdrmek iin herhangi bir dmeye basn...\ . :TEXT_MSG_HISTORY_SIZE#0% Gemi boyutu %d bayt. . :TEXT_MSG_DOSKEY DOSKEY zellikleri halihazrda kabukta etkinletirilmi. . :TEXT_MSG_ECHO_STATE#0% ECHO: %s . :TEXT_MSG_VERIFY_STATE#0% VERIFY: %s . :TEXT_MSG_FDDEBUG_STATE#0% DEBUG kts: %s. . :TEXT_MSG_FDDEBUG_TARGET#0% DEBUG kts yazlma konumu: '%s'. . :TEXT_MSG_BREAK_STATE#0% BREAK: %s . :TEXT_MSG_LFNFOR_STATE#0% LFNFOR: %s . :TEXT_MSG_LFNFOR_COMPLETE_STATE#0% LFN Complete: %s . :TEXT_MSG_CURRENT_DATE#0% Gncel tarih: %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1% Yeni tarih gir (aa%sgg%s[yy]yy): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1% Yeni tarih gir (gg%saa%s[yy]yy): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1% Yeni tarih gir ([yy]yy%saa%sgg): \ . :TEXT_MSG_CURRENT_TIME#0% Gncel zaman: %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Yeni zaman gir: \ . # src-file target-file :TEXT_MSG_COPYING#0% %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1% EeHh{CR}{LF}{CBREAK} aabb b b b '%s' iindeki tm dosyalar silinecek! Emin misiniz [(E)vet/(H)ayr]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 EeHh{LF}{CR}{CBREAK}{ESC} aabb a a b b [(E)vet=ENTER, (H)ayr=ESC]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is used via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1% EeHhTtKk{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break'e basld.\r '%s' toplu i dosyas sonlandrlsn m [(E)vet/(H)ayr/(T)m]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1% EeHhTtKk{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' dosyasnn zerine yazlsn m [(E)vet/(H)ayr/(T)m/(k)]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_APPEND_FILE#1% EeHhTtKk{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' dosyasna eklensin mi [(E)vet/(H)ayr/(T)m/(k)]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1% EeHhTtKk{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' silinsin mi [(E)vet/(H)ayr/(T)m/(k)]? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Dizin yn bo. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1% %c srcsndeki birim \ . :TEXT_DIR_HDR_VOLUME_STRING#0% : %s . :TEXT_DIR_HDR_VOLUME_NONE blmnn bir etiketi yok . :TEXT_DIR_HDR_SERIAL_NUMBER#0% Birim seri numaras: %04X-%04X . :TEXT_DIR_FTR_FILES#1% %10s dosya\ . :TEXT_DIR_FTR_BYTES#0% %12s bayt . :TEXT_DIR_FTR_TOTAL_NUMBER Listelenen toplam dosya: . :TEXT_DIR_FTR_DIRS#1% %10s dizin\ . :TEXT_DIR_FTR_BYTES_FREE#0% %15s bayt bo . :TEXT_DIR_DIRECTORY#0% %s dizini . :TEXT_DIR_DIRECTORY_WITH_SPACE#0% %s dizini . :TEXT_DIR_LINE_FILENAME_WIDE#1% %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE#1% %s . :TEXT_DIR_LINE_FILENAME_SINGLE#1% %-13s\ . :TEXT_DIR_LINE_FILENAME#1% %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1% %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1% %-14s\ . :TEXT_MSG_PATH#0% PATH=%s . :TEXT_MSG_PATH_NONE#1 Hibir arama yolu tanmlanmam. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Paz\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Pzt\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Sal\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 ar\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Per\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Cum\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Cts\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 hibir dosya silinmedi. . :TEXT_MSG_DEL_CNT_FILES_1#1 bir dosya silindi. . :TEXT_MSG_DEL_CNT_FILES_2#1% %u dosya silindi. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Mevcut dahili komutlar: . :TEXT_MSG_SHOWCMD_FEATURES Mevcut zellikler: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [armalar] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [gelimi giri] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [tarihe] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [dosya ad tamamlanmas] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [takas] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [balang gnl] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [son dizin] \ . :TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1 [uzun dosya adlar] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [ekirdek takas] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [XMS takas] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [varsaylan takas olsun] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [kurulabilir komutlar] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [dizin yn (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [FreeCOM hata ayklamas] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 zleme kipi iin F8'e veya %s gesini atlamak iin F5'e basn... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0% '%s' atlanyor. . :TEXT_MSG_VER_DOS_VERSION#0% DOS srm %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS ekirdei (yap 1933 veya ncesi) . :TEXT_MSG_VER_LATER_FREEDOS#0% FreeDOS ekirdek srm %d.%d.%d . :TEXT_MSG_VER_WARRANTY Telif hakk (C) 1994-2005 Tim Norman ve dierleri. Bu program faydal olaca umuduyla, fakat HBR GARANT ERMEDEN; hatta TCAR ELVERLLK veya AMACA UYGUNLUK zmni garantileri de verilmeden sunulmaktadr. Daha fazla ayrnt iin GNU Genel Kamu Lisansn okuyunuz. Hata raporlarn u adrese gnderiniz: freedos-devel@lists.sourceforge.net. Gncellemeler https://github.com/FDOS/freecom adresinde mevcuttur . :TEXT_MSG_VER_REDISTRIBUTION Telif hakk (C) 1994-2005 Tim Norman ve dierleri. Bu program zgr yazlmdr, onu zgr Yazlm Vakfnn yaynlad GNU Genel Kamu Lisansnn ya 2. srm veya (sizin seiminize dayal olarak) herhangi bir daha yeni srm kapsamnda tekrar databilir ve/veya deitirebilirsiniz. Hata raporlarn u adrese gnderiniz: freedos-devel@lists.sourceforge.net. Gncellemeler https://github.com/FDOS/freecom adresinde mevcuttur . :TEXT_MSG_VER_DEVELOPERS FreeDOS Komut Kabuu birok programc tarafndan gelitirilmitir, ltfen HISTORY.TXT dosyasna bakn. Hata raporlar iin: freedos-devel@lists.sourceforge.net Gncellemeler iin: https://github.com/FDOS/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Kabuk sona erdirilmek zere ancak buna izin verilmiyor\r (genellikle "/P" seeneini etkinletirerek).\r Sistemi yeniden balatmanz veya eer bu kabuk oklu grev ortamnda\r altrlyorsa bu grev/ilemi elle sonlandrmanz gerekir.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 FreeCOM altrlabilir dosyas bulunamad. COMMAND.COM'a giden tam yolu COMMAND'n ilk bamsz deikeni olarak belirtmeniz gerekir, mesela: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1% Ortam segmenti : Azami %5u bayt; bo %5u bayt . :TEXT_MEMORY_CONTEXT#1% Balam segmenti : Azami %5u bayt; bo %5u bayt . :TEXT_MEMORY_HEAP#1% Yn : Bo %5lu bayt . :TEXT_MEMORY_CTXT_ALIAS#1% \tArmalar : Snr %5u bayt, gncel %5u bayt, %5u ge . :TEXT_MEMORY_CTXT_HISTORY#1% \tTarihe : Snr %5u bayt, gncel %5u bayt, %5u ge . :TEXT_MEMORY_CTXT_DIRSTACK#1% \tDizin yn : Snr %5u bayt, gncel %5u bayt, %5u ge . :TEXT_MEMORY_CTXT_LASTDIR#1% \tSon dizin yn : Kullanlan %5u bayt, %5u ge . :TEXT_MEMORY_CTXT_BATCH#1% \t ie toplu i : Kullanlan %5u bayt, %5u ge . :TEXT_MEMORY_CTXT_SWAPINFO#1% \tTakas bilgisi : Kullanlan %5u bayt, %5u ge . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Sistemden gncel kod sayfas alnamad. . :TEXT_ERROR_SET_CODEPAGE#1 Gncel kod sayfas deitirilemedi. . :TEXT_DISPLAY_CODEPAGE#1% Gncel kod sayfas: %u. Sistem kod sayfas (uygun ekilde): %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Armalar grntler, ayarlar, kaldrr. ALIAS [deiken[=][dize]] deiken Arma adn belirtir. dizi Armaya atanacak karakter serisini belirtir. Gncel armalar grntlemek iin parametresiz ALIAS yazn. . :TEXT_CMDHELP_BEEP Bip sesi karr. . :TEXT_CMDHELP_BREAK Geniletilmi CTRL+C denetimini etkinletirir veya kaldrr. BREAK [ON | OFF] Gncel BREAK ayarn grntlemek iin parametresiz BREAK yazn. . :TEXT_CMDHELP_CALL#1 Bir toplu i betiinden baka bir toplu i betiini arr. CALL [/S | /N] [/Y] [src:][yol]dosyaad [toplu-i-parametre] toplu-i-parametre toplu i betii iin gerekli verileri belirtir. FreeCOM takasn /S zorlar, /N kaldrr. /Y komutun altrlmas srasnda izleme kipini etkinletirir. . :TEXT_CMDHELP_CD Gncel dizini grntler veya deitirir. CHDIR [src:][yol] CHDIR[..] CD [src:][yol] CD[..] CD - .. Bir st dizine gitmek istediinizi belirtir. - Eer "son dizin" zelletirildiyse etkinletirildiyse, son dizine dn. Belirtilen srcde gncel dizini grntlemek iin CD src: yazn. Gncel src ve dizini grntlemek iin parametresiz CD yazn. Ayrca baknz: CDD . :TEXT_CMDHELP_CDD Gncel dizin ve srcy grntler veya deitirir. CDD [src:][yol] CDD[..] .. Bir st dizine gitmek istediinizi belirtir. - Eer "son dizin" zelletirildiyse etkinletirildiyse, son dizine dn. Eer src belirtildiyse gncel alan src deitirilir; bu "CHDIR" ile tek farktr. Gncel src ve dizini grntlemek iin parametresiz CD yazn. . :TEXT_CMDHELP_CHCP Etkin kod sayfas numarasn grntler veya ayarlar. CHCP [nnn] nnn Bir kod sayfas numaras belirtir. Etkin kod sayfas numarasn grntlemek iin parametresiz CHCP yazn. . :TEXT_CMDHELP_CLS Ekran temizler. CLS . :TEXT_CMDHELP_COMMAND FreeDOS komut kabuunun yeni bir kopyasn balatr. COMMAND [[src:]yol] [aygt] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] command]] [src:]yol COMMAND.COM'un bulunduu dizini belirtir. device Komut girii ve k iin kullanlan aygt belirtir. /E:nnnnn lk ortam boyutunu nnnnn bayt olarak ayarlar. (nnnnn 256 ila 32.768 arasnda olmaldr). /L:nnnn Dahili arabellein boyutunu belirtir (/P'de gerekir). (nnnn 128 ila 1.024 arasnda olmaldr). /U:nnn Girdi arabelleinin boyutunu belirtir (/P'de gerekir). (nnn 128 ila 255 arasnda olmaldr). /P Yeni komut kabuunu daimi yapar (k yaplamaz). /MSG Tm hata letilerini bellekte depolar (/P'de gerekir). /LOW Komut kabuunun yerleik verilerini Aa bellekte tutmasn zorlar. /Y /C veya /K ile belirtilen toplu i program admlar. /C komut Belirtilen komutu altrr ve dner. /K komut Belirtilen komutu altrr ve almaya devam eder. . :TEXT_CMDHELP_COPY Bir veya daha fazla dosyalar baka bir konuma kopyalar. COPY [/A | /B] kaynak [/A | /B] [+ kaynak [/A | /B] [+ ...]] [hedef [/A | /B]] [/V] [/Y | /-Y] kaynak Kopyalanacak dosya veya dosyalar belirtir. /A ASCII metin dosyasn belirtir. /B kili bir dosya belirtir. hedef Yeni dosyalar iin dizin veya dosya adn belirtir. /V Yeni dosyalarn doru yazldn denetler. /Y Mevcut olan bir hedef dosyasnn zerine yazma teyidini kaldrr. /-Y Mevcut olan bir hedef dosyasnn zerine yazma teyidini zorlar. /Y anahtar COPYCMD ortam deikeninde tanmlanabilir. Bu, komut satrnda /-Y ile geersiz klnabilir. Dosya eklemek iin hedef olarak tek bir dosya belirtin fakat kaynak iin birden fazla dosya belirtin (jokerler veya dosya1+dosya2+dosya3 biimi). . :TEXT_CMDHELP_CTTY Sisteminizi kontrol etmek iin kullanlan ubirim aygtn deitirir. CTTY aygt aygt Mesela COM1 gibi kullanmak istediiniz ubirim aygt. . :TEXT_CMDHELP_DATE#1 Tarihi grntler veya ayarlar. DATE [/D] [tarih] Gncel tarih ayarn grntlemek ve yenisini girmek iin bir istem almak iin parametresiz DATE yazn. Tarihi korumak iin ENTER dmesine basn. /D seenei, DATE komutunun etkileimli olmasna engel olur. . :TEXT_CMDHELP_DEL#2 Bir veya birden ok dosyay siler. DEL [src:][yol]dosyaad [/P] [/V] ERASE [src:][yol]dosyaad [/P] [/V] [src:][yol]dosyaad Silinecek dosyalar belirtir. Birden ok dosyay joker kullanarak belirtebilirsiniz. /P Her bir dosyasnn silinmesinden evvel teyit ister. /V Silinen tm dosyalar grntler. . :TEXT_CMDHELP_DIR#4 Herhangi bir dizindeki dosyalarn ve alt dizinlerin listesini grntler. DIR [src:][yol][dosyaad] [/P] [/W] [/A[[:]znitelikler]] [/O[[:]sralamadzeni]] [/S] [/B] [/L] [src:][yol][dosyaad] Listelenecek src, dizin ve dosyalar belirtir. (Dosya tanmlamas ile gelitirilebilir.) /P Her bilgi ekranndan sonra duraklar. /W Geni liste biimini kullanr. /A Belirtilen znitelikli dosyalar grntler (varsaylan /ADHSRA) attributes D Dizinler R Salt okunur dosyalar H Sakl dosyalar A Arivlenmeye hazr dosyalar S Sistem dosyalar - hayr neki /O Dosyalar sralama dzenine gre listeler. sralama N Ada gre (alfabetik) S Boyuta gre (nce k) E Uzantya gre (alfabetik) D Tarih & zaman (nce eskisi) G nce dizinleri grupla - Ters sralama neki U Sralanmam Varsaylan /ONG /S Belirtilen dizinde ve tm alt dizinlerdeki dosyalar grntler. /B Yaln biimi kullan (balk bilgisiz ve zetsiz). /L Kk harf kullanr. /Y or /4 Seneyi 4 sayyla gsterir. Anahtarlar DIRCMD ortam deikeninde nayarlanabilir. nayarl anahtarlar herhangi bir anahtar - (tire) neki ile geersiz klabilir--mesela /-W. . :TEXT_CMDHELP_DOSKEY#1 Harici DOSKEY yardmc program FreeCOM'a dahil edilmitir. YUKARI ve AAI dmeleri ile tariheyi geri alabilir ve HISTORY ile grntleyebilirsiniz. SOL, SA ve END ile HOME dmeleriyle komut satrnda gezinebilir ve INSERT ile ekleme veya zerine yazma kipine geebilirsiniz. TAB tuu ile gncel szc dosya ad olarak tamamlayabilir; iki kez basarak tm denkleen dosyalar gsterebilirsiniz. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 Komut satrn dzenler, geri alr ve makro oluturur DOSKEY [/anahtar ...] [makroad=[metin]] /BUFSIZE:boyu Makro ve komut arabellei boyutunu ayarla (ntanml:512) /ECHO:on|off Makro genileme yazmn a/kapat (ntanml:ak) /FILE:dosya Makro listesi ieren dosya belirt /HISTORY Bellekte muhafaza edilen tm komutlar grntle /INSERT Yeni karakterleri dmesine basldnda ekle /KEYSIZE:boy. Klavyenin type-ahead arabellei boyutu (ntanml:15) /LINE:boyut Satr dzenleme arabelleinin azami boyutu (ntanml:128) /MACROS Tm DOSKEY makrolarn grntle /OVERSTRIKE Yazarken yeni karakterleri satrn zerine yaz (ntanml) /REINSTALL Yeni bir DOSKEY kopyas kur makroad Oluturduunuz makro iin bir ad belirt metin Makroya atamak istediiniz komutlar belirt YUKARI, AAI oklar komutlar geri alr Esc gncel komutu temizler F7 komut tarihesini grntler Alt+F7 komut tarihesini temizler [karak]F8 [karak] ile balayan komutlar arar F9 sayyla bir komut seer Alt+F10 makro tanmlamalarn temizler Aadakiler DOSKEY makro tanmlamalarnda kullanabileceiniz zel kodlardr: $T Komut ayrc: makroda birden ok komuta izin verir $1-$9 toplu i parametreleri: toplu i programlarnda una eittir: %1-%9 $* Komut satrnda makro adndan sonra her ey yerine geen sembol . :TEXT_CMDHELP_ECHO leti grntler veya komut yanksn etkinletirir veya devre d brakr. ECHO [ON | OFF] ECHO [ileti] Gncel echo ayarn grntlemek iin parametresiz ECHO yazn. . :TEXT_CMDHELP_EXIT /P ile yklenmediyse FreeDOS komut kabuunu sonlandrr. EXIT . :TEXT_CMDHELP_FOR Belirtilen komutu bir dosya kmesindeki her dosya iin altrr. FOR %%deiken IN (kme) DO komut [komut-parametreleri] %%deiken Deitirilebilir bir parametre belirtir. (kme) Bir/birden ok dosya kmesi belirtir. Joker kullanlabilir. komut Her dosya iin altrlacak komutu belirtir. komut-parametreleri Belirtilen komut iin parametre veya anahtar belirtir. FOR komutunu bir toplu i betiinde kullanmak iin %%deiken yerine %%%%deiken kullann. rnein: FOR %%%%f IN (---balang--- a*.* ---son---) DO ECHO - %%%%f - . :TEXT_CMDHELP_GOTO Komut kabuunu bir toplu i betiinde etiketli bir satra ynlendirir. GOTO etiket etiket Toplu i betiinde etiket olarak kullanlan bir metin belirtir. Etiket bir satra kendi bana iki nokta ile balayarak yazabilirsiniz. . :TEXT_CMDHELP_HISTORY#1 History komutu HISTORY [boyut] "Boyut" yazlmadysa komut satrnn tarihe arabelleinin gncel ierikleri grntlenir. Boyut ile tarihe arabelleinin boyutu deitirilir. . :TEXT_CMDHELP_IF Toplu i programlarnda koullu ilemleri yerine getirir. IF [NOT] ERRORLEVEL say komut IF [NOT] dize1==dize2 komut IF [NOT] EXIST dosyaad komut NOT Komut kabuunun komutu yalnzca koul yanl ise altrmas gerektiini belirtir. ERRORLEVEL number Son altrlan program belirtilene eit veya ondan yksek bir k kodu geri gnderdiyse doru koul belirtir. komut Eer koul karlandysa altrlacak komutu belirtir. dize1==dize2 Belirtilen metin dizeleri eleiyorsa doru bir koul belirtir. EXIST dosyaad Belirtilen dosya ad mevcutsa doru bir koul belirtir. . :TEXT_CMDHELP_LFNFOR FOR komutu veya dosya ad tamamlamas iin uzun adlar etkinletir/devre d. LFNFOR [ON | OFF] LFNFOR COMPLETE [ON | OFF] Gncel LFNFOR ayarn grntlemek iin parametresiz LFNFOR veya LFNFOR yazn. . :TEXT_CMDHELP_LH Bir program st bellek alanna ykler. LOADHIGH [src:][yol]dosyaad [parametreler] LOADHIGH [/L:alan1[,minboyut1][;alan2[,minboyut]...] [/S]] [src:][yol]dosyaad [parametreler] /L:alan1[,minboyut1][;alan2[,minboyut2]]... Programn yklenecei bellek alanlarn belirtir. Alan1 ilk bellek alannn saysn belirtir; minboyut1 alan1 iin varsa asgari boyutu belirtir. Alan2 ve minboyut2 varsa ikinci alann saysn ve asgari boyutunu belirtirler. stediiniz kadar alan belirtebilirsiniz. /S Program yklenirken bir UMB'yi en kk boyutuna kltr. [src:][yol]dosyaad Programn konumunu ve adn belirtir. . :TEXT_CMDHELP_LOADFIX Bir program bellein ilk 64K'snn zerine ykler ve onu altrr. LOADFIX [src:][yol]dosyaad Bir program Aa bellee yklerken "Paketlenmi dosya bozuk" iletisini aldysanz program LOADFIX kullanarak ykleyin. . :TEXT_CMDHELP_MD Dizin oluturur. MKDIR [src:]yol MD [src:]yol . :TEXT_CMDHELP_PATH altrlabilir dosyalar iin arama yolu grntler veya ayarlar. PATH [[src:]yol[;...]] PATH ; Tm arama yolu ayarlarn temizlemek ve komut kabuunu yalnzca gncel dizinde arama yapmaya ynlendirmek iin PATH ; yazn. Gncel yolu grntlemek iin parametresiz PATH yazn. . :TEXT_CMDHELP_PAUSE Bir toplu i betiinin ileyiini duraklatr ve aadaki iletiyi grntler: "Srdrmek iin herhangi bir dmeye basn...." veya baka bir ileti. PAUSE [ileti] . :TEXT_CMDHELP_PROMPT Komut istemini deitirir. PROMPT [metin] metin Yeni bir komut istemi belirtir. stem normal karakterlerden ve aadaki zel kodlardan oluturulabilir: $Q = (eit iareti) $$ $ (dollar karakteri) $T Gncel zaman $D Gncel tarih $P Gncel src ve yol $V FreeDOS komut kabuunun srm numaras $N Gncel src $G > (byktr iareti) $L < (kktr iareti) $B | (kanal (pipe)) $H Geri tuu (nceki karakteri siler) $E Ka dizgesi (ASCII kodu 27) $_ Satr ba ve satr besleme stemi varsaylan deere geri almak iin parametresiz PROMPT yazn. . :TEXT_CMDHELP_PUSHD Gncel dizini dizin ynnn zerine iter ve gncel alan dizini deitirme seenei sunar. PUSHD [[src:]yol] [src:]yol deiip eskisinin yerine geecek yoldur. . :TEXT_CMDHELP_POPD Dizin ynndan bir dizini grntler ve ayar ona deiir. POPD [*] '*' parametresi dizin ynn temizler. . :TEXT_CMDHELP_DIRS Dizin ynnn ieriklerini grntler. DIRS . :TEXT_CMDHELP_RD Bo bir dizini kaldrr (siler). RMDIR [src:]yol RD [src:]yol . :TEXT_CMDHELP_REM Yorumlar bir toplum i dosyasna veya CONFIG.SYS dosyasna kaydeder. REM [yorum] . :TEXT_CMDHELP_REN Bir dosya/dizini veya dosyalar/dizinleri yeniden adlandrr. RENAME [src:][yol][dizinad1 | dosyaad1] [dizinad2 | dosyad2] REN [src:][yol][dizinad1 | dosyaad1] [dizinad2 | dosyaad2] Unutmayn ki hedefiniz iin yeni bir src veya yol belirtemezsiniz. Bunun iin MOVE komutunu kullann. . :TEXT_CMDHELP_SET#1 Ortam deikenlerini grntler, ayarlar veya kaldrr. SET [/C] [/P] [/E] [/U] [deiken[=[dize]]] deiken Ortam deikeninin adn belirtir. dize Deikene atanacak karakter serisini belirtir. * Eer hibir dize belirtilmediyse, deiken ortamdan kaldrlr. Gncel ortam deikenlerini grntlemek iin parametresiz SET yazn. VAR deikeninin deerini grntlemek iin SET VAR kullann /C deikenin harf trnn (byk-kk) korunmasn zorlar; varsaylan deer olarak deiken zaten ortamda konumlanmam ise byk harflidir, yoksa harf tr muhafaza edilir. /P dize ile kullanc istemi gsterir ve kullanc girdisini deikene atar. /E [dize] tarafndan iaret edilen komutun ktsnn ilk satrna verilen deikeni ayarlar. /U [dizenin] harf trn byk harf olarak ayarlar. . :TEXT_CMDHELP_SHIFT#1 Bir toplu i dosyasnda deitirilebilir parametre konumunu deitirir. SHIFT [DOWN] DOWN argman penceresini baa doru kaydrr (%%0); yoksa sona doru kaydrr. . :TEXT_CMDHELP_TIME#1 Sistem zamann grntler veya ayarlar. TIME [/T] [zaman] Gncel zaman grmek ve yeni zaman girmek iin istem almak amacyla parametresiz TIME yazn. Ayn zaman muhafaza etmek iin ENTER dmesine basn. /T TIME komutunun etkileimli olmasna mani olur. . :TEXT_CMDHELP_TRUENAME Belirtilen yolun tam yol adn grntler. TRUENAME [src:][yol][dosyaad] . :TEXT_CMDHELP_TYPE Metin dosyalarnn ieriklerini grntler. TYPE [src:][yol]dosyaad . :TEXT_CMDHELP_VER FreeDOS komut kabuu srmn ve baka bilgiler grntler. VER [/R] [/W] [/D] [/C] /R ekirdek srm ve baka bilgiler grntler. /W FreeDOS komut kabuu garantisi. /D FreeDOS komut kabuu yeniden datm bilgileri. /C FreeDOS komut kabuu itirakileri. . :TEXT_CMDHELP_VERIFY FreeDOS dosya sisteminin dosyalarn diske doru bir ekilde yazlp yazlmadklarn denetleyip denetlemeyeceini belirtir. VERIFY [ON | OFF] Gncel VERIFY ayarn grntlemek iin parametresiz VERIFY yazn. . :TEXT_CMDHELP_FDDEBUG Eer hata ayklama FreeDOS'la derlendiyse bu komut hata ayklama ktsn ap kapatacak veya size ak veya kapal olduunu gsterecektir. FDDEBUG [ON | OFF | dosya] Gncel hata ayklama kt ayarn grntlemek iin parametresiz FDDEBUG yazn. Eer bir dosya belirtildiyse tm hata ayklama kts bu dosyaya ynlendirilecektir, kt dosya mevcutsa dosyaya eklenecektir. "stdout" ve "stderr" zel adlar kty standart ktya veya standart hata akna yeniden ynlendirmek iin kullanlabilir. . :TEXT_CMDHELP_VOL Varsa disk birim etiketi ve seri numarasn grntler. VOL [src:] . :TEXT_CMDHELP_QUESTION#1 Kabukta bulunan komutlar ve zelliklerin listesini grntler. ? ?komut [bamsz-deiken] lk biim tm mevcut dahili komut ve zellikleri grntler. kinci biimse sanki izleme kipi etkinmi gibi belirtilen komutun altrlmasn isteyip istemediinizi soracaktr. . :TEXT_CMDHELP_WHICH Her belirtilen komut iin altrlabilir dosyas arar ve grntler. WHICH komut... . :TEXT_CMDHELP_MEMORY#1 FreeCOM tarafndan isel olarak kullanlan dahili bellei grntler. MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 COPY hedefi art ('+') karakterini iermemelidir. . :TEXT_DELETE_FILE#1% "%s" dosyas siliniyor. . :TEXT_ERROR_WRITE_FILE_DISC_FULL#0% '%s' dosyasna yazlamad; Disk dolu olabilir mi? (%lu bayt gerekli) . # Displayed for BIGcopy(), when copying takes quite a long time. # **_NO_END if the input file size is unknown. # Both must end in \r rather than \n!! :TEXT_COPY_COPIED_NO_END#0% %luKB/???KB kopyaland\r\ . :TEXT_COPY_COPIED#0% %luKB/%luKB kopyaland\r\ . :TEXT_ERROR_FCOM_IS_DEVICE#0% FreeCOM bir aygt olamaz: "%s" . :TEXT_ERROR_FCOM_INVALID#0% Bu dosya geerli bir FreeCOM deil veya uyumsuz bir srmn dosyas: %s . :TEXT_ERROR_LOADING_STRINGS Dize kaynaklar bellee yklenemedi, %COMSPEC% gesine iaret edilen konum geersiz gibi grnyor. Ltfen FreeCOM iin baka bir konum belirtin ki dizeler bu konumdan yklenebilsinler, mesela: C:\\COMMAND.COM veya dizelerin yklenmesini iptal etmek iin Enter dmesine basn. . :TEXT_TERMINATING Sonlandrlyor. . :TEXT_HIDDEN_CRITER#0% %u Kritik Hata talebi ortadan kaldrld. . # The exit reasons MUST be kept in this order! :TEXT_DISP_EXITCODE#0% k kodu (ERRORLEVEL): %u, sebep: %u (%s) . :TEXT_EXIT_REASON_NEG_1 DOS API hatas\ . :TEXT_EXIT_REASON_0 normal bir ekilde sonland\ . :TEXT_EXIT_REASON_1 ^Break tarafndan sonlandrld\ . :TEXT_EXIT_REASON_2 kritik bir hata tarafndan sonlandrld\ . :TEXT_EXIT_REASON_3 yerleik oldu\ . :TEXT_ERROR_EXE_CORRUPT EXE dosyas hasarl\ . ================================================ FILE: strings/ukr.err ================================================ # Hello ================================================ FILE: strings/ukr.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Ukrainian # Codepage: DOS-866 # Author: FreeWolle Voluntary # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH ६. - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH ६. - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION ࠢ쭮 : '%s' . :TEXT_ERROR_OPT_ARG '%s' 㬥 . :TEXT_ERROR_OPT_NOARG '%s' ॡ 㬥 . :TEXT_INVALID_NUMBER '%s' ᫮ . :TEXT_ERROR_CLOSE_QUOTE ਢ : %c . :TEXT_ERROR_TEMPFILE ⢮ ⨬ᮢ 䠩 . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR ࠬ. - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS ࠬ. . :TEXT_ERROR_INVALID_PARAMETER ࠬ. - '%s' . :TEXT_ERROR_PATH_NOT_FOUND . . :TEXT_ERROR_FILE_NOT_FOUND . . :TEXT_ERROR_SFILE_NOT_FOUND . - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING '離 ࠬ. . :TEXT_ERROR_INVALID_DRIVE ࠢ쭮 %c:. . :TEXT_ERROR_BADCOMMAND#2 ࠢ쭮 ' 䠩 - "%s". . :TEXT_ERROR_OUT_OF_MEMORY ' ௠. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 ' १ DOS. . :TEXT_ERROR_CANNOTPIPE ७ࠢ! ⨬ᮢ 䠩! . :TEXT_ERROR_LONG_LINE_BATCHFILE 冷 #%ld 䠩 '%s' . . :TEXT_ERROR_BFILE_VANISHED 䠩 '%s' . . :TEXT_ERROR_BFILE_LABEL 䠩 '%s' ⪨ '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR ⠭ 祭 祭 '%s'. ୥ ९ ' 祭. . :TEXT_ERROR_ENV_VAR_NOT_FOUND 祭 '%s' . . :TEXT_ERROR_NO_ENVIRONMENT ' 祭. '. /E . . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 ⠭ ᥢ '%s'. ୥ ௠ ' ᥢ. . :TEXT_ERROR_ALIAS_NOT_FOUND#1 ᥢ '%s' . . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 ௠ ' ᥢ. . :TEXT_ERROR_SYNTAX_STR ⠪筠 . - '%s' . :TEXT_ERROR_SYNTAX ⠪筠 . . :TEXT_ERROR_FILENAME_TOO_LONG ' 䠩. - '%s' . :TEXT_ERROR_SELFCOPY ᪮ '%s' ᥡ . :TEXT_ERROR_COMMAND_TOO_LONG 冷 ஧७ ᥢ! . :TEXT_ERROR_LINE_TOO_LONG 冷. . . :TEXT_ERROR_HISTORY_SIZE#1 ୨ ' '%s'. . :TEXT_HISTORY_EMPTY#1 . . :TEXT_ERROR_BAD_MCB_CHAIN 誮 MCB ᭠ MS-DOS ⥬. . :TEXT_ERROR_UNDEFINED_ERROR %d. . :TEXT_ERROR_REGION_WARNING 誮 ﭪ ' %d 㫠 ய饭. . :TEXT_ERROR_ON_OR_OFF ON OFF. . :TEXT_ERROR_BAD_VARIABLE . . :TEXT_ERROR_IN_MISSING#1 FOR: IN. . :TEXT_ERROR_MISSING_PARENTHESES#1 㦪. . :TEXT_ERROR_DO_MISSING#1 FOR: DO. . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: DO. . :TEXT_ERROR_REDIRECT_FROM_FILE ७ࠢ 䠩 '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE ७ࠢ 䠩 '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 ७ࠢ. . :TEXT_ERROR_INVALID_DATE ࠢ쭮 . . :TEXT_ERROR_INVALID_TIME ࠢ쭮 . . :TEXT_ERROR_NO_GOTO_LABEL ⪨ GOTO. . :TEXT_CTTY_NOTIMPLEMENTED CTTY 祭 쮣 COMMAND.COM. . :TEXT_ERROR_NORW_DEVICE 誮 ⠡쭨/ '%s'. . :TEXT_ERROR_CTTY_DUP 㢠 䠩 TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED /L ਬ. . :TEXT_ERROR_U_NOTIMPLEMENTED /U ਬ. . :TEXT_ERROR_WRITING_DEST ਩. . :TEXT_ERROR_CANNOT_OPEN_SOURCE ५. - '%s' . :TEXT_ERROR_OPEN_FILE 䠩 '%s' . :TEXT_ERROR_READ_FILE ⠭ 䠩 '%s' . :TEXT_ERROR_WRITE_FILE 䠩 '%s' . :TEXT_ERROR_LEADING_PLUS '㢠쭨 ᨬ '+' 室 । 㬥⠬. . :TEXT_ERROR_TRAILING_PLUS '㢠쭨 ᨬ '+' 室 㬥. . :TEXT_ERROR_NOTHING_TO_DO 箣 ஡! . :TEXT_ERROR_COPY COPY . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: ' 䠩 . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: ᫮ . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: ᫮ . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: . :TEXT_NOT_IMPLEMENTED_YET ... ॠ. . :TEXT_FAILED_LOAD_STRINGS ⠦ '. . :TEXT_MSG_NOTIMPLEMENTED /MSG 祭 쮣 COMMAND.COM. . :TEXT_MSG_ITEMS_DISPLAYED#1 ࠦ %u 㭪. . :TEXT_CORRUPT_COMMAND_LINE 誮 浪. '易 㢠 COMMAND.COM. -᪠, . . :TEXT_QUOTED_C_OR_K#1 /C /K , ⮬ 㢠. . :TEXT_INIT_FULLY_QUALIFIED#1 COMMAND.COM ! 楩 㪢 ஧稭 ᪨, ਪ: C:\\FDOS COMMAND.COM ਩ : %s . :TEXT_ERROR_RESTORE_SESSION ଠ - 㢠 㫨 祭. ᭥ 稭 ஠ । . . :TEXT_ERROR_SAVE_SESSION ଠ ०  ணࠬ. ᭥ 稭 ஠ । . . :TEXT_ERROR_CWD_FAILED %c: ௠ '. . :TEXT_ERROR_KSWAP_ALIAS_SIZE 㢠: ' ᥢ. . :TEXT_ERROR_KSWAP_ALLOCMEM 㢠: '. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 ௠ ஡箣 ' ᥢ. . :TEXT_ERROR_ALIAS_NO_SUCH#1 ᥢ: '%s' ࠢ쭨 . :TEXT_ERROR_ALIAS_INSERT#1 ⠢ﭭ ᥢ. . :TEXT_ALIAS_INVALID_NAME#1 '%s' - ' ᥢ. . :TEXT_ERROR_LOADING_CONTEXT#1 ⠦ ⥪⭮ ஡ 筨 . . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 ௠ ' ⥪. ⨬, ஡ , ⠪ - ஧ 浪, ⥪ , . . :TEXT_ERROR_CONTEXT_LENGTH#1 ⥪ %lu ॢ ࠭筨 . ஧ ⥪ %u . . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 ᭮ ଠ ⥪. 誮 ' ࠢ쭮 쭨 ஧ ⥪. -᪠, ஧஡ FreeCOM : freedos-devel@lists.sourceforge.net . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 ⥪ 㫮 祭 㢠. ⥪ ⢮७, ᥢ, , 㫨 祭. . # # Informational messages # :TEXT_MSG_PAUSE#1 - த . . .\ . :TEXT_MSG_HISTORY_SIZE 浪 ᪫ %d . . :TEXT_MSG_DOSKEY DOSKEY . . :TEXT_MSG_ECHO_STATE ECHO - %s . :TEXT_MSG_VERIFY_STATE VERIFY - %s . :TEXT_MSG_FDDEBUG_STATE DEBUG - %s. . :TEXT_MSG_FDDEBUG_TARGET DEBUG 㪮 '%s'. . :TEXT_MSG_BREAK_STATE BREAK - %s . :TEXT_MSG_CURRENT_DATE 筠 : %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 (%s%s[]): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 (%s%s[]): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 ([]%s%s): \ . :TEXT_MSG_CURRENT_TIME 筨 : %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 : \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 YyNn{CR}{LF}{CBREAK} aabb b b b 䠩 '%s' 㤥 饭! ࠢ쭮 ᢮ (Y/N)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 YyNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [=ENTER, =ESC] ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 YyNnAaQq{LF}{CR}{CBREAK}{ESC} aabbcccc a a c b Control-Break.\r ਯ 䠩 '%s' ((Y)/(N)/(A)) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b १ '%s' ((Y)/(N)/(A)/㯨(Q)) ? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 YyNnAaQq{BREAK}{ENTER}{ESC} aabbccdd d a b '%s' ((Y)/(N)/(A)/㯨(Q)) ? \ . :TEXT_UNKNOWN_FILENAME#1 <<>>\ . :TEXT_DIRSTACK_EMPTY ⥪ ⨩. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 ⪠ ⮬ %c \ . :TEXT_DIR_HDR_VOLUME_STRING %s . :TEXT_DIR_HDR_VOLUME_NONE ⪨ . :TEXT_DIR_HDR_SERIAL_NUMBER ⮬ - %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s 䠩()\ . :TEXT_DIR_FTR_BYTES %12s . :TEXT_DIR_FTR_TOTAL_NUMBER 䠩: . :TEXT_DIR_FTR_DIRS#1 %10s \ . :TEXT_DIR_FTR_BYTES_FREE %15s 쭮 . :TEXT_DIR_DIRECTORY %s . :TEXT_DIR_DIRECTORY_WITH_SPACE %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 <> \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH =%s . :TEXT_MSG_PATH_NONE#1 . . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 \ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 \ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 䠩 饭. . :TEXT_MSG_DEL_CNT_FILES_1#1 䠩 饭. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u 䠩() 饭. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS 㯭 : . :TEXT_MSG_SHOWCMD_FEATURES 㯭 ஧७: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 [ᥢ] \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 [஧७ ] \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 [] \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 [襭 䠩] \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 [窠] \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 [⮪ 㢠] \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 [⠭ ⥪] \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 [窠 ] \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 [窠 XMS] \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 [窠 㢠] \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 [ ] \ . :TEXT_SHOWCMD_FEATURE_NLS#1 [DOS NLS] \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 [⥪ (PUSHD)] \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 [ FreeCOM] \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 F8 㢠 F5 室 %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC '%s'. . :TEXT_MSG_VER_DOS_VERSION DOS %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS (ઠ 1933 ) . :TEXT_MSG_VER_LATER_FREEDOS FreeDOS %d.%d.%d . :TEXT_MSG_VER_WARRANTY 쪥 ࠢ (C) 1994-2001 ଠ . ஧ , ⠭ , ࠭ , ⨬; ⠪ ࠭ ਤ ⭮ . ஡ﬨ ⠩ 㡫筮 業 . ᨫ freecom@fredos.org. 㯭 ⠦ : http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_REDISTRIBUTION 쪥 ࠢ (C) 1994-2001 ଠ . ணࠬ 쭨 ணࠬ 祭; ஧㢠 㢠 㬮, 㡫 業 2 ( ), 㡫 쭮 ணࠬ 祭. ᨫ freecom@fredos.org. 㯭 ⠦ : http://freedos.sourceforge.net/freecom . :TEXT_MSG_VER_DEVELOPERS FreeDOS ஧஡ 쬠 ஧஡; 䠩 HISTORY.TXT. 쭨 䠭 (freedos-devel@lists.sourceforge.net). ᨫ freecom@fredos.org. 㯭 ⠦ : http://freedos.sourceforge.net/freecom . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r , 쪨 饭 \r "/P", १⠦.\r ' ⨧筮 祭,\r "㡨" .\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 㢠쭨 FreeCOM . COMMAND.COM 类 讣 㬥 COMMAND, ਪ: C:\\FDOS . :TEXT_MEMORY_ENVIRONMENT#1 祭 : %5u ; 쭮 %5u . :TEXT_MEMORY_CONTEXT#1 ⥪ : %5u bytes; 쭮 %5u . :TEXT_MEMORY_HEAP#1 ' : 쭮 %5lu . :TEXT_MEMORY_CTXT_ALIAS#1 \tᥢ : %5u , ࠧ %5u , %5u . :TEXT_MEMORY_CTXT_HISTORY#1 \t : %5u , ࠧ %5u , %5u . :TEXT_MEMORY_CTXT_DIRSTACK#1 \t⥪ ४: %5u , ࠧ %5u , %5u . :TEXT_MEMORY_CTXT_LASTDIR#1 \t窠 ⠭ ⥪ : ⮢ %5u , %5u . :TEXT_MEMORY_CTXT_BATCH#1 \t 䠩 : ⮢ %5u , %5u . :TEXT_MEMORY_CTXT_SWAPINFO#1 \tଠ 㢠 : ⮢ %5u , %5u . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 ਬ 筮 ⥬. . :TEXT_ERROR_SET_CODEPAGE#1 筮 . . :TEXT_DISPLAY_CODEPAGE#1 筠 is %u. ⥬ : %u. . # # Command help text # :TEXT_CMDHELP_ALIAS ࠦ, 饭 ᥢ. ALIAS [[=][冷]] ᥢ. 冷 ᨬ - 祭 ᥢ. ALIAS ࠬ ࠦ ᥢ. . :TEXT_CMDHELP_BEEP 㪮 ᨣ १ . . :TEXT_CMDHELP_BREAK ⠭ ஧७ ஫ ᭥ CTRL+C. BREAK [ON | OFF] BREAK ࠬ 筮 BREAK. . :TEXT_CMDHELP_CALL#1 䠩 讣 䠩. CALL [/S | /N] [/Y] [:][]' 䠩 [㬥] 㬥 - 㬥, ॡ 䠩. /S । , /N ஭ 㢠 FreeCOM. /Y 祭 ० 㢠 䠩. . :TEXT_CMDHELP_CD ࠦ 筮 ⥪ 筮 ⥪ . CHDIR [:][] CHDIR[..] CD [:][] CD[..] CD - .. ⥪ 鮣 . - ஧७ "⠭ ⥪" 祭, ⥪ ⠭ ⥪ . CD : ࠦ 筮 ⥪ . CD ࠬ ࠦ 筮 ⥪. ⠪ CDD . :TEXT_CMDHELP_CDD ࠦ 筮 ⥪ 筮 ⥪ . CDD [:][] CD[..] CD - .. ⥪ 鮣 . - ஧७ "⠭ ⥪" 祭, ⥪ ⠭ ⥪ . , 筮 ; "CHDIR". . :TEXT_CMDHELP_CHCP ࠦ 筮 . CHCP [nnn] nnn . CHCP ࠬ ࠦ 筮 . . :TEXT_CMDHELP_CLS 饭 ࠭. CLS . :TEXT_CMDHELP_COMMAND FreeDOS. COMMAND [[:]] [] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] ]] [:] 䠩 COMMAND.COM. , ⮢㢠⨬ /. /E:nnnnn ⠭ ⪮ ஧ । 祭 nnnnn (᫮ nnnnn 256 32768). /L:nnnn ⠭ ஧ nnnn ( ࠧ ॡ ࠧ /P). ᫮ nnnn 128 1024. /U:nnn ஧ ( ࠧ ॡ ࠧ /P). ᫮ nnn 128 255. /P ଠ⭨ ( 室 ). /MSG ० ( ࠧ ॡ ࠧ /P). /LOW ஧饭 १⭮ ⨭ COMMAND.COM '. /Y 祭 ० 㢠 䠩, ᪠⨬ /C /K. /C . /K 訬 த . . :TEXT_CMDHELP_COPY  蠡 䠩 ਩. COPY [/A | /B] ५ [/A | /B] [+ ५ [/A | /B] [+ ...]] [਩ [/A | /B]] [/V] [/Y | /-Y] ५ 䠩 . /A  ASCII (⥪⮢) 䠩. /B  ⥪⮢ 䠩 (୨ 䠩). ਩ ' ⥪ / '/ ᪮ 䠩. /V ॢઠ ࠢ쭮 . /Y ⢥द १ 䠩 ਩. /-Y ⢥द १ 楢 䠩. ६ /Y 祭 COPYCMD, 祭 COPYCMD ६ /Y ६ /-Y 浪. ' 䠩 楢 䠩 쪮 䠩-५, 蠡 浪 ⠫: 䠩-५1+䠩-५1+䠩-५3. . :TEXT_CMDHELP_CTTY -, ᮢ 浪 ࠦ 쮬 . CTTY 쭨 /, ᪠, 1. . :TEXT_CMDHELP_DATE#1 ࠦ 筮 . DATE [/D] [] DATE ࠬ ࠦ 筮 . ० ⠭ ENTER . /D 筮 . . :TEXT_CMDHELP_DEL#2 饭 祭 蠡 䠩. DEL [:][]' 䠩 [/P] [/V] ERASE [:][]' 䠩 [/P] [/V] [:][]' 䠩 䠩 饭. 䠩 饭 ⮢ 蠡 䠩. /P ⢥द 㢠 䠩. /V ࠦ 饭 䠩. . :TEXT_CMDHELP_DIR#4 ࠦ ᯨ 䠩 筮 ⥪. DIR [:][][' 䠩] [/P] [/W] [/A[[:]ਡ]] [/O[[:]㢠]] [/S] [/B] [/L] [:][][' 䠩] , / 䠩 ࠦ. ( ஧७ ᯥ 䠩 蠡 ࠦ㢠 ᯨ 䠩). /P 㧠 ࠦ ࠭. /W ᫨ ଠ ᯨ 䠩. /A ࠦ 䠩 ਡ ( 㢠 /ADHSRA). ਡ D R 쪨 ⠭ H 客 䠩 A S ⥬ 䠩 - 稩 /O ᯨ 䠩 ० 㢠. 㢠 N (䠢⭨) S ஧ (稭 ) E ஧७ (䠢⭨) D (稭 ) G ⥪ - ॢ U 㢠 㢠 /ONG /S ࠦ 䠩 ⥪ ⠫. /B ᯨ ⪮ ଠ. /L 쮬 ॣ. /Y /4 ਧ筮 ଠ 祭 ப. ६ 祭 DIRCMD, ६, 浪, 騩 ਮ, 祭 DIRCMD. -类 祭 ६ ६ 浪 ᮬ "-", ਪ /-W. . :TEXT_CMDHELP_DOSKEY#1 ⨫ DOSKEY 㤮 FreeCOM. ६饭 㢥 冷 ࠭ 㢥 . ६饭 , ࠢ, ⠪ HOME END ६ 筮 浪 , ࠢ, ⮪ . INSERT ६ ० ⠢/१ ᨢ ।㢠 浪. TAB 㢥 ᫮ 宦 䠩 筮 ⥪; ᭥ TAB ࠦ ࠭ ᯨ᮪ 㯭 䠩. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 㢠 浪, ࠤ ࠭ 㢥 浪 , ⠪ ⢮७ . DOSKEY [/६ ...] [' =[⥪]] /BUFSIZE:஧ ⠭ ஧ ⠪ ( 㢠 512 ) /ECHO:on|off ࠦ ( 㢠 on) /FILE:䠩 䠩 ᯨ᪮ /HISTORY ࠦ ० ' 浪 /INSERT ⠢ ।㢠 浪 /KEYSIZE:஧ ⠭ ୮ ( 㢠 15 ) /LINE:஧ 浪 ( 㢠 128 ) /MACROS ࠦ DOSKey /OVERSTRIKE १ ।㢠 浪 (⮢ 㢠) /REINSTALL ୨ DOSKey ' ' ⢮ ⥪ (/) ᢮ UP,DOWN ॣ 浪 Esc 饭 筮 浪 F7 ࠦ 浪 Alt+F7 饭 浪 [ᨬ]F8 浪 , 猪 ஧稭 ᨬ [ᨬ] 冷 F9 冷 浪 浪 Alt+F10 ࠭ ⢮७ 㯭 DOSKey: $T  , 直 ⠢ 쪠 冷 $1-$9 㬥 浪 - ᠬ, %1-%9 䠩 $* ⥪⮬, 浪 . :TEXT_CMDHELP_ECHO ࠦ ६ ࠦ ࠭ 䠩. ECHO [ON | OFF] ECHO [] ECHO ࠬ ࠦ 筮 ࠦ 䠩 ࠭ . . :TEXT_CMDHELP_EXIT FreeDOS. EXIT . :TEXT_CMDHELP_FOR 祭 ࠧ 䠩. FOR %% IN () DO [ࠬ] %% ⠢ ࠬ () ᯨ᮪ 쪮 䠩. ⮢㢠 蠡 䠩. , 猪 ⨬ 䠩 . ࠬ ࠬ ६ 䠩 . FOR 䠩 %% %%%%. . :TEXT_CMDHELP_GOTO 䠩. GOTO ⪠ ⪠ ( ᨬ) - ' ⪨. ' ⪨ ஧稭 ࠯ (":"). . :TEXT_CMDHELP_HISTORY#1 浪. HISTORY [஧] ஧ ஧ 浪. HISTORY 㬥 ࠦ 浪. . :TEXT_CMDHELP_IF ॢઠ. IF [NOT] ERRORLEVEL ᫮ IF [NOT] 冷1==冷2 IF [NOT] EXIST ' 䠩 NOT 筮 祭 ( ⮬ ࠧ, 祭 㬮 ⨭). ERRORLEVEL ᫮ ⨭ 祭 ணࠬ ⨬ . , 猪 㢠⨬  祭 १ 㬮. 冷1==冷2 ⨭ ⥪ 浪 ⮦. EXIST ' 䠩 ⨭ ࠧ, 祭 䠩 . . :TEXT_CMDHELP_LH ⠦ ணࠬ '. LOADHIGH [:][]' 䠩 [ࠬ] LOADHIGH [/L:1[,쭨஧1][;2[,쭨஧2]...] [/S]] [:][]' 䠩 [ࠬ] /L:1[,쭨஧1][;2[,쭨஧2]... ⥩ ' ⠦ ணࠬ. 1 - ' ணࠬ; 쭨஧1 - 쭨 ஧ '. 2 - 㯭 ' ணࠬ; 쭨஧2 - 쭨 ஧ '. ॡ -猪 ⥩ ' 祭 쭨 ஧஬ ﭮ ', ⠦㢠 ணࠬ. /S 譥 ஧ UMB 㬠 ⠦ ணࠬ. [:][]' 䠩 ணࠬ ⠦. . :TEXT_CMDHELP_LOADFIX ⠦ ணࠬ 訬 64 '. LOADFIX [:][]' 䠩 ᮢ LOADFIX ⠦ ணࠬ, : "Packed file corrupt" - " 䠩 誮" ஡ ⠦ ணࠬ '. . :TEXT_CMDHELP_MD ⢮७ ⥪. MKDIR [:] MD [:] . :TEXT_CMDHELP_PATH ࠦ ⠭ 㢠쭨 䠩. PATH [[:][;...]] PATH ; PATH ; 饭 㢠쭨 䠩 筮 . PATH ࠬ ࠦ 筮 . . :TEXT_CMDHELP_PAUSE ਧ㯨 䠩 : " - த...." . PAUSE [] . :TEXT_CMDHELP_PROMPT 襭 浪. PROMPT [⥪] ⥪ 襭 浪. 襭 -直 訬 ⥪⮬ ᯥ ࠢ ᨬ: $Q = ( "") $$ $ (ᨬ ) $T 筨 $D 筠 $P 筨 $V FreeDOS $N 筨 $G > ( "") $L < ( "") $B | (㡠; ७ࠢ) $H Backspace (饭 ।쮣 ᨬ) $E Escape (ASCII 27) $_ 冷 ୥ ⪨ PROMPT 㬥 ⠭ 祭 襭 㢠. . :TEXT_CMDHELP_PUSHD 筮 ⥪ ⥪ ⠪ ⥪. PUSHD [[:]] [:] - , 直 ⥪. . :TEXT_CMDHELP_POPD ਬ ⥪ ⥪ . POPD [*] 㬥 '*' 饭 ⥪ . . :TEXT_CMDHELP_DIRS ࠦ ⥪ . DIRS . :TEXT_CMDHELP_RD 饭 ⥪. RMDIR [:] RD [:] . :TEXT_CMDHELP_REM 䠩 䠩 CONFIG.SYS. REM [] . :TEXT_CMDHELP_REN ३㢠 䠩/⥪ 䠩/. RENAME [:][][⥪1 | ' 䠩1] [⥪2 | ' 䠩2] REN [:][][⥪1 | ' 䠩1] [⥪2 | ' 䠩2] ३㢠 ⨬ 訩 - ਩. ७ᥭ 䠩 訩 訩 ⮢ MOVE. . :TEXT_CMDHELP_SET#1 ࠦ, 饭 祭. SET [/C] [/P] [=[冷]] ' 祭. 冷 ᨬ - 祭 . * 祭, . SET ࠬ ࠦ 祭. /C , ' 祭 ॣ, 㢠 ' 祭 ॢ ॣ, ⠪ . /P 㢥 祭 祭. . :TEXT_CMDHELP_SHIFT#1 ࠬ 䠩. SHIFT [DOWN] DOWN ࠬ ⠭쮣 讣, 讣 ⠭쮣. . :TEXT_CMDHELP_TIME#1 ࠦ 筮 ⥬ . TIME [/T] [] TIME ࠬ ࠦ 筮 ⥬ .  筨 , ENTER 楩 . /T ࠦ 筮 . . :TEXT_CMDHELP_TRUENAME ࠦ . TRUENAME [:][][' 䠩] . :TEXT_CMDHELP_TYPE ࠦ ⥪⮢ 䠩. TYPE [:][]' 䠩 . :TEXT_CMDHELP_VER ࠦ FreeDOS ଠ. VER [/R] [/W] [/D] [/C] /R ଠ. /W ࠭ FreeDOS. /D 㬮 ஧ FreeDOS. /C ᯨ ஧஡ FreeDOS. . :TEXT_CMDHELP_VERIFY ࠦ ॢન ४⭮ 䠩 . VERIFY [ON | OFF] VERIFY ࠬ ࠦ 筮 VERIFY. . :TEXT_CMDHELP_FDDEBUG 㫠 祭 FreeDOS, ० 㢠쭮 ଠ . FDDEBUG [ON | OFF | 䠩] FDDEBUG ࠬ 筮 . 浪 䠩, 㢥 㢠쭨 ⨬ 楩 䠩 㢠⨬ ( ). ७ࠢ 㢠쭮 ଠ ⠭ "stdout" "stderr" ७ࠢ ࠭ . . :TEXT_CMDHELP_VOL ࠦ 㬮 㢠 ⪨ ⮬ . VOL [:] . :TEXT_CMDHELP_QUESTION#1 ࠦ ५ 㤮 ஧७ . ? ࠦ ५ 㤮 ஧७ . ? [ࠬ] 祭 , ० 㢠. . :TEXT_CMDHELP_WHICH ࠦ 㢠쭮 䠩 . WHICH {} . :TEXT_CMDHELP_MEMORY#1 ࠦ ⨪ ⠭ ' FreeCOM MEMORY . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 ਩, COPY, ᨬ ' ('+'). . :TEXT_DELETE_FILE#1 饭 䠩 "%s". . ================================================ FILE: strings/yu437.err ================================================ # $Id$ # # Critical error national customization file # # Language: Serbian / Yugoslavian # Codepage: 437 # Author: Dejan Strbac (strbac@phreaker.net) # # The critical error (criter) handler receives some information # from the kernel about what error condition happens, generates some # human friendly message from it, requests the user's opinion about # how to proceed and, finally, returns to the kernel. # # The human friendly message is generated using one of the following # templates: # BLOCK_DEVICE (for criters on block devices) # Error %1 drive %A: %2 area: %3 # -and- CHAR_DEVICE (for criters on character devices) # Error %1 device %A: %3 # # Two-character sequences, which first character is a percent sign '%', # are placeholders for other information: # %% -> a single percent sign # %1 -> either READ or WRITE, depending on what kind of operation # caused the criter # %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA # %3 -> the actual error string; these are the strings associated to # a number 0 through N, and must correspond to the number passed in # lowbyte(DI) to the criter handler (see RBIL INT-24 for details) # %A -> drive letter (for block devices); name of device (character devices) # # Below the line describing the error the user is prompted for the action # to proceed. This line is dynamically constructed depending on which # action are available at all. The full line may look like this: # (A)bort, (I)gnore, (R)etry, (F)ail?_ # # The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They # should indicate which user response keys is associated with them; # suggested is to use the first letter and enclose it in parenthesises. # The delimiter ", " can be defined with DELIMITER and is the same # for all slots. # The "? " sequence is defined by QUESTION. # The order of the actions is fixed and cannot be customized. # # With each action a number of user response keys must be associated. # They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ... # strings. Because the key is searched in the same format as returned # by INT-16-00, both upper and lower case must be specified and # certain special keys cannot be used. # # The individual error strings are defined by the #: lines, where # the hash sign '#' refers to the number the kernel passes to the # criter handler. The UNKNOWN string is displayed for all error # numbers not specified. # # NOTE #1: The percent rule applies to _all_ criter strings! # NOTE #2: Each string occupies exactly one line. # NOTE #3: Any leading or trailing whitespaces are removed. Prefix the # first or suffix the last whitespace with '%.' (one percent sign and # one dot). This sequence is removed from the string totally. # NOTE #4: To embed any character use: %&## (one percent sign, # one ampersand and exactly two hexa-decimal digits) ## Primary strings S2 BLOCK_DEVICE: %&0A%&0A%&0DGreska %1 na drajvu %A: - %3 S3 CHAR_DEVICE: %&0A%&0A%&0DGreska %1 na uredjaju %A: - %3 ## kind of operation S0 READ: pri citanju S1 WRITE: pri upisu ## kind of failed area of block devices S4 DOS: DOS S5 FAT: FAT S6 ROOT: Root S7 DATA: Podaci ## action strings S8 IGNORE: (I)gnorisi S9 RETRY: (P)onovo S10 ABORT: (O)tkaz S11 FAIL: (N)euspeh ## keys associated with the actions S14 (compacted) KEYS_IGNORE: iI KEYS_RETRY: pP KEYS_ABORT: oO KEYS_FAIL: nN ## embedded strings S12 QUESTION: ? %. S13 DELIMITER: , %. ## Error strings UNKNOWN: Nepoznata greska S15 0: POKUSAJ PREKORACENjA ZASTITE OD PISANjA 1: NEPOZNATA JEDINICA ZA DRAJVER 2: DRAJV NIJE SPREMAN 3: NEPOZNATA KOMANDA PRENETA DRAJVERU 4: GRESKA U PODACIMA (LOS CRC) 5: LOSA DUZINA STRUKTURE ZAHTEVA DRAJVERA UREDjAJA 6: GRESKA PRI TRAZENjU (SEEK) 7: NEPOZNATI TIP MEDIJA 8: SEKTOR NIJE PRONADjEN 9: U STAMPACU NEMA PAPIRA 10: GRESKA PRI PISANjU 11: GRESKA PRI CITANjU 12: GENERALNI OTKAZ 13: NARUSAVANjE RASPODELE 14: NARUSAVANjE BLOKADE 15: NEVAZECA PROMENA DISKA 16: FCB JE NEDOSTUPNA 17: PREKORACENjE ZAJEDNICKOG BAFERA 18: NEUSAGLASENOST KODNIH STRANA 19: NEDOVOLjNO ULAZA 20: NEDOVOLjNO DISK PROSTORA ================================================ FILE: strings/yu437.lng ================================================ # $Id$ # # FreeCOM national customization file # # Language: Serbian / Yugoslavian # Codepage: 437 # Author: Dejan Strbac (strbac@phreaker.net) # # This file is used to generate all the messages that command.com # outputs. This file is the input to the fixstrs program, and it # outputs strings.h and strings.dat. The .DAT file is appended to # the command.exe file, and then renamed to command.com. The .H # file contains all the info for the program to retreive the # messages. # # The format of this file is simple. Blank lines and lines starting # with "#" are ignored. # Each message starts with a label name that will be used to refer to # the message in the program. A label starts with a colon ":". # A label has a version ID attached to it delimited by a hash sign, e.g.: # :TEXT_LABEL#1 # This version is incremented each time the contents of the string has # undergo a larger change. The same language definition may contain the # same label up to one time, regardless of the version. FIXSTRS compares # both the label and the version ID and both must match. # A missing version is assumed as "#0". # # All lines after the label are the message until a line with a # single "." or "," in the first column. The difference is the # period (".") signifies that there will be a final carrage return when # the message is displayed, but a comma does not. # # The body may contain backslash escape sequences as known from C; there # are the usual \# (where '#' is a lowercase letter except 'x' or one of # "[]{}?"), \\ (to embed a backslash itself) # \x?? (where '??' are up to two hexadecimal digits), \0 (to embed a NUL # character), \, and \. (to specify a period or comma in the first column # of a line) and the single \ at the end of the line to suppress to append # a newline character. Note: There is NO octal sequence except the short \0! # There is a known bug (or feature): [ignore the very first hash mark] #:TEXT_LABEL#2 # #\ #, # Although the first data line appends the newline, the second does not, # though the comma removes the newline from the first line. # Defining prompts # Some prompts may cause an user interaction. Those ones should be in sync # with the issued text. To define how to interprete a pressed key, they # are mapped into metakeys like that: [ignore first hash sign] ## Return value: a -> Yes; else -> No #:PROMPT_YES_NO#1 #YyNn\n\r{CBREAK} #aabb b b b # (Yes/No) ? \ #. # All strings, which label start with "PROMPT_", are parsed as prompts. # The first two lines of the body are special; the first one enumerates all # valid keys, the second one assigns arbitary metakeys. Metakeys may # range from 'a' through 'z'; spaces are ignored; everything else cause # an error. The comment preceeding the prompt definition associates the # metakeys with their meaning. # The remaining lines of the body contain the text to be displayed. # # Above example defines a native Yes/No prompt with a space behind the question # mark and no appended newline. # The metakey 'a' means "User answered with 'Yes'" and 'b' means no. # The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys # 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No). # The spaces between the 'b's in the second line had been inserted to # align them with the corresponding keys of the first line, hence in order # to enhance readibility of the association between the pressed keys and their # mapping into a metakey. # # The first line (pressed keys) has to enumerate the ASCII value as returned # by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero, # but a non-zero scancode are NOT supported; this limit includes for instance # the function keys F1 through F12 and the cursor keys and it is not possible # to differ between the number pad and normal keys. # The keys may be enumerated by their ASCII character, by a backslash sequence, # or a symbolic name enclosed in curly brackets (see FIXSTRS.C "symkeys[]" # array about the supported symnames). # # These are error messages # ## Issued if a single character option is unknown :TEXT_ERROR_INVALID_SWITCH Nevazeci prekidac - /%c . ## Issued if a longname option is unknown :TEXT_ERROR_INVALID_LSWITCH Nevazeci prekidac - /%s . ## Issued if the context, the type of argument etc. is invalid :TEXT_ERROR_ILLFORMED_OPTION Lose formirana opcija: '%s' . :TEXT_ERROR_OPT_ARG Opcija '%s' ne moze imati argument. . :TEXT_ERROR_OPT_NOARG Opcija '%s' mora imati argument. . :TEXT_INVALID_NUMBER Nevazeci broj naveden u '%s' . :TEXT_ERROR_CLOSE_QUOTE Nedostaje krajnji navodnik: %c . :TEXT_ERROR_TEMPFILE Privremeni fajl ne moze biti kreiran. . :TEXT_ERROR_TOO_MANY_PARAMETERS_STR Isuvise parametara - '%s' . :TEXT_ERROR_TOO_MANY_PARAMETERS Isuvise parametara. . :TEXT_ERROR_INVALID_PARAMETER Nevazeci parametar - '%s' . :TEXT_ERROR_PATH_NOT_FOUND Putanja nije pronadjena. . :TEXT_ERROR_FILE_NOT_FOUND Fajl nije pronadjen. . :TEXT_ERROR_SFILE_NOT_FOUND Fajl nije pronadjen - '%s' . :TEXT_ERROR_REQ_PARAM_MISSING Potreban parametar nedostaje. . :TEXT_ERROR_INVALID_DRIVE Nevazeci drajv - %c: . :TEXT_ERROR_BADCOMMAND#2 Losa komanda ili naziv fajla - "%s". . :TEXT_ERROR_OUT_OF_MEMORY Greska nedostatka memorije. . :TEXT_ERROR_OUT_OF_DOS_MEMORY#1 Alokacija DOS memorije nije uspela. . :TEXT_ERROR_CANNOTPIPE Nemogucnost cevovoda! Privremeni fajl ne moze biti otvoren! . :TEXT_ERROR_LONG_LINE_BATCHFILE Linija #%ld u batch fajlu '%s' je preduga. . :TEXT_ERROR_BFILE_VANISHED Batch fajl '%s' nije pronadjen. . :TEXT_ERROR_BFILE_LABEL Batch fajl '%s' ne sadrzi labelu '%s'. . :TEXT_ERROR_DIRFCT_FAILED#1 %s ne uspeva za '%s'. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ENV_VAR Promenljiva okruzenja '%s' ne moze biti postavljena. Okruzenje prepuno? . :TEXT_ERROR_ENV_VAR_NOT_FOUND Promenljiva okruzenja '%s' nije pronadjena. . :TEXT_ERROR_NO_ENVIRONMENT Nema okruzenja. Moguci nedostatak memorije. Navedite /E opciju. . # The next three errors must remain in this order! :TEXT_ERROR_SET_ALIAS#1 Alias '%s' ne moze biti postavljen. Prostor za aliase prepun? . :TEXT_ERROR_ALIAS_NOT_FOUND#1 Alias '%s' nije pronadjen. . :TEXT_ERROR_NO_ALIAS_SEGMENT#1 Nema prostora za aliase. Moguci nedostatak memorije. . :TEXT_ERROR_SYNTAX_STR Sintaksna greska - '%s' . :TEXT_ERROR_SYNTAX Sintaksna greska. . :TEXT_ERROR_FILENAME_TOO_LONG Naziv fajla je predugacak - '%s' . :TEXT_ERROR_SELFCOPY Fajl '%s' ne moze biti kopiran u sebe. . :TEXT_ERROR_COMMAND_TOO_LONG Komandna linija je preduga posle razvijanja aliasa! . :TEXT_ERROR_LINE_TOO_LONG Linija je preduga. Komanda ne moze biti izvrsena. . :TEXT_ERROR_HISTORY_SIZE#1 Nevazeca velicina istorije - '%s' . :TEXT_HISTORY_EMPTY#1 Istorija komandne linije je prazna. . :TEXT_ERROR_BAD_MCB_CHAIN MCB lanac je ostecen, ili MS-DOS nekompatibilan sistem. . :TEXT_ERROR_UNDEFINED_ERROR Nedefinisana greska %d. . :TEXT_ERROR_REGION_WARNING Nevazece memorijsko podrucje %d - ignorisano. . :TEXT_ERROR_ON_OR_OFF Morate navesti ON ili OFF. . :TEXT_ERROR_BAD_VARIABLE Lose navedena promenljiva. . :TEXT_ERROR_IN_MISSING#1 FOR: nedostaje IN . :TEXT_ERROR_MISSING_PARENTHESES#1 Jedna ili obe zagrade nedostaju. . :TEXT_ERROR_DO_MISSING#1 FOR: nedostaje DO . :TEXT_ERROR_NO_COMMAND_AFTER_DO#1 FOR: Nedostaje komanda posle DO iskaza. . :TEXT_ERROR_REDIRECT_FROM_FILE Ulaz ne moze biti preusmeren na fajl '%s'. . :TEXT_ERROR_REDIRECT_TO_FILE Izlaz ne moze biti preusmeren na fajl '%s'. . :TEXT_ERROR_EMPTY_REDIRECTION#1 Prazno preusmerenje. . :TEXT_ERROR_INVALID_DATE Nevazeci datum. . :TEXT_ERROR_INVALID_TIME Nevazece vreme. . :TEXT_ERROR_NO_GOTO_LABEL Nema labele navedene za GOTO. . :TEXT_CTTY_NOTIMPLEMENTED Komanda CTTY je izostavljena iz ovog COMMAND.COMa. . :TEXT_ERROR_NORW_DEVICE Nevazeci ili ne postojeci ucitno-upisni uredjaj '%s'. . :TEXT_ERROR_CTTY_DUP Neuspeh pri promeni fajl deskriptora na TTY '%s'. . :TEXT_ERROR_L_NOTIMPLEMENTED Prekidac /L nije implementiran. . :TEXT_ERROR_U_NOTIMPLEMENTED Prekidac /U nije implementiran. . :TEXT_ERROR_WRITING_DEST Greska pri upisu na odrediste. . :TEXT_ERROR_CANNOT_OPEN_SOURCE Izvor nije mogao biti otvoren - '%s' . :TEXT_ERROR_OPEN_FILE Fajl '%s' nije mogao biti otvoren. . :TEXT_ERROR_READ_FILE Nemogucnost citanja iz fajla: '%s' . :TEXT_ERROR_WRITE_FILE Nemogucnost upisa u fajl: '%s' . :TEXT_ERROR_LEADING_PLUS Povezujuci znak '+' ne moze voditi argumente. . :TEXT_ERROR_TRAILING_PLUS Povezujuci znak '+' ne moze pratiti argumente. . :TEXT_ERROR_NOTHING_TO_DO Nema niceg da se uradi. . :TEXT_ERROR_COPY COPY komanda nije uspela. . :TEXT_ERROR_IF_EXIST_NO_FILENAME#1 IF EXIST: nedostaje naziv fajla . :TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1 IF ERRORLEVEL: nedostaje broj . :TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1 IF ERRORLEVEL: nevazeci broj . :TEXT_ERROR_IF_MISSING_COMMAND#1 IF: nedostaje komanda . :TEXT_NOT_IMPLEMENTED_YET Zao nam je. Nije implementirano. . :TEXT_FAILED_LOAD_STRINGS Neuspeh pri ucitavanju poruka u memoriju. . :TEXT_MSG_NOTIMPLEMENTED Prekidac /MSG nije implementiran. . :TEXT_MSG_ITEMS_DISPLAYED#1 Ukupno izlistano stavki: %u . :TEXT_CORRUPT_COMMAND_LINE Ostecena komandna linija. Ovo je interna greska i povezana je sa sistemom u kome radi COMMAND.COM. Molimo vas prijavite ovu gresku. . :TEXT_QUOTED_C_OR_K#1 Opcije /C i /K nemogu biti pod navodnicima, ignorisane. . :TEXT_INIT_FULLY_QUALIFIED#1 Putanja do COMMAND.COMa mora biti potpuna! Ovo znaci ukljucujuci slovo drajva pocinjuci obrnutom kosom crtom (\\). Na primer: C:\\ COMMAND.COM sada podrazumeva ovu putanju: %s . :TEXT_ERROR_RESTORE_SESSION Informacije o sesiji nisu mogle biti vracene. Sve lokalne postavke su izgubljene. Molimo vas pogledajte gore izjavljene poruke o greskama za moguci razlog nastanka ovog problema. . :TEXT_ERROR_SAVE_SESSION Trenutne informacije nemogu biti ocuvane za vreme poziva programa. Molimo vas pogledajte gore izjavljene poruke o greskama za moguci razlog nastanka ovog problema. . :TEXT_ERROR_CWD_FAILED Drajv %c: ne reaguje ili nedostatak interne memorije. . :TEXT_ERROR_KSWAP_ALIAS_SIZE Swapping nije uspeo: Aliasi zauzimaju previse memorije. . :TEXT_ERROR_KSWAP_ALLOCMEM Swapping nije uspeo: Daleka memorija ne moze biti alocirana. . :TEXT_ERROR_ALIAS_OUT_OF_MEM#1 Nedostatak prostora za aliase. . :TEXT_ERROR_ALIAS_NO_SUCH#1 Alias '%s' ne postoji. . :TEXT_ERROR_ALIAS_INSERT#1 Greska pri umetanju aliasa. . :TEXT_ALIAS_INVALID_NAME#1 Nevazece ime aliasa '%s'. . :TEXT_ERROR_LOADING_CONTEXT#1 Manipulator kriticnih gresaka ili kontekst modul ne moze biti ucitan. . :TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1 Nedostatak memorije za kontekst. Ako ova greska nastavi da se javlja, razmotrite povecanje internog bafera, kao istorije, steka direktorijuma itd. . :TEXT_ERROR_CONTEXT_LENGTH#1 Velicina konteksta prelazi maksimalni limit za %lu bajta. Promena velicine konteksta na %u bajta. . :TEXT_ERROR_CONTEXT_ADD_STATUS#1 Neuspeh pri dodavanju statusnih informacija u kontekst. Ova greska moze znaciti ostecenje memorije ili nepravilno utvrdjena minimalna velicina konteksta. . :TEXT_ERROR_CONTEXT_AFTER_SWAP#1 Kontekst nedostaje posle swapa. Kontekst je rekreiran, ali su svi aliasi itd. izgubljeni. . # # Informational messages # :TEXT_MSG_PAUSE#1 Pritisnite bilo koji taster za nastavak...\ . :TEXT_MSG_HISTORY_SIZE Velicina istorije je %d bajta. . :TEXT_MSG_DOSKEY DOSKEY je vec omogucen interno u komandnoj ljusci. Pokrenite DOSKEY /? za vise informacija o implementaciji. . :TEXT_MSG_ECHO_STATE ECHO je %s . :TEXT_MSG_VERIFY_STATE VERIFY je %s . :TEXT_MSG_FDDEBUG_STATE DEBUG izlaz je %s . :TEXT_MSG_FDDEBUG_TARGET DEBUG izlaz se prikazuje na '%s' . :TEXT_MSG_BREAK_STATE BREAK je %s . :TEXT_MSG_CURRENT_DATE Trenutni datum je: %s . ## The three DATE prompts MUST be in this order! :TEXT_MSG_ENTER_DATE_AMERICAN#1 Unesite novi datum (mm%sdd%s[vv]gg): \ . :TEXT_MSG_ENTER_DATE_EUROPE#1 Unesite novi datum (dd%smm%s[vv]gg): \ . :TEXT_MSG_ENTER_DATE_JAPANESE#1 Unesite novi datum ([vv]gg%smm%sdd): \ . :TEXT_MSG_CURRENT_TIME Trenutno vreme je: %s . :TEXT_STRING_PM#1 pm\ . :TEXT_STRING_AM#1 am\ . :TEXT_MSG_ENTER_TIME#1 Unesite novo vreme: \ . # src-file target-file :TEXT_MSG_COPYING %s %s %s . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Used by Delete all (Y/N) --> let ENTER default to NO # Return value: a -> Yes; else -> No :PROMPT_DELETE_ALL#1 DdNn{CR}{LF}{CBREAK} aabb b b b Svi fajlovi u direktorijumu '%s' ce biti obrisani! Da li ste sigurni (Da/Ne)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; else -> No :PROMPT_YES_NO#1 DdNn{LF}{CR}{CBREAK}{ESC} aabb a a b b [ENTER=Da, ESC=Ne]? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Attention: This prompt is issued via BIOS; any newline MUST be prefixed # by \r! # Return value: a -> Yes; b -> No; c -> All; else -> Undefined :PROMPT_CANCEL_BATCH#1 DdNnSs{LF}{CR}{CBREAK}{ESC} aabbcc a a c b Control-Break pritisnuto.\r Prekinuti batch fajl '%s' (Da/Ne/Sve)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_OVERWRITE_FILE#1 DdNnSsOo{BREAK}{ENTER}{ESC} aabbccdd d a b Pisati preko '%s' (Da/Ne/Svi/Otkaz)? \ . # This prompt MUST include the pseudo key CBREAK! # Note: This prompt ignores DOS NLS intentionally in order to # keep interactive prompt & user-interaction in sync. # Return value: a -> Yes; b -> No; c -> All; d -> Quit :PROMPT_DELETE_FILE#1 DdNnSsOo{BREAK}{ENTER}{ESC} aabbccdd d a b Obrisati '%s' (Da/Ne/Svi/Otkaz)? \ . :TEXT_UNKNOWN_FILENAME#1 <>\ . :TEXT_DIRSTACK_EMPTY Stek direktorijuma je prazan. . ## Strings to construct the DIR output :TEXT_DIR_HDR_VOLUME#1 Volumen u drajvu %c \ . :TEXT_DIR_HDR_VOLUME_STRING je %s . :TEXT_DIR_HDR_VOLUME_NONE nema labele . :TEXT_DIR_HDR_SERIAL_NUMBER Serijski broj volumena je %04X-%04X . :TEXT_DIR_FTR_FILES#1 %10s fajl(a)\ . :TEXT_DIR_FTR_BYTES %12s bajta . :TEXT_DIR_FTR_TOTAL_NUMBER Ukupno prikazano: . :TEXT_DIR_FTR_DIRS#1 %10s dir(a)\ . :TEXT_DIR_FTR_BYTES_FREE %15s bajta slobodno . :TEXT_DIR_DIRECTORY Direktorijum %s . :TEXT_DIR_DIRECTORY_WITH_SPACE Direktorijum %s . :TEXT_DIR_LINE_FILENAME_WIDE#1 %-15s\ . :TEXT_DIR_LINE_FILENAME_BARE %-13s . :TEXT_DIR_LINE_FILENAME_SINGLE#1 %-13s\ . :TEXT_DIR_LINE_FILENAME#1 %-8s %-3s \ . :TEXT_DIR_LINE_SIZE_DIR#1 \ . :TEXT_DIR_LINE_SIZE#1 %10s \ . :TEXT_FILE_COMPLATION_DISPLAY#1 %-14s\ . :TEXT_MSG_PATH PATH=%s . :TEXT_MSG_PATH_NONE#1 Putanja nije definisana. . ## The following names MUST be in this order! :TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1 Ned\ . :TEXT_WEEKDAY_SHORT_NAME_MONDAY#1 Pon\ . :TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1 Uto\ . :TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1 Sre\ . :TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1 Cet\ . :TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1 Pet\ . :TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1 Sub\ . # Displayed by DEL how many files were removed. # These three strings must be kept in order! :TEXT_MSG_DEL_CNT_FILES#1 Nijedan fajl nije izbrisan. . :TEXT_MSG_DEL_CNT_FILES_1#1 Jedan fajl izbrisan. . :TEXT_MSG_DEL_CNT_FILES_2#1 %u fajla izbrisano. . :TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS Dostupne interne komande: . :TEXT_MSG_SHOWCMD_FEATURES Missing: . ## Displayed within "?" <-> showcmd() to enumerate the included features ## Note the trailing single space :TEXT_SHOWCMD_FEATURE_ALIASES#1 Missing \ . :TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1 Missing \ . :TEXT_SHOWCMD_FEATURE_HISTORY#1 Missing \ . :TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1 Missing \ . :TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1 Missing \ . :TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1 Missing \ . :TEXT_SHOWCMD_FEATURE_LAST_DIR#1 Missing \ . :TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1 Missing \ . :TEXT_SHOWCMD_FEATURE_XMS_SWAP#1 Missing \ . :TEXT_SHOWCMD_DEFAULT_TO_SWAP#1 Missing \ . :TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1 Missing \ . :TEXT_SHOWCMD_FEATURE_NLS#1 Missing \ . :TEXT_SHOWCMD_FEATURE_DIRSTACK#1 Missing \ . :TEXT_SHOWCMD_FEATURE_DEBUG#1 Missing \ . :TEXT_MSG_INIT_BYPASS_AUTOEXEC#1 Pritisnite F8 za mod pracenja, ili F5 za preskakanje %s... \ . :TEXT_MSG_INIT_BYPASSING_AUTOEXEC Preskakanje preko '%s' . :TEXT_MSG_VER_DOS_VERSION DOS verzija %u.%02u . :TEXT_MSG_VER_EARLY_FREEDOS FreeDOS jezgro (gradnja 1933 ili ranija) . :TEXT_MSG_VER_LATER_FREEDOS FreeDOS jezgro %d.%d.%d . # Displayed when the shell is to terminate, but has been started # with /P option <-> shell cannot exist; # This is a crash situation, because FreeCOM won't reach this situation # normally otherwise # All newlines must be prefixed by \r's ! :TEXT_MSG_REBOOT_NOW#1 \r\n\r Ljuska ce sada biti prekinuta, iako je ovo zabranjeno\r (obicno navodjenjem prekidaca "/P").\r Morate restartovati sistem ili, ukoliko ova ljuska radi u\r viseprocesnom okruzenju, prekinuti ovaj proces.\r . # Displayed during the initialization phase of FreeCOM, if its own # filename could not be determined. :TEXT_MSG_FREECOM_NOT_FOUND#1 Izvrsni fajl komandne ljuske nije pronadjen. Morate navesti potpunu putanju do COMMAND.COMa kao prvi argument COMMANDa, na primer: C:\\ . :TEXT_MEMORY_ENVIRONMENT#1 NA %5u %5u . :TEXT_MEMORY_CONTEXT#1 NA %5u %5u . :TEXT_MEMORY_HEAP#1 NA %5lu . :TEXT_MEMORY_CTXT_ALIAS#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_HISTORY#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_DIRSTACK#1 NA %5u %5u %5u . :TEXT_MEMORY_CTXT_LASTDIR#1 NA %5u %5u . :TEXT_MEMORY_CTXT_BATCH#1 NA %5u %5u . :TEXT_MEMORY_CTXT_SWAPINFO#1 NA %5u %5u . ## CHCP :TEXT_ERROR_GET_CODEPAGE#1 Neuspeh pri dobavljanju trenutne kodne strane iz sistema. . :TEXT_ERROR_SET_CODEPAGE#1 Neuspeh pri promeni trenutne kodne strane. . :TEXT_DISPLAY_CODEPAGE#1 Trenutna kodna strana je: %u. Sistemska kodna strana (pravilno) je: %u. . # # Command help text # :TEXT_CMDHELP_ALIAS Prikazuje, postavlja, ili uklanja aliase. ALIAS [promenljiva[=][string]] promenljiva Navodi ime aliasa. string Navodi niz karaktera za dodelu aliasu. Pokrenite ALIAS bez parametara za prikaz trenutnih aliasa. Ukoliko string nije naveden, postojeci alias se uklanja. . :TEXT_CMDHELP_BEEP Stvara kratak zvuk upozorenja. BEEP . :TEXT_CMDHELP_BREAK Postavlja ili uklanja prosirenu CTRL+C proveru. BREAK [ON | OFF] Pokrenite BREAK bez parametara za prikaz trenutne postavke. . :TEXT_CMDHELP_CALL#1 Poziva jedan batch program iz drugog. CALL [/S | /N] [/Y] [drajv:][putanja]fajl [batch-parametri] batch-parametri Navodi informacije sa komandne linije potrebne batch programu. /S ukljucuje dok /N iskljucuje swapping komandne ljuske. /Y omogucava mod pracenja prilikom izvrsenja komande. . :TEXT_CMDHELP_CD Prikazuje naziv ili menja trenutni direktorijum. CHDIR [drajv:][putanja] CHDIR[..] CD [drajv:][putanja] CD[..] CD - ".." Navodi da zelite da promenite direktorijum u roditeljski trenutnog. "-" Vraca se u prethodni direktorijum. Pokrenite "CD drajv:" za prikaz trenutnog dira na navedenom drajvu. Pokrenite CD bez parametara za prikaz trenutnog drajva i direktorijuma. Takodje pogledajte komandu CDD. . :TEXT_CMDHELP_CDD Prikazuje trenutni direktorijum ili menja trenutni direktorijum i drajv. CDD [drajv:][putanja] CDD[..] CDD - ".." Navodi da zelite da promenite direktorijum u roditeljski trenutnog. "-" Vraca se u prethodni direktorijum. Ako je "drajv:" naveden, trenutni radni drajv se menja na navedeni. Ovo je jedina razlika u odnosu na "CD" odnosno "CHDIR". Pokrenite CDD bez parametara za prikaz trenutnog drajva i direktorijuma. . :TEXT_CMDHELP_CHCP Prikazuje ili postavlja broj aktivne kodne strane. CHCP [nnn] nnn Navodi broj kodne strane. Pokrenite CHCP bez parametara za prikaz aktivne kodne strane. . :TEXT_CMDHELP_CLS Brise ekran i postavlja standardne atribute boja. CLS . :TEXT_CMDHELP_COMMAND Pokrece novu instancu komandne ljuske. COMMAND [[drajv:]putanja] [uredjaj] [/E:nnnnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] komanda]] [drajv:]putanja Navodi direktorijum koji sadrzi COMMAND.COM. uredjaj Navodi uredjaj za komandni ulaz/izlaz. /E:nnnnn Postavlja pocetnu velicinu okruzenja na nnnnn bajta. (nnnnn treba biti broj izmedju 256 i 32,768). /P Postavlja novu komandnu ljusku za stalnu (nema izlaza). /LOW Primorava komandnu ljusku da drzi svoje stalne podatke u niskoj memoriji. /MSG Ucitava sve sistemske poruke u memoriju (zahteva i /P). /Y Koraca kroz batch program naveden sa /C ili /K. /C komanda Izvrsava navedenu komandu i vraca se u trenutnu ljusku. /K komanda Izvrsava navedenu komandu i nastavlja rad. . :TEXT_CMDHELP_COPY Kopira jedan ili vise fajlova na drugu lokaciju. COPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]] [odrediste [/A | /B]] [/V] [/Y | /-Y] izvor Navodi fajl ili fajlove koje treba prekopirati. /A Nagovesta ASCII tekstualni fajl. /B Nagovesta binarni fajl. odrediste Navodi direktorijum i/ili naziv fajla za novi(e) fajl(ove). /V Proverava korektnost upisa novih fajlova. /Y Prigusava upite za pisanje preko vec postojecih fajlova u odredistu, odgovarajuci potvrdno. /-Y Poziva upit za potvrdu pisanja preko vec postojecih fajlova u odredistu. Prekidac /Y moze biti naveden u COPYCMD promenljivi okruzenja. Ovo moze biti ponisteno sa /-Y na komandnoj liniji. Za spajanje fajlova, navedite jedan fajl za odrediste, ali vise fajlova za izvor (koriscenjem dzoker znakova ili fajl1+fajl2+fajl3 formatom). . :TEXT_CMDHELP_CTTY Menja terminalni uredjaj koriscen za kontrolu sistema. CTTY uredjaj uredjaj Terminalni uredjaj koji zelite koristiti, kao npr. COM1. . :TEXT_CMDHELP_DATE#1 Prikazuje ili postavlja datum. DATE [/D] [datum] /D odvraca DATE od interaktivnosti. Pokrenite DATE bez parametara za prikaz trenutne postavke datuma i upit za novu. Pritisnite ENTER da zadrzite isti datum. . :TEXT_CMDHELP_DEL#2 Brise jedan ili vise fajlova. DEL [drajv:][putanja]fajl [/P] [/V] ERASE [drajv:][putanja]fajl [/P] [/V] [drajv:][putanja]fajl Navodi fajl(ove) za brisanje. Navedite vise fajlova koristeci se dzoker znacima. /P Poziva upit za potvrdu pre brisanja svakog fajla pojedinacno. /V Prikazuje sve izbrisane fajlove. . :TEXT_CMDHELP_DIR#4 Prikazuje listu fajlova i pod-direktorijuma u direktorijumu. DIR [drajv:][putanja][fajl] [/P] [/W] [/A[[:]atributi]] [/O[[:]nacin]] [/S] [/B] [/L] [/[Y|4]] [drajv:][putanja][fajl] Navodi drajv, direktorijum, i/ili fajlove za listanje. (Moze biti slozena ili visestruka specififikacija fajlova) /A Prikazuje fajlove sa navedenim atributima. (Podraz. /ADHSRA) atributi D Direktorijumi R Read-only (samo za citanje) H Hidden (sakriveni) A Spremni za arhiviranje S Sistemski fajlovi - Prefiks negacije /O Prikazuje fajlove sortirane na navedeni nacin. (Podraz. /ONG) nacin N Po nazivu S Po velicini E Po ekstenziji D Po datumu i vremenu G Grupise direktorijume - Prefiks inverznog redosleda U Nesortirano /P Pauzira posle svakog punog ekrana informacija. /W Koristi format sirokog listanja. /S Prikazuje fajlove u navedenom diru i svim pod-direktorijumima. /B Koristi ogoljeni format (bez zaglavlja i statistike). /L Koristi mala slova. /Y,/4 Prikazuje godinu sa 4 cifre. Prekidaci mogu biti navedeni u DIRCMD promenljivi okruzenja. Ponistite vec navedene prekidace postavljanjem prefiksa "-". Na primer: /-W. . :TEXT_CMDHELP_DOSKEY#1 DOSKEY je omogucen interno u komandnoj ljusci. Ŀ Taster Funkcija Ŀ Gore/Dole Poziva istoriju. Levo/Desno Navigacija kroz komandnu liniju i/ili dopunjavanje trenutne linije prethodno pozvanom komandom. Home/End Pocetak/kraj linije. Insert Promena izmedju moda umetanja i pisanja preko. Tab Dopunjavanje trenutne reci kao naziv fajla. Dvostruki pritisak ce prikazati sve odgovarajuce fajlove. Komanda HISTORY ce prikazati sadrzaj bafera istorije. . :TEXT_CMDHELP_ORIGINAL_DOSKEY#1 NA %1 %9 . :TEXT_CMDHELP_ECHO Prikazuje poruke, ili postavlja-uklanja odjek komandi. ECHO [ON | OFF] ECHO [poruka] ECHO. Pokrenite ECHO bez parametara za prikaz trenutne postavke. "ECHO." ce ispisati praznu liniju na ekran. . :TEXT_CMDHELP_EXIT Napusta trenutno aktivnu komandnu ljusku. EXIT . :TEXT_CMDHELP_FOR Pokrece navedenu komandu za svaki fajl iz navedenog skupa fajlova. FOR %%varijabla IN (skup) DO komanda [parametri] %%varijabla Navodi zamenljivi parametar. (skup) Navodi skup od jednog ili vise fajlova. Dzoker znaci su dozvoljeni. komanda Navodi komandu za izvrsenje nad svakim fajlom iz skupa. parametri Navodi parametre navedene komande. U batch programima, koristite %%%%varijabla umesto %%varijabla. . :TEXT_CMDHELP_GOTO Upucuje komandnu ljusku na liniju odredjenu labelom u batch programu. GOTO labela labela Navodi labelu definisanu u trenutnom batch programu. Labelu pisete samu na liniji, pocinjuci dvotackom. . :TEXT_CMDHELP_HISTORY#1 Prikazuje trenutni sadrzaj bafera istorije. HISTORY . :TEXT_CMDHELP_IF Vrsi uslovno procesiranje u batch programima. IF [NOT] ERRORLEVEL broj komanda IF [NOT] string1==string2 komanda IF [NOT] EXIST fajl komanda NOT Navodi da komandna ljuska treba da izvrsi komandu samo ukoliko je uslov netacan. Negacija uslova. ERRORLEVEL broj Vraca TACNO ukoliko je prethodno pokrenuti program vratio izlazni kod jednak ili veci od navedenog broja. komanda Navodi komandu koja se treba izvrsiti ukoliko je uslov zadovoljen. string1==string2 Vraca TACNO ukoliko su nizovi znakova jednaki. EXIST fajl Vraca TACNO ukoliko fajl sa navedenim imenom postoji. . :TEXT_CMDHELP_LH Ucitava program u gornje memorijsko podrucje. LOADHIGH [drajv:][putanja]fajl [parametri] LOADHIGH [/L:podrucje1[,min_vel1][;podrucje2[,min_vel2]...] [/S]] [drajv:][putanja]fajl [parametri] /L:podrucje1[,min_vel1][;podrucje2[,min_vel2]... Navodi podrucje(a) memorije u koje treba ucitati program. - podrucje1 navodi broj prvog memorijskog podrucja. - min_vel1 navodi minimalnu velicinu, ako postoji, za podrucje1. - podrucje2 navodi broj drugog memorijskog podrucja. - min_vel2 navodi minimalnu velicinu, ako postoji, za podrucje2. Mozete navesti koliko god zelite memorijskih podrucja. /S Smanjuje UMB do svoje minimalne velicine dok se program ucitava. [drajv:][putanja]fajl Navodi lokaciju i naziv programa koji treba ucitati. parametri Parametri programa koji se ucitava. . :TEXT_CMDHELP_LOADFIX Ucitava program iznad prvih 64K memorije i pokrece program. LOADFIX [drajv:][putanja]fajl Upotrebite LOADFIX za ucitavanje programa ukoliko ste dobili poruku "Packed file corrupt" pri pokusaju ucitavanja u nisku memoriju. . :TEXT_CMDHELP_MD Kreira novi direktorijum. MKDIR [drajv:]putanja MD [drajv:]putanja . :TEXT_CMDHELP_PATH Prikazuje ili postavlja putanju za trazenje izvrsnih fajlova. PATH [[drajv:]putanja[;...]] PATH ; Pokrenite "PATH ;" za brisanje svih putanja i usmerenje komandne ljuske na trazenje izvrsnih fajlova samo u trenutnom direktorijumu. Pokrenite PATH bez parametara za prikaz trenutne vrednosti. . :TEXT_CMDHELP_PAUSE Zaustavlja procesiranje batch programa i prikazuje poruku: "Pritisnite bilo koji taster za nastavak..." ili navedenu poruku. PAUSE [poruka] . :TEXT_CMDHELP_PROMPT Menja odziv komandnog prompta. PROMPT [tekst] tekst Navodi novi komandni prompt Prompt moze biti sastavljen od znakova i sledecih specijalnih kodova: $Q = (znak za jednako) $$ $ (znak za dolar) $T Trenutno vreme $D Trenutni datum $P Trenutni drajv i putanja $V Verzija komandne ljuske $N Trenutni drajv $G > (znak za vece-od) $L < (znak za manje-od) $B | (znak za cev) $H Backspace (brise prethodni znak) $E Escape kod (ASCII kod 27) $_ CR i LF kodovi (nova linija) Pokrenite PROMPT bez parametara za reset prompta na standardnu postavku. . :TEXT_CMDHELP_PUSHD Gura trenutni direktorijum na vrh steka direktorijuma, uz opciju da promeni trenutni radni direktorijum. PUSHD [[drajv:]putanja] Gde je [drajv:]putanja nova putanja koju zelite. . :TEXT_CMDHELP_POPD Skida direktorijum sa vrha steka direktorijuma, i postavlja ga za radni. POPD [*] Opcija '*' brise sadrzaj steka direktorijuma. . :TEXT_CMDHELP_DIRS Prikazuje sadrzaj steka direktorijuma. DIRS . :TEXT_CMDHELP_RD Uklanja (brise) direktorijum. RMDIR [drajv:]putanja RD [drajv:]putanja . :TEXT_CMDHELP_REM Obelezava komentar (napomenu) u batch fajlu ili CONFIG.SYSu. REM [komentar] . :TEXT_CMDHELP_REN Menja naziv fajlu ili direktorijumu. RENAME [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2] REN [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2] Dzoker znaci nisu dozvoljeni. Primetite da ne mozete navesti novi drajv ili putanju za odrediste. U tu svrhu upotrebite eksternu komandu MOVE. . :TEXT_CMDHELP_SET#1 Prikazuje, postavlja, ili uklanja promenljive okruzenja. SET [/C] [/P] [promenljiva=[string]] promenljiva Navodi ime promenljive okruzenja. string Navodi niz znakova za dodelu promenljivoj. Ukoliko string nije naveden, promenljiva se uklanja iz okruzenja. Pokrenite SET bez parametara za prikaz trenutnih promenljivi okruzenja. /C Prisiljava zadrzavanje navedene velicine slova promenljive. /P Poziva upit sa stringom i dodeljuje korisnicki unos promenljivoj. Promenljiva se standardno menja u velika slova, ukoliko se vec ne nalazi u okruzenju, inace se navedena velicina slova zadrzava. . :TEXT_CMDHELP_SHIFT#1 Menja poziciju zamenljivih parametara u batch fajlu. SHIFT [DOWN] DOWN pomera prozor argumenata prema pocetku (%%0). U ostalim slucajevima pomera isti prema kraju. . :TEXT_CMDHELP_TIME#1 Prikazuje ili postavlja sistemsko vreme. TIME [/T] [vreme] /T odvraca TIME od interaktivnosti. Pokrenite TIME bez parametara za prikaz trenutne postavke vremena i upit za novu. Pritisnite ENTER da sacuvate isto vreme. . :TEXT_CMDHELP_TRUENAME Prikazuje punu putanju trenutne ili navedene putanje. TRUENAME [[drajv:][putanja][fajl]] . :TEXT_CMDHELP_TYPE Prikazuje sadrzaj tekstualnih fajlova. TYPE [drajv:][putanja]fajl . :TEXT_CMDHELP_VER Prikazuje verziju komandne ljuske i ostale informacije. VER [/R] [/W] [/D] [/C] /R Verzija jezgra i ostale informacije. /W Garancija komandne ljuske. /D Informacije o pravilima redistribuiranja. /C Imena saradnika. . :TEXT_CMDHELP_VERIFY Postavlja ili uklanja dodatne provere korektnosti upisa fajlova na disk. VERIFY [ON | OFF] Pokrenite VERIFY bez parametara za prikaz trenutne postavke. . :TEXT_CMDHELP_FDDEBUG NA . :TEXT_CMDHELP_VOL Prikazuje labelu volumena i serijski broj, ukoliko isti postoje. VOL [drajv:] . :TEXT_CMDHELP_QUESTION#1 Prikazuje listu komandi i osobina dostupnih u ljusci. ? ?komanda [argument] Prva varijanta prikazuje dostupne komande i osobine ljuske. Druga varijanta ce izneti upit da li se navedena komanda treba izvrsiti, kao da je mod pracenja aktivan. . :TEXT_CMDHELP_WHICH Trazi i prikazuje izvrsne fajlove za svaku navedenu komandu. WHICH {komanda} . :TEXT_CMDHELP_MEMORY#1 NA . :TEXT_ERROR_COPY_PLUS_DESTINATION#1 Odrediste COPY ne sme sadrzati plus ('+') znakove. . :TEXT_DELETE_FILE#1 Brisanje fajla "%s". . ================================================ FILE: suppl/algnbyte.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* one byte alignment */ /* do not use with Micro-C ! */ #if defined(__WATCOMC__) #if __WATCOMC__ > 1000 #pragma pack(__push,1); #else #pragma pack(1); #endif #elif defined(_MSC_VER) || defined(_QC) || defined(__GNUC__) #pragma pack(1) #elif defined(__ZTC__) #pragma ZTC align 1 #elif defined(__TURBOC__) && (__TURBOC__ > 0x202) #pragma option -a- #endif ================================================ FILE: suppl/algndflt.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* set structure alignment to default */ /* do not use with Micro-C ! */ #if defined(__WATCOMC__) #if __WATCOMC__ > 1000 #pragma pack(__pop); #else #pragma pack(); #endif #elif defined (_MSC_VER) || defined(_QC) || defined(__GNUC__) #pragma pack() #elif defined (__ZTC__) #pragma ZTC align #elif defined(__TURBOC__) && (__TURBOC__ > 0x202) #pragma option -a. #endif ================================================ FILE: suppl/appname.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the application name/path etc. functions. For details refer to DOC\DETAILS.TEX */ #ifndef __APPNAME_H #define __APPNAME_H #ifndef __PORTABLE_H #include #endif #ifndef __DFN_H #include "dfn.h" #endif char *appName(void); char *appPath(void); char *appFile(void); char *appNameEx(void); char *appPathEx(void); char *appFileEx(void); int appInit(const char * const fnam); int appInitEx(const char * const fnam); int appInitEnv(void); int appInitEnvEx(void); #endif ================================================ FILE: suppl/clnsuppl.bat ================================================ @echo off IF EXIST SKIP goto noSrc rem for %%a in (compile.me *.h suppl*.lib suppl*.lst vars.bat) do if exist %%a del %%a for %%i in (all_done untar.exe untar.com untar.obj untar.map gnumake.mak) do if exist %%i del %%i>nul for %%i in (compile.me suppl*.lib suppl*.lst echoto.bat vars.bat *.cfg) do if exist %%i del %%i>nul IF NOT EXIST src\NUL goto noSrc cd src FOR %%A in (*.obj) DO DEL %%A for %%a in (suppllib.rsp echolib.bat *.cfg gnumake.mak) do if exist %%a del %%a>nul rem FOR %%A in (NLS\*.*) DO DEL %%A rem RMDIR nls CD .. rem RMDIR src :noSrc ================================================ FILE: suppl/cntry.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ DOS NLS implementation -- "Country" information DOS-65-XX See DOC\CNTRY.H These functions provide an easy access to the information stored in the DOS NLS, but does not actually offer any functions to transform/compare etc. */ #ifndef __CNTRY_H #define __CNTRY_H #ifndef __PORTABLE_H #include #endif #include "suppl.h" /* All information from Ralf Brown's interrupt list v5.6 */ struct Country_ { /* local copy of country information */ /* pointers to tables */ fartbl uppercaseTbl; /* uppercase for "normal" characters */ fartbl lowercaseTbl; /* lowercase for "normal" chars (maybe NULL) */ fartbl fupcaseTbl; /* uppercase for filename characters */ fartbl collateTbl; /* collating table */ #if defined(DBCS) fartbl dbcsTbl; /* DBCS table */ #endif fartbl illegalChars; /* illegal characters in filenames */ int illegalLen; /* illegal characters in filenames */ /* length of the tables If length <= 0x80 the table does not contain values for the indexs 0..0x7F, but the pointers are adjusted that index 0x80 really points to the first entry of the table. */ int uppercaseLen; /* uppercase for "normal" characters */ int lowercaseLen; /* lowercase for "normal" chars (maybe NULL) */ int fupcaseLen; /* uppercase for filename characters */ int collateLen; /* collating table */ /* Extended country information */ word country; /* currently active DOS country code */ word charset; /* currently active DOS codepage */ word datefmt; /* format of date: 0/1/2 == USA/Europe/Japan */ byte curSymbol[6]; /* ASCIZ currency symbol */ byte thousendsSep[3]; /* ASCIZ decimal separator */ byte decimalSep[3]; /* ASCIZ decimal separator */ byte dateSep[3]; /* ASCIZ date separator */ byte timeSep[3]; /* ASCIZ time separator */ byte listSep[3]; /* ASCIZ list separator */ byte curFormat; /* bit 0: 0/1 == preceed/follow value bit 1: separate cur sym from value by one space bit 2: cur sym replaces decimal point */ byte precision; /* number of digits after decimal point */ byte timefmt; /* bit 0: 0/1 == 12/24 hour clock */ /* valid filename characters */ byte inclFirst, inclLast; /* permissible character range */ byte exclFirst, exclLast; /* excluded character range */ byte initialized; }; #ifdef _MICROC_ #define Country struct Country_ #else /*# !(defined(_MICROC_)) */ typedef struct Country_ Country; #endif /*# defined(_MICROC_) */ Country *nlsInfo(void); /* * Return a pointer to a filled copy of above structure * * During the life-time of a program the information is retrieved once. * * Return: Always != NULL, but maybe ome fields are NULL. */ Country *nlsNewInfo(void); /* * As nlsInfo(), but causes to reread the information cached by * nlsInfo(). */ #endif /*# !defined(__CNTRY_H) */ ================================================ FILE: suppl/compat/conio.h ================================================ /* conio.h compatibility header */ #ifndef __CONIO_H #define __CONIO_H #include #define cputs(x) fputs((x),stdout) static inline int getch(void) { unsigned char ch; asm volatile("int $0x21" : "=Ral"(ch) : "a"(0x700)); return ch; } #endif ================================================ FILE: suppl/compat/dos.h ================================================ /* dos.h compatibility header */ #ifndef __DOS_H #define __DOS_H static inline unsigned char inportb (unsigned short int port) { unsigned char v; asm volatile ("inb %w1,%0":"=a" (v):"Nd" (port)); return v; } static inline void outportb (unsigned short int port, unsigned char value) { asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port)); } /* From LGPL DJGPP libc, Copyright (C) 1995 DJ Delorie */ static inline void sound(int freq) { int scale = 1193046 / freq; outportb(0x43, 0xb6); outportb(0x42, scale & 0xff); outportb(0x42, scale >> 8); outportb(0x61, inportb(0x61) | 3); } static inline void nosound(void) { outportb(0x61, inportb(0x61) & ~3); } union REGPACK { struct { unsigned char al, ah, bl, bh, cl, ch, dl, dh; } h; struct { unsigned short ax, bx, cx, dx, bp, si, di, ds, es, flags; } x; }; extern void _intrf(int nr, union REGPACK *r) __attribute__((regparmcall)); static inline unsigned getpsp(void) { unsigned psp, scratch; asm volatile("int $0x21" : "=a"(scratch), "=b"(psp) : "Rah"((unsigned char)0x62) : "cc"); return psp; } #define _psp getpsp() static inline unsigned char getosmajor(void) { unsigned char osmajor, scratch; asm volatile("int $0x21" : "=Ral"(osmajor), "=Rah"(scratch) : "1"((unsigned char)0x30) : "bx", "cx", "cc"); return osmajor; } #define _osmajor getosmajor() #define FP_OFF(fp) ((unsigned)(fp)) #define FP_SEG(fp) ((unsigned)((unsigned long)(void __far *)(fp)>>16)) #endif ================================================ FILE: suppl/compat/io.h ================================================ /* io.h compatibility header */ #ifndef __IO_H #define __IO_H #include #ifdef __GNUC__ #define _lseek lseek #endif extern int _open(const char *pathname, int flags, ...); extern int _creat(const char *pathname, mode_t mode); extern int _read(int fd, void *buf, size_t cnt); extern int _write(int fd, const void *buf, size_t cnt); extern int _close(int fd); extern long int _lseek(int fd, long int pos, int whence); static inline long int filelength(int fd) { long int cur = _lseek(fd, 0, SEEK_CUR); long int fsize = _lseek(fd, 0, SEEK_END); _lseek(fd, cur, SEEK_SET); return fsize; } #endif ================================================ FILE: suppl/compat/process.h ================================================ /* process.h compatibility header */ #ifndef __PROCESS_H #define __PROCESS_H #include #endif ================================================ FILE: suppl/dfn.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the DOS filename functions. */ #ifndef __DFN_H #define __DFN_H #include #ifndef __PORTABLE_H #include #endif #include #ifdef _TC_LATER_ #include #endif #ifdef __TURBOC__ #include #endif /* To support UNC paths, all functions are macro'ed from dfn*() ---> dfnu*() */ #ifdef SUPPORT_UNC_PATH #define dfnmerge dfnumerge #define dfnsplit dfnusplit #define dfnexpand dfnuexpand #define dfnsqueeze dfnusqueeze #define dfnmatch dfnumatch #define dfnfullpath dfnufullpath #define dfnfullpath2 dfnufullpath2 #endif #define DFN_FILE 0x4000 #define DFN_LFN 0x2000 #define DFN_SHARABLE 0x0080 #define DFN_PENDING_DELETE 0x0080 #define DFN_ARCHIVE 0x0020 #define DFN_DIRECTORY 0x0010 #define DFN_LABEL 0x0008 #define DFN_VOLUME 0x0008 #define DFN_SYSTEM 0x0004 #define DFN_HIDDEN 0x0002 #define DFN_WRITE 0x0001 #define DFN_WRITABLE DFN_WRITE /* Derived attributes */ #define DFN_READ DFN_FILE /* every file can be read */ #define DFN_READABLE DFN_READ struct DFN_GLOB_t { char *dfn_basedir; struct { unsigned dfn_rewind:1; unsigned dfn_eof:1; } dfn_flags; unsigned dfn_searchattr; size_t dfn_basedirlen; size_t dfn_basediroffset; void *dfn_data; char dfn_pattern[1]; }; #ifndef _MICROC_ typedef struct DFN_GLOB_t DFN_GLOB; #else #define DFN_GLOB struct DFN_GLOB_t #endif char *dfnexpand(const char * const fname, char * const path); char *dfnfullpath(const char * const fname); char *dfnfullpath2(const char * const fname); char *dfnmerge(char *fname, const char * const dr, const char * const path , const char * const name, const char * const ext); int dfnsplit(const char * const fname, char ** const dr, char ** const path, char ** const name, char ** const ext); char *dfnsqueeze(const char * const fname); char *dfnpath(int drive); char *dfntruename(const char * const fn); char *dfnsearch(const char * const fname, const char * const path, const char * const ext); int dfnmatchcomponent(const char *fnam, const char *pattern); int dfnmatchcomponent2(const char *fnam, const char *pattern); int dfnmatchext(const char *const fnam, const char *pattern); int dfnmatchext2(const char *const fnam, const char *pattern); int dfnmatch(const char *fnam, const char *pattern); int dfnmatch2(const char *fnam, const char *pattern); int dfnmatchEx(const char *fnam , const char *pattern , int (*matchfct)(const char *, const char *)); int isUNCpath(const char * const fname); char *UNCpath(const char * const fname); int dfnwrdir(const char * const fnam); int dfnstat(const char * const fnam); int dfnmkfile(const char * const fnam); void dfn_tmpnam(char * const fnam); char *dfnmktmp(const char * const path, const char * const ext); char *dfnfilename(const char * const fnam); char *dfnextension(const char * const fnam); char *dfnfilenameext(const char * const fnam); char *dfnbakname(const char * const fnam); int dfnfreplace(const char * const newname, const char * const oldname); int dfndelim(const int ch); int dfndelim2(const int ch); char *dfnglobfilename(DFN_GLOB * const dir); char *dfnglobfullfilename(DFN_GLOB * const dir); DFN_GLOB *dfnglobinit(const char * const pattern, unsigned flags); int dfnglobread(DFN_GLOB *const dir); void dfnglobfree(DFN_GLOB *dir); #endif ================================================ FILE: suppl/dynstr.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Dynamic string functions. ob(ject): dynstr su(bsystem): dynstr ty(pe): sh(ort description): Basic data type to represent a dynamic string lo(ng description): pr(erequistes): va(lue): a (char*) pointer, must be initialized prior use re(lated to): se(condary subsystems): in(itialized by): user wa(rning): bu(gs): co(mpilers): ob(ject): STR_SAVED_TOKENS su(bsystem): dynstr ty(pe): sh(ort description): data type for reentrant \tok{strtok()} function lo(ng description): This data type is used to save to and restore from reentrant information of the function \tok{StrTokenize()}. pr(erequistes): va(lue): Blackbox type used by \tok{StrTokSave()} and \tok{StrTokRestore()} only. re(lated to): StrTokenize StrTokSave StrTokRestore se(condary subsystems): in(itialized by): StrTokSave wa(rning): bu(gs): co(mpilers): ob(ject): STR_QUOTES su(bsystem): dynstr ty(pe): sh(ort description): data type for quote-related functions lo(ng description): This structure consists of members describing what quotes and character to be quoted the quote-related functions shall be aware of. The members enumerate the word delimiters, characters to be quoted, single character quotes, pairily used quotes and unpairily used quotes. pr(erequistes): va(lue): re(lated to): StrQuote StrUnquote StrAppQStr se(condary subsystems): in(itialized by): user wa(rning): bu(gs): co(mpilers): ob(ject): StrTokStop su(bsystem): dynstr ty(pe): sh(ort description): End a \fct{StrTokenize()} inspection lo(ng description): Instructres the function \fct{StrTokenize} to flush all internal values in order to return \fct{NULL} next time it is called and, therefore, definitely end a tokenizer loop \em{and} ensures that the string has been restored to its original value. pr(erequistes): va(lue): none re(lated to): StrTokenize se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #ifndef __DYNSTR_H #define __DYNSTR_H #ifndef _MICROC_ #include #endif #include #include "sstr.h" #include "nls_c.h" struct STR_SAVED_TOKENS_ { char *str_next_saved_tokens; char str_ch_saved_tokens; }; #ifdef _MICROC_ #define STR_SAVED_TOKENS struct STR_SAVED_TOKENS_ #else typedef struct STR_SAVED_TOKENS_ STR_SAVED_TOKENS; #endif /* Enumerates all quotes a string may be quoted with: */ /* If one member is equal to NULL or "", the particular value does not exist. */ struct STR_QUOTES_ { const char /* Characters that delimit two strings and must be quoted if they appear within a string. */ *str_delimiters /* Characters that must be quoted if they appear within a string. */ ,*str_toquote /* Characters that quote the immediately next character as the backslash '\' does in C. These quotes are still "active" within otherwise quoted strings. */ ,*str_singleQuotes /* Characters that enclose a quoted string. The same character appears before and after the string, just like the '"' in C. */ ,*str_pairyQuotes /* Characters that enclose a quoted string. The first character, the one on an even offset (first character has offset == 0), is the left quote, the second character is the right one. Compareble to parenthizes. */ ,*str_unpairyQuotes /* Pairy and unpairy quotes (the left one is checked) that quote single quotes, too. */ ,*str_fullQuotes ; }; #ifdef _MICROC_ #define STR_QUOTES STR_QUOTES_ #else typedef struct STR_QUOTES_ STR_QUOTES; #endif #ifdef _MICROC_ #define dynstr char * #else typedef char * dynstr; #endif int StriCmp(const char *s1, const char *s2); char *StrDup(const char * const s); #define StrChg(poi,size) StrChg_(&(poi), (size)) char *StrChg_(char ** const poi, size_t len); #define StrFree(str) StrRepl_(&(str), 0) #define StrFree_(str) StrRepl_((str), 0) #define StrRepl(dest,src) StrRepl_(&(dest), (src)) char *StrRepl_(char ** const dest, char * const src); #ifdef _MICROC_ register char *StrConcat(int argcnt); register char *EStrConcat(int argcnt); #else char *StrConcat(int argcnt, ...); char *EStrConcat(int argcnt, ...); #endif char *StrTrim(char * const s); char *StrChar(int ch); char *StrStrip(char * const s, int ch); #define StrCpy(dest,src) StrCpy_(&(dest), (src)) char *StrCpy_(char ** const dest, const char * const src); /* Copy (duplicate) the string src[] into dest. If src == NULL, this function is equal to StrFree(dest). Return: NULL: malloc() failed || src == NULL else: *dest */ #define StrAppDelimStr(dst,src,q) \ StrAppDelimStr_(&(dst), (src), (q)) char *StrAppDelimStr_(char ** const dst, const char * const src , const STR_QUOTES * const quotes); #define StrAppStr(dst,src) StrCat_(&(dst), (src)) #define StrAppStr_ StrCat_ #define StrCat(dest,src) StrCat_(&(dest), (src)) char *StrCat_(char ** const dest, const char * const src); #define StrAppQStr(dst,src,quote_struct) \ StrAppQStr_(&(dst), (src), (quote_struct)) char *StrAppQStr_(char ** const dest, const char * const src , const STR_QUOTES * const quotes); #define StrAppChr(dest,chr) StrAppChr_(&(dest), (chr)) char *StrAppChr_(char ** const dest, char chr); char *StrQuote(const char * const s, const STR_QUOTES * const quotes); char *StrUnquote(const char * const s, const STR_QUOTES * const quotes); int StrUnquoteTokenAppend(const char **src, const STR_QUOTES * const quotes , char ** const dst); int StrUnquoteToken(const char **src, const STR_QUOTES * const quotes , char ** const dst); char *StrTokenize(char *str, const char * const token); #define StrTokStop() (void)StrTokenize(0, 0) void StrTokSave(STR_SAVED_TOKENS *st); void StrTokRestore(STR_SAVED_TOKENS *st); char *StrLeft(const char * const s, size_t length); char *StrRight(const char * const s, size_t length); char *StrMiddle(const char * const s, size_t pos, size_t length); char *StrTail(const char * const s, unsigned pos); #ifdef _MICROC_ #define StrBeg strbeg #else int StrBeg(const char * const s1, const char * const s2); #endif /* !defined(_MICROC_) */ int StrCString(char *str); char *StrWord(char *s); char *StrChr(const char * const s, int ch); size_t StrnLen(const char * const s, size_t len); char *StrDupe(const char * const beg, const char * const end); /* #define StrEnd Strend */ extern void *Emalloc(size_t len); extern void *Ecalloc(size_t len); extern void *Erealloc(void *p, size_t size); void *Esetsize(void **const p, size_t); void *Eresize_(void **const p, size_t); #define Esetsize(poi,size) Esetsize_((void**)&(poi), (size)) #define Eresize(poi,size) Eresize_((void**)&(poi), (size)) extern char *Estrdup(const char * const str); #define Estrchg(var,str) Estrchg_(&(var),(str)) extern char *Estrchg_(char ** const pvar, const char * const str); extern char *Estrdupe(const char * const start, const char * const end); #endif ================================================ FILE: suppl/environ.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ * $Locker$ $Name$ $State$ Declaration of the subsystem environ ob(ject): su(bsystem): environ ty(pe): sh(ort description): Type of the walkfunction passed to \fct{env_forAll} lo(ng description): pr(erequistes): va(lue): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #ifndef __ENVIRON_H #define __ENVIRON_H #include #ifdef _MICROC_ #define ENV_WALKFUNC int * #else typedef int (*ENV_WALKFUNC)(void *, word, word); #endif #ifndef _MICROC_ /* In order to use these macros, must be #include'd */ #define env_glbSeg peekw(_psp, 0x2c) /* return the current env seg addr */ #define env_setGlbSeg(a) pokew(_psp, 0x2c, (a)) /* set the current env seg addr */ #else #define env_glbSeg env_glbSeg_() #define env_setGlbSeg env_setGlbSeg_ #endif /* SUPPL may support two "default" segments: env_glbSeg - the global segment as defined by the PSP, and env_dfltSeg - an user-defined env segment, which is to replace the global segment fully (in regards of SUPPL) Environment functions, that excepts "0" as environent segment, expand use env_dfltSeg first, env_glbSeg then. The portable way is to use the function, though, for speed efficency they are implemented via a global variable. */ #define env_dfltSeg (suppl_dfltEnvSegm) #define env_setDfltSeg(value) (suppl_dfltEnvSegm = (value)) extern unsigned env_resizeCtrl; /* Standard settings: deny shrinking & moving, use UMBs, best fit */ #define ENV_SHRINKBELOW 1 /* resize below last used byte (will destroy environment, is necessary to delete env) */ #define ENV_ALLOWMOVE 2 /* re-allocate environment segment if grow fails */ #define ENV_USEUMB 4 /* when env moves, search in UMBs first */ #define ENV_FIRSTFIT 8 /* when env moves, use allocation stragegy First Fit */ #define ENV_LASTFIT 16 /* when env moves, use allocation stragegy Last Fit */ /* If both ENV_FIRSTFIT & ENV_LASTFIT are set, behaviour is undefined */ /* If none of the above are set, Best Fit is used */ /* Defines for the env_replace() function: */ #define ENV_DELETE 1 /* free old environment segment */ #define ENV_COPY 2 /* copy old environment into new segment, may destroy the environment, if new seg is smaller than old one. */ #define ENV_CLEAR 4 /* initialize new environment, so it does not contain neither variables nor strings */ #define ENV_CREATE 8 /* create a new environment */ #define ENV_FREECOUNT 16 /* minimum amount of unused bytes specified */ #define ENV_LIMITED 32 /* create smallest possible enviroment */ /*!!!!!!!!! All these functions replace segm by the current used environment if it is zero. The environment must be initialized with the environement variable area and the string area (in the simpliest case, three byes 0). !!!!!!!!!*/ #ifdef _MICROC_ word env_glbSeg_(void); void env_setGlbSeg_(const word segm); #endif word env_create(const unsigned length); void env_delete(word segm); void env_clear(word segm); int cpyenv(const char * const var, char * const dst, const unsigned length); int env_get(word segm, const char * const var, char * const dst, const unsigned length); char *dupvar(const char * const var); char *env_dupvar(word segm, const char * const var); char *env_fetch(word segm, const char * const var); #ifndef __GNUC__ int putenv(const char *var); #endif #define chgenv(name,value) env_change(0,name,value) int env_change(word segm, const char * const var, const char * const value); int env_ovrVarOffset(word segm, word ofs, const char *varname , const char * const value); int env_insVarOffset(word segm, word ofs, const char * const varname , const char * const value); #ifdef _MICROC_ register word env_replace(word env /*, int mode, word segm/length*/); #else word env_replace(word env, int mode, ... /*word segm/length*/); #endif int env_matchVar(word segm, char * const var); int env_findAnyVar(word segm, const char * const var, word *ecase, word *icase); int env_noSpace(word segm, const char * const name, const char * const value, const word ign); word env_resize(word segm, int delta); word env_setsize(word segm, unsigned length); #define env_newsize(s,l) env_setsize((s), (l)) int env_forAll(word env, ENV_WALKFUNC fct, void *arg); word env_master(void); word env_shell(void); /********* Environment String handling functions *********/ int env_nullStrings(word segm); /* int env_strings(const word segm); */ #define env_strings(segm) env_strcounter((segm), 0) int env_strcounter(word segm, int diff); word env_string(word segm, int stringNr); int env_strcpy(word segm, char * const buf, const int len, const int stringNr); char *env_strdup(word segm, const int stringNr); int env_strput(word segm, const char * const buf, const int stringNr); int env_strinsert(word segm, const char * const buf, const int stringNr); /********* DO NOT PASS ZERO INTO THESE FUNCTIONS!!! *********/ word env_findVar(const word segm, const char * const var); void env_subVarOffset(word segm, word offset); int env_appVar(word segm, const char * const name, const char * const value); int env_check(const word segm); /* Check the environemnt, the return value: 0: environment OK 1: no environment at all (envseg is NULL) 2: PSP corrupt (envseg points to an invalid memory block) 3: variable's space corrupted 4: no string table 5: string table corrupted or no string table at all */ word env_firstFree(const word segm); word env_endOfVars(const word segm); word env_freeCount(const word segm); unsigned env_varlen(const word segm, const word offs); void env_relocateSegment(const word segm, const word tosegm); /* Private variables made public for efficency purpose only. Any use of them is highly unportable! */ extern word suppl_dfltEnvSegm; #endif ================================================ FILE: suppl/errcodes.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Error codes used by most functions returning (int) error codes within SUPPL */ #ifndef __ERRCODES_H #define __ERRCODES_H #define ESUPPL_NONE 0 /* no error */ #define ESUPPL_OK 0 /* no error */ #define ESUPPL_ZERO 0 /* no error */ #define ESUPPL_MEM 1 /* out of memory */ #define ESUPPL_NOMEM ESUPPL_MEM /* env: environment segment too small */ #define ESUPPL_MISSINFO 2 /* missing information */ #define ESUPPL_FPATH 30 /* ill-formed filename path */ #define ESUPPL_FACCESS 31 /* file access error */ #define ESUPPL_INIT 40 /* Not initialized */ #define ESUPPL_INVAL 50 /* Invalid argument, argument out of range */ #define ESUPPL_INVENV 51 /* Invalid environment */ #define ESUPPL_RANGE 52 /* Result too large */ /* env: returned string too large for buffer */ #define ESUPPL_NOENV 53 /* No environment at all */ #define ESUPPL_NOENT 55 /* No entry / no such file or directory */ /* env: no such variable / string */ #endif ================================================ FILE: suppl/external.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __EXTERNAL_H #define __EXTERNAL_H extern char *ARGV[]; extern int ARGC; extern unsigned PSP; extern unsigned _AX_, _BX_, _CX_, _DX_, _DI_, _SI_; extern unsigned char Longreg[]; extern unsigned IOB_size; #define fileno(a) ((a)->FILE_handle) #endif ================================================ FILE: suppl/fmemory.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Far memory handling function. */ #ifndef __FMEMORY_H #define __FMEMORY_H #include #ifdef _MICROC_ /* for use for Micro-C only */ #define MK_FP(seg,ofs) (seg), (ofs) #define TO_FP(var) get_ds(), (var) #define _fnormalize(seg,ofs) _fnormalize_(&(seg), &(ofs)) #else /* !_MICROC_ */ #ifdef _TC_LATER_ #include #else /* !_TC_LATER_ */ #if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) #ifdef _PAC_NOCLIB_ #include #define _fmemcpy farmemcpy #define _fmemset farmemset #else /* !_PAC_NOCLIB_ */ void far *_fmemcpy(void far * const dst, const void far * const src, unsigned length); void far *_fmemset(void far * const dst, int ch, unsigned length); #endif /* _PAC_NOCLIB_ */ unsigned _fstrlen(const char far * const s); char far *_fstrchr(const char far * const s, int ch); char far *_fmemchr(const char far * const s, int ch, unsigned length); void far *_fmemmove(void far * const dst, const void far * const src, unsigned length); int _fmemcmp(const void far * const dst, const void far * const src, unsigned length); int _fmemicmp(const void far * const dst, const void far * const src, unsigned length); int _fstrcmp(const char far * const dst, const char far * const src); int _fstricmp(const char far * const dst, const char far * const src); void _fstrcpy(char far * const dst, const char far * const src); #endif /* defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) */ #endif /* _TC_LATER_ */ #if defined(HI_TECH_C) || defined(_TC_EARLY_) #endif /* HiTech C has no huge pointers & early Turbo C does ignore the cast */ /* In some circumstances any Borland C compiler do ignore the cast, so the macro is not suitable */ void far *_fnormalize(void far *poi); /* #define _fnormalize(poi) ((void huge *)(poi)) */ char *_fdupstr(const char far * const s); #endif /* _MICROC_ */ #ifdef _MICROC_ unsigned _fstpcpy(unsigned const dseg, unsigned dofs , unsigned const sseg, unsigned sofs, unsigned length) #else /* !_MICROC_ */ char far* _fstpcpy (char far* dst, const char far* src); #endif /* _MICROC_ */ #endif ================================================ FILE: suppl/getopt.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations of the GETOPT subsystem. If macro GETOPT_LONG_NO_FLAG_MEMBER is defined before #including this header, the 'options' structure does not contain the 'flag' member. */ #ifndef __GETOPT_H #define __GETOPT_H #include struct option { const char *name; int has_arg; #ifndef GETOPT_LONG_NO_FLAG_MEMBER int *flag; #endif int val; }; struct getopt_save_t { int gs_optind, gs_opterr; const char *gs_optcur; }; extern int optind, /* index into argv[] array */ optopt, /* unmodified last-read character */ opterr; /* if non-zero, visually displays errors */ extern char *optarg; /* address of argument of an argumented option */ extern const char *optcur; /* address of next character to parse as option; if NULL, uses argv[optind] */ int getopt(int argc, const char * const * const argv, const char * const options); int getopt_long(int argc, const char * const * const argv , const char * const optstring , const struct option * const longopts, int * const longindex); int getopt_long_only(int argc, const char * const * const argv , const char * const optstring , const struct option * const longopts, int * const longindex); int getopt_long_noFlag(int argc, const char * const * const argv , const char * const optstring , const struct option * const longopts, int * const longindex); int getopt_long_only_noFlag(int argc, const char * const * const argv , const char * const optstring , const struct option * const longopts, int * const longindex); #ifdef GETOPT_LONG_NO_FLAG_MEMBER #define getopt_long getopt_long_noFlag #define getopt_long_only getopt_long_only_noFlag #endif #define getopt_save(s) getopt_save_(aS(s)) void getopt_save_(struct getopt_save_t * const sbuf); #define getopt_restore(s) getopt_restore_(aS(s)) void getopt_restore_(struct getopt_save_t * const sbuf); void getopt_init(void); #endif ================================================ FILE: suppl/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak TOP = .. !include "$(TOP)/config.mak" all : src/$(CFG) src/$(CFG) : $(CFG) $(CP) $(CFG) src clean : clnsuppl.bat ================================================ FILE: suppl/mcb.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ * $Locker$ $Name$ $State$ * * header file for the MCB handling functions */ #ifndef __MCB_H #define __MCB_H #include #define SEG2MCB(segm) ((segm) - 1) #define MCB2SEG(mcb) ((mcb) + 1) /* Don't use this constant; use SEG2MCB() or MCB2SEG() instead */ #define SEG_OFFSET 0x10 word mcb_env(const word segm); #ifdef NDEBUG #define mcb_env(mcb) peekw((mcb), SEG_OFFSET + 0x2c) #endif #include struct MCB { byte mcb_type; /* type of MCB, 'Z': no following MCB, 'M': following */ word mcb_ownerPSP; /* PSP number of owner of this block */ word mcb_size; /* size of this MCB */ byte mcb_rsrvd[3]; /* unused */ byte mcb_name[8]; /* name of program file name if PSP created in exec() */ }; #include struct SUPPL_verify_alignment_MCB { char x[ 1 ]; }; /* Don't use these constant; use offsetof(struct MCB, xxx) instead */ #define MCB_OFF_TYPE 0 #define MCB_OFF_OWNER 1 #define MCB_OFF_SIZE 3 #define MCB_OFF_NAME 8 #ifdef _MICROC_ #define MCB_WALKFUNC int * #else typedef int (*MCB_WALKFUNC)(void *, word); #endif unsigned mcb_length(const word segm); int mcb_walk(word mcb, const MCB_WALKFUNC fct, void * const arg); int isShell(const word mcb); int isPSP(const word mcb); int isMCB(const word mcb); int isEnv(const word mcb); word nxtMCB(word mcb); int mcb_allParents(word mcb, MCB_WALKFUNC fct, void *arg); word mcb_primaryShell(void); word mcb_owner(word mcb); word mcb_shell(word mcb); word mcb_first(void); #endif ================================================ FILE: suppl/msglib.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Global message handling definitions. */ #ifndef __MSGLIB_H #define __MSGLIB_H #include #include /* * Some macros of message groups */ #define GLOBAL_GROUP 8 #define LOCAL_GROUP 0 #define msgIsGlobal(grp) ((grp) >= GLOBAL_GROUP) #define msgIsLocal(grp) ((grp) < GLOBAL_GROUP) #ifndef MSG_METHOD /* No method specified -> default to access method #1 */ #define MSG_METHOD 1 #endif /*# !defined(MSG_METHOD) */ /* * At this point exactly one of MSG_METHOD? is defined and valid */ #if MSG_METHOD == 1 #include #endif /*# MSG_METHOD == 1 */ #if MSG_METHOD == 2 #include #endif /*# MSG_METHOD == 2 */ /* Source-In the initialization for all access methods */ #include /**REMOVE ON**/ #define Y_errMR "Error in message retreiver:\n" #define Y_noMem "Out of memory\n" #define MSG_errNrMR 125 /**REMOVE OFF**/ #endif /*# !defined(__MSGLIB_H) */ ================================================ FILE: suppl/msgs.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ SUPPL message implementation Each of these functions emit one particular error. One can create a library implementing just these functions and link it _before_ SUPPL, and one gets an user-specific error handling. */ #ifndef __MSGS_H #define __MSGS_H #include #include "msgs_w.loc" void Esuppl_argMissing(char ch); void Esuppl_nonArgOption(char ch); void Esuppl_argOption(char ch); void Esuppl_lArgOption(const char * const name); void Esuppl_option(char ch); /* option not found */ void Esuppl_lOption(const char * const name); /* option not found */ void Esuppl_longOption(void); void Esuppl_noMem(void); void Esuppl_writeFile(const char * const fnam); void Esuppl_accessFile(const char * const fnam); void Esuppl_openFile(const char * const fnam); void Esuppl_createFile(const char * const fnam); void Esuppl_readFile(const char * const fnam); void Esuppl_creatTmpFnam(void); void Esuppl_tmpOpen(const char * const fnam); void Esuppl_wrCfgFile(const char *fnam); void Esuppl_ovrLinkcount(const char *fnam); extern void hlpScreen(void); extern const char Y_noFNam[]; #endif ================================================ FILE: suppl/nls.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ DOS NLS implementation -- "use" functions of the NLS info */ #ifndef __NLS_H #define __NLS_H #include "cntry.h" struct SupplTime { /* Universial time/date structure */ /* This structure is used by all NLS time/date based functions and may be initialized partially only */ int ti_hour, ti_minute, ti_second, ti_hundred; int ti_day, ti_month, ti_year; int ti_weekday; }; #ifndef _MICROC_ typedef struct SupplTime nlstime; #else #define nlstime struct SupplTime #endif /* * Fill in the time portions: hour, minute, seconds, hundred seconds */ void nlsCurTime(nlstime *t); /* * Fill in the date portions: day, month, year */ void nlsCurDate(nlstime *t); #endif /*# !defined(__CNTRY_H) */ ================================================ FILE: suppl/nls_c.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ NLS-depended dynamic string functions. */ #ifndef __NLS_C_H #define __NLS_C_H #include int toLower(int ch); int toUpper(int ch); int toFUpper(int ch); #define memcmpI MemiCmp int MemiCmp(const byte *buf1, const byte *buf2, unsigned len); #define _fmemcmpI _fMemiCmp #ifdef _MICROC_ int _fMemiCmp(unsigned const dseg, unsigned dofs , unsigned const sseg, unsigned sofs, unsigned length); #else int _fMemiCmp(const byte far * dest, const byte far * src, unsigned length); #endif int StriCmp(const char *s1, const char *s2); char *StrUpr(char *s); char *MemUpr(char buf[], unsigned length); void _fStrUpr(const word dseg, word dofs); void _fMemUpr(const word dseg, word dofs, unsigned length); int isodigit(int ch); #define isodigit(ch) ((ch) >= '0' && (ch) <= '7') int toxdigit(int ch); #endif ================================================ FILE: suppl/nls_f.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for NLS depended DOS filename functions. */ #ifndef __NLS_F_H #define __NLS_F_H #include int toFUpper(int ch); #define memcmpFI MemFCmp int MemFCmp(const void *buf1, const void *buf2, unsigned len); #define _fmemcmpFI _fMemFCmp #ifdef _MICROC_ int _fMemFCmp(unsigned const dseg, unsigned dofs , unsigned const sseg, unsigned sofs, unsigned length); #else int _fMemFCmp(const void far * dest, const void far * src, unsigned length); #endif char *StrFUpr(char *s); void *MemFUpr(void * const buf, unsigned length); #endif ================================================ FILE: suppl/p-bc.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Portable include file for Turbo/Borland C */ #ifdef __TURBOC__ #ifndef ffblk #include #endif /* Global argc/argv variables */ #define G_ARGV _argv /* global char **argv variable */ #define G_ARGC _argc /* global int argc variable */ #define G_ARG_DEF /* definition of global variables */ #define G_ARG_INIT /* initialization of global variables */ /* byte/word/dword type */ typedef unsigned char byte; typedef unsigned short word; typedef int FLAG; /* no special 8-bit handling */ typedef unsigned FLAG8; /* no special 8-bit handling */ typedef unsigned long dword; /* peekb() && pokeb() exist */ #define peekw peek #define pokew poke #define _osversion MK_OSVERS(_osmajor, _osminor) /* get/set interrupt vecotr */ typedef void interrupt (far *isr)(); #define set_isrfct(num,fct) setvect((num), (isr)(fct)) #define get_isr(num,var) ((var) = getvect(num)) #define set_isr(num,var) setvect((num), (var)) #define ASMINTERRUPT interrupt /* calling interrupt */ typedef struct REGPACK IREGS; #define intrpt intr #endif ================================================ FILE: suppl/p-gcc.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Portable include file for GCC (ia16-elf-gcc) */ #ifdef __GNUC__ #include #include #ifndef EZERO #define EZERO 0 #endif #ifdef __FAR #define far __far #ifndef __IA16_FEATURE_FAR_STATIC_STORAGE #error Please upgrade ia16-elf-gcc to get support for far static storage #endif #else #define far #endif #define cdecl __attribute__((cdecl)) /* Global argc/argv variables */ #define G_ARGV _argv /* global char **argv variable */ #define G_ARGC _argc /* global int argc variable */ #define G_ARG_DEF /* definition of global variables */ #define G_ARG_INIT /* initialization of global variables */ /* byte/word/dword type */ typedef unsigned char byte; typedef unsigned short word; typedef unsigned FLAG; typedef unsigned FLAG8; #ifdef __LP64__ typedef unsigned dword; #else typedef unsigned long dword; #endif #ifndef _CLIB_ #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) #define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value)) #endif #define _osversion MK_OSVERS(_osmajor, _osminor) /* get/set interrupt vector */ typedef void __far *isr; #define set_isrfct(num,fct) _dos_setvect((num), (isr)(fct)) #define get_isr(num,var) ((var) = _dos_getvect(num)) #define set_isr(num,var) _dos_setvect((num), (var)) #define ASMINTERRUPT /* calling an interrupt */ typedef struct { unsigned int r_ax; unsigned int r_bx; unsigned int r_cx; unsigned int r_dx; unsigned int r_bp; unsigned int r_si; unsigned int r_di; unsigned int r_ds; unsigned int r_es; unsigned int r_flags; } IREGS; #define intrpt(num,regs) _intrf((num), (union REGPACK*)(regs)) static inline unsigned short CS_(void) { unsigned short ret; asm volatile("mov %%cs, %0" : "=rm"(ret)); return ret; } #define _CS CS_() /* get/set current working drive */ static inline int getdisk(void) { unsigned char ret; asm volatile("int $0x21" : "=Ral"(ret) : "Rah"((char)0x19)); return ret; } static inline int setdisk(int drive) { unsigned char ret; asm volatile("int $0x21" : "=Ral"(ret) : "Rah"((char)0xe), "d"(drive)); return ret; } /* get/set file time and date */ static inline int _dos_getftime(int fd, unsigned *date, unsigned *time) { unsigned int ret, carry; asm volatile("int $0x21; sbb %0, %0" : "=r"(carry), "=a"(ret), "=c"(*time), "=d"(*date) : "a"(0x5700), "b"(fd)); return carry ? ret : 0; } static inline int _dos_setftime(int fd, unsigned date, unsigned time) { unsigned int ret, carry; asm volatile("int $0x21; sbb %0, %0" : "=r"(carry), "=a"(ret) : "a"(0x5701), "b"(fd), "c"(time), "d"(date)); return carry ? ret : 0; } static inline void far *_dos_getvect(int intno) { unsigned short seg, off; asm volatile("int $0x21" : "=e"(seg), "=b"(off) : "Rah"((char)0x35), "Ral"((char)intno)); return MK_FP(seg,off); } static inline void _dos_setvect(int intno, void far *vect) { asm volatile("int $0x21" : : "Rah"((char)0x25), "Ral"((char)intno), "Rds"(FP_SEG(vect)), "d"(FP_OFF(vect))); } static inline void far *getdta(void) { unsigned short seg, off; asm volatile("int $0x21" : "=e"(seg), "=b"(off) : "Rah"((char)0x2f)); return MK_FP(seg,off); } static inline void setdta(void far *dta) { asm volatile("int $0x21" : : "Rah"((char)0x1a), "Rds"(FP_SEG(dta)), "d"(FP_OFF(dta))); } #endif ================================================ FILE: suppl/p-mc.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Portable include file for Micro-C */ #ifdef _MICROC_ #if _MICROC_ -1 == -1 #error "Patch STDIO.H to add the hexadecimal version number to the macro _MICROC_, e.g. 0x136" #endif /* non-predeclared global variables */ #include /* struct REGPACK */ #include #define iM(q) q /* if Micro-C */ #define nM(q) /* not Mirco-C */ #define inM(q,w) q /* if-not Micro-C */ #define aF(fct) &(fct) /* address of function */ #define aS(structure) (structure) /* address of structure */ #define cS(strucType) /* no structure casting */ /* The definition of TO_FP resides in */ #ifndef NULL #define NULL 0 #endif #define peekb peek #define pokeb poke #define const #define _psp PSP /* Global argc/argv variables */ #define G_ARGV ARGV /* global char **argv variable */ #define G_ARGC ARGC /* global int argc variable */ #define G_ARG_DEF /* definition of global variables */ #define G_ARG_INIT /* initialization of global variables */ /* Handling of pointers to structures */ #define sInc(poi) ((poi) += sizeof(*(poi))) #define sDec(poi) ((poi) -= sizeof(*(poi))) #define sIdx(array,index) ((array) + (index) * sizeof(*(array))) #define sAdd(poi,displacement) ((poi) += (displacement) * sizeof(*(array))) #define sSub(poi,displacement) ((poi) -= (displacement) * sizeof(*(array))) /* byte/word/dword type */ #define byte unsigned char #define word unsigned #define FLAG byte /* Micro-C has special 8-bit handling */ #define FLAG8 byte /* dito */ #define get_ss get_ds #define size_t unsigned #define dword struct DWORD struct DWORD { word lo; /* offset */ word hi; /* segment */ }; #define setDW(var,seg,ofs) (var.hi = (seg), var.lo = (ofs)) /* Micro-C does not support (*struct_pointer).member for struct_pointer->member */ #define setDWP(varP,seg,ofs) (varP->hi = (seg), varP->lo = (ofs)) #define DW_LO(var) var.lo #define DW_HI(var) var.hi #define DWP_LO(varP) varP->lo #define DWP_HI(varP) varP->hi #define DWARG dword * /* dword argument */ /* Simulate long constants and long arguments */ #define TO_LONG(num) 0, (unsigned)(num) #define MK_LONG(hi,lo) (unsigned)(hi), (unsigned)(lo) #define FARARG(var,type) word var/**/Seg, word var/**/Ofs #define COPYFARARG(var) var/**/Seg, var/**/Ofs #define longcmp1 longcmp /* version variables */ #define _osmajor ((unsigned)version() >> 8) #define _osminor (version() & 0xff) #define _osversion version() /* seek() whence parameters */ #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 /* DOS drive handling */ #define getdisk get_drive #define setdisk set_drive /* set/get interrupt vector */ #define isr dword /* type of variable to hold one vecotr */ #define set_isrfct(num,fct) set_vector((num), get_cs(), &(fct)) #define get_isr(num,var) get_vector((num), &(var).hi, &(var).lo) #define set_isr(num,var) set_vector((num), (var).hi, (var).lo) #define ASMINTERRUPT #define IREGS struct REGPACK #define intrpt intr #endif ================================================ FILE: suppl/p-pac.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Portable include file for Pacific C */ #ifdef HI_TECH_C #include #include /* Pacific C does not support various stuff natively. Therefore we define a different macro for differing PAC with and without CLib. */ #ifndef _PAC_ #ifndef _PAC_NOCLIB_ #ifdef _CLIB_ #define _PAC_ #else #define _PAC_NOCLIB_ #endif /* _CLIB_ */ #endif #endif #ifdef _PAC_NOCLIB_ /* Global argc/argv variables */ #define G_ARGV ___argv /* global char **argv variable */ #define G_ARGC ___argc /* global int argc variable */ /* definition of global variables */ #define G_ARG_DEF char *G_ARGV[]; int G_ARGC; /* initialization of global variables */ #define G_ARG_INIT G_ARGV = argv; G_ARGC = argc; extern char *G_ARGV[]; /* holds global argv */ extern int G_ARGC; /* holds global argc */ #else #define G_ARGV _argv /* global char **argv variable */ #define G_ARGC _argc /* global int argc variable */ #define G_ARG_DEF /* definition of global variables */ #define G_ARG_INIT /* initialization of global variables */ #endif /* byte/word/dword type */ typedef unsigned char byte; typedef unsigned word; typedef byte FLAG; /* PAC supports byte-aware arethmetics */ typedef byte FLAG8; typedef unsigned long dword; #ifdef _PAC_NOCLIB_ #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) #define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value)) #endif #ifdef _PAC_NOCLIB_ #define _osminor (osversion() >> 8) #define _osmajor (osversion() & 0xff) #define _osversion osversion() #define _psp _psp_() extern unsigned _psp_(void); /* get/set interrupt vector */ #include #define set_isrfct(num,fct) setiva((num), (isr)(fct)) #define get_isr(num,var) ((var) = getiva(num)) #define set_isr(num,var) setiva((num), (var)) #define ASMINTERRUPT isr /* calling an interrupt */ typedef struct { unsigned int r_ax; unsigned int r_bx; unsigned int r_cx; unsigned int r_dx; unsigned int r_bp; unsigned int r_si; unsigned int r_di; unsigned int r_ds; unsigned int r_es; unsigned int r_flags; } IREGS; #define intrpt(num,regs) intr((num), (union REGPACK*)(regs)) #endif #endif ================================================ FILE: suppl/p-watcom.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Portable include file for Watcom C */ #ifdef __WATCOMC__ #include #include #include #include /* Global argc/argv variables */ #define G_ARGV _argv /* global char **argv variable */ #define G_ARGC _argc /* global int argc variable */ #define G_ARG_DEF /* definition of global variables */ #define G_ARG_INIT /* initialization of global variables */ /* byte/word/dword type */ typedef unsigned char byte; typedef unsigned word; typedef unsigned FLAG; typedef unsigned FLAG8; typedef unsigned long dword; #ifndef _CLIB_ #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs))) #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs))) #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value)) #define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value)) #endif #define _osversion MK_OSVERS(_osmajor, _osminor) #define asm _asm /* get/set interrupt vector */ typedef void (__interrupt __far *isr)(); #define set_isrfct(num,fct) _dos_setvect((num), (isr)(fct)) #define get_isr(num,var) ((var) = _dos_getvect(num)) #define set_isr(num,var) _dos_setvect((num), (var)) #define ASMINTERRUPT interrupt cdecl /* calling an interrupt */ typedef struct { unsigned int r_ax; unsigned int r_bx; unsigned int r_cx; unsigned int r_dx; unsigned int r_bp; unsigned int r_si; unsigned int r_di; unsigned int r_ds; unsigned int r_es; unsigned int r_flags; } IREGS; #if __WATCOMC__ <= 1290 void intrf(int inter_no, union REGPACK *regs); #endif #define intrpt(num,regs) intrf((num), (union REGPACK*)(regs)) unsigned CS_(void); #pragma aux CS_ = "mov ax, cs" __value[__ax]; #define _CS CS_() /* get/set current working drive */ extern short getdisk(void); #pragma aux getdisk = \ "mov ah, 19h" \ "int 21h" \ "xor ah, ah" \ __value [__ax] extern short setdisk(int newdrive); #pragma aux setdisk = \ "mov ah, 0eh" \ "int 21h" \ "xor ah, ah" \ __parm [__dx] \ __modify [__dx] \ __value [__ax] #endif ================================================ FILE: suppl/portable.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ */ #ifndef H__PORTABLE_ #define H__PORTABLE_ #include #include "regproto.h" #define NUL '\0' #define MK_OSVERS(major,minor) ((major << 8) | (minor)) #undef FARDATA #undef FARCODE #ifdef _MICROC_ #include #else /* no _MICROC_ */ #if defined(__HUGE__) || defined(__LARGE__) || defined(__COMPACT__) #define FARDATA #endif #if defined(__HUGE__) || defined(__LARGE__) || defined(__MEDIUM__) #define FARCODE #endif /* * Currently supported: * Borland C/C++ v2+ * Pacific C v7.51 * Watcom v10.6 */ #define iM(q) /* if Micro-C */ #define nM(q) q /* not Mirco-C */ #define inM(q,w) w /* if-not Micro-C */ #define aF(fct) (fct) /* address of function */ #define aS(structure) &(structure) /* address of structure */ #define cS(strucType) (strucType) /* casting of a structure */ /* Handling of pointers to structures */ #define sInc(poi) ++(poi) #define sDec(poi) --(poi) #define sIdx(array,index) ((array) + (index)) #define sAdd(poi,displacement) ((poi) += (displacement)) #define sSub(poi,displacement) ((poi) -= (displacement)) /* far pointer variable handling */ #define TO_FP(var) ((void far*) (var)) /* cast variable to far pointer */ #define FARARG(var,type) type far* var #define COPYFARARG(var) var /* DWORD variables handling */ #define setDW(var,seg,ofs) ((var) = (dword)MK_FP(seg,ofs)) #define setDWP(varP,seg,ofs) (*(varP) = (dword)MK_FP(seg,ofs)) #define DW_LO(var) ((word)(var)) #define DW_HI(var) ((word)((var) >> 16)) #define DWP_LO(var) ((word)(var)) #define DWP_HI(var) ((word)((var) >> 16)) #define DWARG dword /* Simulate long constants and long arguments */ #define TO_LONG(num) (unsigned long)(num) #define MK_LONG(hi,lo) (((unsigned long)(hi) << 16) | (unsigned)(lo)) #ifndef NULL #ifdef FARDATA #define NULL (0L) #else #define NULL (0) #endif #endif /* LONGMATH */ #define longcpy(a,b) ((a) = (b)) #define longset(a,b) ((a) = (b)) #define longmul(a,b) ((a) *= (b)) #define longdiv(a,b) ((a) /= (b)) #define longadd(a,b) ((a) += (b)) #define longsub(a,b) ((a) -= (b)) #define longtst(a) (!!(a)) int longcmp(long d1, long d2); #define longcmp1(a,b) ((signed long)(a) - (signed long)(b)) #define longseti(a,b) ((a) = (int)(b)) #define longmuli(a,b) ((a) *= (int)(b)) #define longdivi(a,b) ((a) /= (int)(b)) #define longaddi(a,b) ((a) += (int)(b)) #define longsubi(a,b) ((a) -= (int)(b)) #define longsetu(a,b) ((a) = (unsigned)(b)) #define longmulu(a,b) ((a) *= (unsigned)(b)) #define longdivu(a,b) ((a) /= (unsigned)(b)) #define longaddu(a,b) ((a) += (unsigned)(b)) #define longsubu(a,b) ((a) -= (unsigned)(b)) /* Source In compiler specific settings */ #ifdef __TURBOC__ #include "p-bc.h" #endif #ifdef HI_TECH_C #include "p-pac.h" #endif #ifdef __WATCOMC__ #include "p-watcom.h" #endif #ifdef __GNUC__ #include "p-gcc.h" #endif #endif /* _MICROC_ */ #ifndef strend #define strend(s) strchr((s), '\0') #endif /*----------------------------------------------------------------------*/ #define LOCAL static #define lonibble(v) (0x0f & (v)) #define hinibble(v) (0xf0 & (v)) #if CHAR_BIT == 8 # define lobyte(v) ((UBYTE)(v)) #else # define lobyte(v) ((UBYTE)(0xff & (v))) #endif #define hibyte(v) lobyte ((UWORD)(v) >> 8u) #if USHRT_MAX == 0xFFFF # define loword(v) ((unsigned short)(v)) #else # define loword(v) (0xFFFF & (unsigned)(v)) #endif #define hiword(v) loword ((v) >> 16u) #define MK_UWORD(hib,lob) (((UWORD)(hib) << 8u) | (UBYTE)(lob)) #define MK_ULONG(hiw,low) (((ULONG)(hiw) << 16u) | (UWORD)(low)) /*----------------------------------------------------------------------*/ #define MK_PTR(type,seg,ofs) ((type FAR*) MK_FP (seg, ofs)) #if __TURBOC__ > 0x201 # define MK_SEG_PTR(type,seg) ((type _seg*) (seg)) #else # define _seg FAR # define MK_SEG_PTR(type,seg) MK_PTR (type, seg, 0) #endif #endif /* H__PORTABLE_ */ ================================================ FILE: suppl/psp.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ * $Locker$ $Name$ $State$ * * header file for PSP settings */ #ifndef __PSP_H #define __PSP_H #include #include struct PSP { byte psp_cpm_call0[2]; /* CP/M style program termination entry --> INT 20h (0xCD 0x20) */ word psp_freeSegm; /* segm of first free byte above process */ byte psp_os2_fakeDOSversion; byte psp_cpm_call5[5]; /* FAR CALL to absolute 000C0h */ void far*psp_oldInt22; /* value of INT-22 restored on exit (return) */ void far*psp_oldInt23; /* value of INT-23 restored on exit (^Break) */ void far*psp_oldInt24; /* value of INT-24 restored on exit (CritErr) */ word psp_parentPSP; byte psp_jft[20]; word psp_envSegm; void far*psp_lastStack; /* SS:SP on last INT-21 */ word psp_jft_numEntries; byte far *psp_jft_addr; struct PSP far*psp_share_prevPSP; byte psp_dbcs_consoleFlag; byte psp_append_truenameFlag; byte psp_os2_flags; byte psp_netware_taskNumber; /* valid if os2_flags == 0xCE */ byte psp_dosVersion[2]; /* returned on DOS-30 */ word psp_pdb_selectorNext; word psp_pdb_parition; word psp_pdb_next; byte psp_win_flags; /* bit 0: set -> non-win app (==WINOLDAP) */ byte psp_reserved1; byte psp_reserved1_1[2]; /* Missing from RBIL v6.1 */ word psp_pdb_entryStack; byte psp_reserved2[2]; byte psp_serviceRequest[3]; /* INT 21h / RETF */ byte psp_reserved3[2]; byte psp_extFCB1[7]; byte psp_fcb1[16]; byte psp_fcb2[16]; byte psp_reserved4[4]; union { byte psp_dta[128]; struct { byte psp_cmdlineLength; byte psp_cmdline[127]; }; }; }; #include struct SUPPL_verify_alignment_PSP { char x[sizeof(struct PSP) == 128 ? 1 : -1]; }; #endif ================================================ FILE: suppl/readme.txt ================================================ This version of FreeCOM has been compiled and linked with the SUPPL library, which is available from the Steffen's site at ftp://ftp-fd.inf.fh-rhein-sieg.de/pub/freedos/local/ALPHA -or- http://www2.inf.fh-rhein-sieg.de/~skaise2a/ska/sources.html#suppl A stripped down variant of SUPPL has been included into the FreeCOM release, because of several complains about the wicked process of compilation. You can bypass the FreeCOM-build.bat sense of SUPPL by creating a file called "SKIP" in this directory (<>\SUPPL). That way, you can use your own SUPPL, e.g. a newer release of it. ================================================ FILE: suppl/regproto.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Enables the usage of the fast register pseudo vars for non-TURBO compilers. That means the port Turbo -> non-Turbo is OK. Back not, because the union holds the registers independed on real registers. */ #ifndef __REGPROTO_H #define __REGPROTO_H #ifndef _MICROC_ #include #endif #ifdef __TURBOC__ #define USEREGS #define NOREGS /* register variables active */ #define _CFLAG (_FLAGS & 1) #else #ifdef _MICROC_ #define USEREGS #define _AL (*(unsigned char *)&_AX_) #define _AH (((unsigned char *)&_AX_)[1]) #define _BL (*(unsigned char *)&_BX_) #define _BH (((unsigned char *)&_BX_)[1]) #define _CL (*(unsigned char *)&_CX_) #define _CH (((unsigned char *)&_CX_)[1]) #define _DL (*(unsigned char *)&_DX_) #define _DH (((unsigned char *)&_DX_)[1]) #define _AX _AX_ #define _BX _BX_ #define _CX _CX_ #define _DX _DX_ #define _SI _SI_ #define _DI _DI_ #define _DS get_ds() #define _SS get_ds() #define _ES get_es() #define _CS get_cs() #define _CFLAG (_FLAGS & 1) extern unsigned _FLAGS; #define geninterrupt(n) (_FLAGS = int86(n)) #else #if defined(__WATCOMC__) || defined(__GNUC__) #define USEREGS union REGPACK reg ; #define _AH reg.h.ah #define _AL reg.h.al #define _BH reg.h.bh #define _BL reg.h.bl #define _CH reg.h.ch #define _CL reg.h.cl #define _DH reg.h.dh #define _DL reg.h.dl #define _AX reg.x.ax #define _BX reg.x.bx #define _CX reg.x.cx #define _DX reg.x.dx #define _SI reg.x.si #define _DI reg.x.di #define _DS reg.x.ds #define _ES reg.x.es #define _CFLAG (reg.x.flags & 1) #define geninterrupt(n) intrpt(n,®) #else #define USEREGS union REGS reg ; struct SREGS sreg ; #define _AH reg.h.ah #define _AL reg.h.al #define _BH reg.h.bh #define _BL reg.h.bl #define _CH reg.h.ch #define _CL reg.h.cl #define _DH reg.h.dh #define _DL reg.h.dl #define _AX reg.x.ax #define _BX reg.x.bx #define _CX reg.x.cx #define _DX reg.x.dx #define _SI reg.x.si #define _DI reg.x.di #define _DS sreg.ds #define _ES sreg.es #define _SS sreg.ss #define _CFLAG reg.x.cflag #define geninterrupt(n) int86x(n,®,®,&sreg) #endif /* __WATCOMC__ */ #endif /* _MICROC_ */ #endif /* __TURBOC__ */ /* int getkey() { USEREGS _AH = 0x10 ; geninterrupt(0x16) ; return _AX ; } */ #ifdef _MICROC_ #define asmLabel(a) a: /* label inside of asm {} */ #define asmName(a,b) b[bp] /* variable name not available, use offset */ #define FP_SEG(a) get_ds() /* only tiny/small available */ #define FP_OFF(a) (a) #else #define asmLabel(a) } a: asm { #define asmName(a,b) a #if defined(__POWERC) || (defined(__TURBOC__) && !defined(__BORLANDC__)) || defined(__GNUC__) #define FAR far #else #define FAR _far #endif #ifndef MK_FP #define MK_FP(seg,off) ((void FAR *)(((long)(seg) << 16)|(unsigned)(off))) #endif #endif #endif ================================================ FILE: suppl/src/_getdcwd.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _getdcwd su(bsystem): portable ty(pe): H sy(nopsis): sh(ort description): Return the fully-qualified current working path of a drive he(ader files): lo(ng description): Retrieves the fully-qualified current working directory of a specified drive. The path does not contain a trailing backslash unless it is the root directory. The path does contain the drive letter.\par If \para{buf} == \tok{NULL}, a new buffer of size \para{length} is allocated. pr(erequistes): va(lue): NULL: on error \list \tok{ENOMEM}: out of memory \item \tok{ERANGE}: Buffer of getdcwd() too small \item warning: There is no change of errno, if the DOS API call fails!! \endlist \item else: pointer to path re(lated to): getdisk dfnexpand se(condary subsystems): xr(ef): im(port): fi(le): _getdcwd.c in(itialized by): wa(rning): bu(gs): co: Micro-C, Pacific HiTech C */ #include "initsupl.loc" #include "../../config.h" #undef FEATURE_LONG_FILENAMES #ifdef _MICROC_ #define COMPILE 1 #endif #ifdef _PAC_NOCLIB_ #define COMPILE 2 #endif #ifdef _TC_EARLY_ #define COMPILE 4 #endif #ifdef COMPILE #include #include "suppl.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #ifdef _MICROC_ char *_getdcwd(int drive, char Xbuf[], unsigned length) { unsigned l; char *buf; DBG_ENTER("_getdcwd", Suppl_portable) DBG_ARGUMENTS( ("drv=%d, buf=%s, len=%u", drive, buf? "passed": "allocate", length) ) if(length < 64) { eno_set(ERANGE); DBG_RETURN_S( 0) } if((buf = Xbuf) || (buf = eno_malloc(length))) { buf; /* AX := buf */ asm "mov si, ax"; drive; /* AX := drive */ asm { mov dx, ax or ax, ax jz currDrive add al, 'A' - 1 ;/* specified drive */ jmp short putDrive currDrive: mov ah, 19h int 21h add al, 'A' ;/* 0 == A: */ putDrive: mov Byte Ptr [si], al inc si mov Word Ptr [si], '\:' inc si inc si mov ah, 47h int 21h sbb ax, ax ;; AX := C flag } if(nargs()) { /* Get path failed */ if(!Xbuf) free(buf); DBG_RETURN_S( 0) } } DBG_RETURN_S( buf) } #else #ifndef __GNUC__ #include /* getdisk() */ #endif #include #include #include "suppl.h" char *_getdcwd(int drive, char Xbuf[], unsigned length) { char *buf; IREGS r; DBG_ENTER("_getdcwd", Suppl_portable) DBG_ARGUMENTS( ("drv=%d, buf=%s, len=%u", drive, buf? "passed": "allocate", length) ) if(length < 64) { eno_set(ERANGE); DBG_RETURN_S( 0) } chkHeap if((buf = Xbuf) != 0 || (buf = eno_malloc(length)) != 0) { chkHeap #ifndef NDEBUG memset(buf, 0xAA, length); chkHeap #endif strcpy(buf, "A:\\"); *buf += drive? drive - 1: getdisk(); r.r_si = FP_OFF(&buf[3]); r.r_dx = drive; r.r_ds = FP_SEG(buf); #ifdef FEATURE_LONG_FILENAMES r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7147; #else r.r_ax = 0x4700; #endif intrpt(0x21, &r); #ifdef FEATURE_LONG_FILENAMES if((r.r_flags & 1) || r.r_ax == 0x7100) { /* Get path failed */ r.r_ax = 0x4700; intrpt(0x21, &r); #endif if(r.r_flags & 1) { if(!Xbuf) free(buf); chkHeap DBG_RETURN_S( 0) } #ifdef FEATURE_LONG_FILENAMES } #endif } chkHeap DBG_RETURN_S( buf) } #endif #endif /* COMPILE */ ================================================ FILE: suppl/src/addu.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): addu su(bsystem): portable ty(pe): A sy(nopsis): int addu(unsigned * const u1, unsigned u2) sh(ort description): Performs \tok{*\para{u1} += \para{u2}} and returns the status of the arethmetic overflow he(ader files): portable.h fi(le): addu.c pr: \para{u1} != NULL va: !0 if arethemtic overflow occured\item 0: no overflow */ #include "initsupl.loc" #ifndef __WATCOMC__ #include #ifdef HI_TECH_C #include "addu.pac" #else /* HI_TECH_C */ int addu(nM(unsigned * const) u1, nM(const unsigned) u2) { #if defined(__GNUC__) int ret; asm("add %2, %1; sbb %0, %0": "=r"(ret), "+m"(*u1): "r"(u2)); return ret; #elif defined(_TC_EARLY_) *u1 += u2; /* Is translated into exactly what's written in #else branch */ __emit__(0x1b,0xc0); /* SBB AX, AX */ #else asm { mov ax, asmName(u2, 4) #ifdef FARDATA les bx, asmName(u1, 6) add es:[bx], ax #else /* FARDATA */ mov bx, asmName(u1, 6) add [bx], ax #endif /* FARDATA */ sbb ax, ax } #endif #ifdef __TURBOC__ return _AX; /* shut up warning */ /* is removed completely if -O is specified */ #endif } #endif /* HI_TECH_C */ #endif /* WATCOM */ ================================================ FILE: suppl/src/app_ievx.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): appInitEnvEx su(bsystem): appName sy(nopsis): int appInitEnvEx(void) sh(ort description): Initialize the \subsys{appName} from environment lo(ng description): As appInitEnv, but does not replace the internally cached name, if the \subsys{appName} is already initialized. va: integer SUPPL error code re(lated to): appFile appName appInit appPath appInitEnvEx fi(le): app_ievx.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "errcodes.h" #include "appname.loc" #include "environ.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int appInitEnvEx(void) { DBG_ENTER("appInitEnvEx", Suppl_appName) if(app_file) { DBG_STRING("SUPPL subsystem appName already initialized"); DBG_RETURN_I(ESUPPL_OK) } DBG_RETURN_BI(appInit_(env_strdup(0, 0))) } ================================================ FILE: suppl/src/app_ini_.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): appInit_ su(bsystem): appName ty: L sy(nopsis): int appInit_(char * const fnam) sh(ort description): Initialize the \subsys{appName} from a filename lo(ng description): Initializes the \subsys(appName} from passed filename.\par This function can be called more than once and refreshes the internal buffer each time. pr: The passed filename must be an absolute one and a valid pointer into the heap. va: integer SUPPL error code re(lated to): appFile appName appInitEnv appPath appInit fi(le): app_ini_.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "errcodes.h" #include "appname.loc" #include "dynstr.h" #include "dfn.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int appInit_(char * const fnam) { DBG_ENTER("appInit_", Suppl_appName) if(!fnam) DBG_RETURN_I(ESUPPL_INIT) DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) chkHeap StrRepl(app_file, fnam); chkHeap app_fnam = dfnfilename(app_file) - 1; chkHeap if(app_fnam <= app_file || !*app_fnam) { StrFree(app_file); /* indicate: not-initialized */ /* as app_fnam is invalid */ chkHeap; DBG_RETURN_I(ESUPPL_FPATH) } app_fext = strrchr(app_fnam, '.'); DBG_RETURN_I(ESUPPL_OK); } ================================================ FILE: suppl/src/app_init.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): appInit su(bsystem): appName ty: sy(nopsis): int appInit(const char * const fnam) sh(ort description): Initialize the \subsys{appName} from a filename lo(ng description): Initializes the \subsys(appName} from passed filename. The name is duplicated into the heap.\par This function can be called more than once and refreshes the internal buffer each time. pr: The passed filename must be an absolute one. va: integer SUPPL error code re(lated to): appFile appName appInitEnv appPath appInit_ fi(le): app_init.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "errcodes.h" #include "appname.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int appInit(const char * const fnam) { DBG_ENTER("appInit", Suppl_appName); if(!fnam) DBG_RETURN_I(ESUPPL_INIT); DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) DBG_RETURN_BI( appInit_(strdup(fnam))) } ================================================ FILE: suppl/src/app_name.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): appName su(bsystem): appName ty(pe): 0F sy(nopsis): char *appName(void) sh(ort description): Return the name of the application lo(ng description): Returns a pointer to a static buffer that holds the name of the current application.\par va: NULL: if not initialized \item else: pointer to requested data re(lated to): appNameEx appFile appInit appPath fi(le): app_name.c in(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx appFileEx appPathEx */ #include "initsupl.loc" #include "appname.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *appName(void) { DBG_ENTER("appName", Suppl_appName) if(!app_file) { DBG_STRING("SUPPL subsystem appName not initialized") DBG_RETURN_S(0) } if(app_fext) *app_fext = '\0'; DBG_RETURN_S( app_fnam + 1) } ================================================ FILE: suppl/src/app_namx.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): appNameEx su(bsystem): appName ty(pe): 0F sy(nopsis): char *appNameEx(void) sh(ort description): Return the name of the application lo(ng description): Returns a pointer to a static buffer that holds the name of the current application.\par The \subsys{appName} is initialized by appInitEnvEx. va: NULL: if not initialized \item else: pointer to requested data re(lated to): appName appFile appInit appPath fi(le): app_namx.c in(itialized by): appInitEnvEx */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include "appname.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *appNameEx(void) { DBG_ENTER("appNameEx", Suppl_appName) appInitEnvEx(); DBG_RETURN_BS( appName()) } ================================================ FILE: suppl/src/app_vars.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): app_file su(bsystem): appName ty(pe): 0FL sy(nopsis): char *app_file sh(ort description): Dynamically buffered filename of application he(ader files): appname.loc va: NULL: not initialized so far \item else: pointer to dynamically duplicated filename re(lated to): appPath appFile appInit appName appInitEnv fi(le): app_vars.c in(itialized by): static appInit appInitEx appInitEnv appInitEnvEx appNameEx appFileEx appPathEx ob(ject): app_fnam su(bsystem): appName ty(pe): 0FL sy(nopsis): char *app_fnam sh(ort description): Pointer to backslash before filename within app_file he(ader files): appname.loc va: undefined: if not initialized (app_file == NULL) re(lated to): appPath appFile appInit appName appInitEnv fi(le): app_vars.c in(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx appFileEx appPathEx ob(ject): app_fext su(bsystem): appName ty(pe): 0FL sy(nopsis): char *app_fext sh(ort description): Pointer to dot of filename portion within app_file he(ader files): appname.loc va: NULL: if file has no extension re(lated to): appPath appFile appInit appName appInitEnv fi(le): app_vars.c in(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx appFileEx appPathEx ob(ject): app_fnam su(bsystem): appName ty(pe): 0FL sy(nopsis): char *app_fnam sh(ort description): Pointer to backslash before filename within app_file he(ader files): appname.loc va: undefined: if not initialized (app_file == NULL) re(lated to): appPath appFile appInit appName appInitEnv fi(le): app_vars.c in(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx appFileEx appPathEx */ #include "initsupl.loc" #include "appname.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *app_file = 0 /* indicate: not initialized */ , *app_fext, *app_fnam; ================================================ FILE: suppl/src/appname.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Internal implementation details of appName The information is stored as the absolute filename to the executable. Three pointers reference to: #1) byte before name of file, #2) dot of extension of file (may be absent), #3) 1st byte of the stored filename. On: - appFile(): *(#1) := '\' and *(#2) := '.'; return #3 - appName(): *(#2) := '\0'; return #1 + 1 - appPath(): *(#1) := '\0'; return #3 */ #ifndef __APPNAME_INC #define __APPNAME_INC #ifndef __PORTABLE_H #include #endif #include "appname.h" extern char *app_file /* absolute filename of executble (#3) */ ,*app_fnam /* byte before name (#1) */ ,*app_fext /* position of dot (#2) */ ; int appInit_(char * const fnam); /* Initializes the appName sub system with an allocated string Can be called multiple times. */ #endif ================================================ FILE: suppl/src/bugs ================================================ This file contains the "Known Bugs" section. o All environment functions, except env_matchVar(), are case-sensitive! Thus env_findVar(0, "temp") will fail, because normally all DOS environment variables are in upper-case. Well, this is, of course :-), not a bug but a feature. Just use the env_matchVar() to adjust the variable's name prior using it. o Because Micro-C does not have neither ungetc() nor feof(), Feof() simulates an ungetc() via fseek() and assumes always true for FILE* pointers in write mode. o The control break catcher terminates the process using the program's exit() function. If the catcher is activated when the process is not currently active, e.g. a child is currently running, this should confuse DOS & application crashablely. ================================================ FILE: suppl/src/byte2par.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): BLK_byte2para su(bsystem): portable sh(ort description): Calculates the number of paragraphes to store \para{num} bytes va(lue): number of paragraphes 0..0x1000 se(condary subsystems): dosalloc fi(le): byte2par.c wa(rning): The argument has a range: 0..0xFFFF */ #include "initsupl.loc" #include word BLK_byte2para(nM(unsigned) bytes) #ifdef _MICROC_ asm { mov ax, asmName(bytes, 4) mov ch, al mov cl, 4 shr ax, cl and ch, 0Fh jz b2para1 ; /* no partially used paragraphe */ inc ax b2para1: } #else { return (bytes >> 4) + ((bytes & 0xF)? 1: 0); } #endif ================================================ FILE: suppl/src/cntry.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): nlsNewInfo su(bsystem): nls ty(pe): 0 sy(nopsis): sh(ort description): Reread the NLS information and return a pointer to it he(ader files): lo(ng description): Updates the internal, static buffer caching all NLS information provided by the DOS-65-XX interface and returns a pointer to it. The buffer caches information, such as: \enum code page \item country ID \item date format \item currency symbol string \item thousands separator string \item decimal sperator string \item date separator string \item time separator string \item currency format \item time format \item data-list separator string \item pointer to uppercase table \item pointer to lowercase table \item pointer to filenmae uppercase table \item pointer to filename character table \item pointer to collating sequence table \endlist \par This function should be called whenever the NLS information is required, but the possibility exists that the DOS NLS has been changed during the last call to \tok{nlsInfo()}.\par pr(erequistes): va(lue): always a pointer to a static buffer re(lated to): nlsInfo se(condary subsystems): xr(ef): im(port): fi(le): cntry.c in(itialized by): wa(rning): Note: Though for future release one should not rely on the fact that always the \em{same} pointer is returned. bu(gs): ob(ject): nlsInfo su(bsystem): nls ty(pe): 0 sy(nopsis): sh(ort description): Read the NLS information and return a pointer to it he(ader files): lo(ng description): As \tok{nlsNewInfo}, but does update the internal buffer only once per life-time of the program pr(erequistes): va(lue): pointer to internal buffer re(lated to): nlsNewInfo se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): ob(ject): suppl_cntry su(bsystem): nls ty(pe): sy(nopsis): sh(ort description): Cached information for \tok{nlsInfo()} he(ader files): lo(ng description): Caches information retreived by nlsNewInfo() from the DOS-65-XX NLS interface. pr(erequistes): va(lue): re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): nlsNewInfo wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifdef __GNUC__ #include #endif #ifndef _MICROC_ #include #include #endif /*# defined(_MICROC_) */ #include "cntry.h" #include "fmemory.h" #include "str.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif /*# defined(RCS_Version) */ static Country suppl_cntry = {0}; /* make sure the structure is zeroed out */ #ifdef _MICROC_ #define savePtr(field) savePtr_(&suppl_cntry.field/**/Len \ , suppl_cntry.field/**/Tbl \ , &buf[1]) static void savePtr_(int *len, dword *tbl, word *ptr) { word segm, ofs; ofs = *ptr; segm = ptr[1]; if((*len = peekw(segm, ofs)) <= 0x80) ofs -= 0x80; ofs += 2; tbl->lo = ofs; tbl->hi = segm; if(!longtst(tbl)) /* no table --> no length */ *len = 0; } #else /*# !(defined(_MICROC_)) */ #define savePtr(field) savePtr_(&suppl_cntry.field##Len \ , &suppl_cntry.field##Tbl \ , (byte far* *)&buf[1]) static void savePtr_(int *len, char far * *tbl, byte far * *ptr) { byte far *p; p = *ptr; if((*len = *(word far*)p) <= 0x80) p -= 0x80; p += 2; if((*tbl = (char far*)p) == 0) /* no table --> no length */ *len = 0; } #endif /*# defined(_MICROC_) */ Country *nlsInfo(void) { DBG_ENTER("nlsInfo", Suppl_nls) DBG_LEAVE( suppl_cntry.initialized? aS(suppl_cntry): nlsNewInfo()) } void nlsWriteFallback(Country *nls) { static char illchars[] = "\"+,./:;<=>[\\]|"; #if defined(DBCS) # if defined(JAPANESE) static unsigned char dbcstbl[] = { 0x81, 0x9f, 0xe0, 0xfc, 0, 0 }; # else static unsigned char dbcstbl[] = { 0, 0, 0, 0, 0, 0 }; # endif #endif nls->country = 1; nls->charset = 437; nls->datefmt = 0; nls->curSymbol[0] = '$'; nls->thousendsSep[0] = ','; nls->decimalSep[0] = '.'; nls->dateSep[0] = '-'; nls->timeSep[0] = ':'; nls->curFormat = 0; nls->precision = 2; nls->timefmt = 0; nls->listSep[0] = ','; #if defined(JAPANESE) nls->country = 81; nls->charset = 932; nls->datefmt = 2; nls->curSymbol[0] = '\\'; nls->curFormat = 0; nls->precision = 0; nls->timefmt = 1; #endif nls->inclFirst = 0; nls->inclLast = 0xff; nls->exclFirst = 0; nls->exclLast = 0x20; nls->illegalLen = strlen(illchars); nls->illegalChars = (char far *)illchars; #if defined(DBCS) nls->dbcsTbl = (unsigned char far *)dbcstbl; #endif } Country *nlsNewInfo(void) { unsigned char buf[50]; #if 1 IREGS r; DBG_ENTER("nlsNewInfo", Suppl_nls) #ifdef _MICROC_ r.r_es = get_ds(); r.r_di = &buf[0]; #else r.r_es = FP_SEG(&buf[0]); r.r_di = FP_OFF(&buf[0]); #endif r.r_bx = r.r_dx = 0xffff; #define DOS(val) r.r_ax = 0x6500 | (val); \ r.r_cx = sizeof(buf); \ intrpt( 0x21, &r ); \ if(0 == ( r.r_flags & 1 ) ? r.r_ax : 0) #else #ifdef _MICROC_ IREGS r; DBG_ENTER("nlsNewInfo", Suppl_nls) r.r_es = get_ds(); r.r_di = &buf[0]; r.r_bx = r.r_dx = 0xffff; #define errnr ((r.r_flags & 1)? r.r_ax : 0) #define DOS(val) r.r_ax = 0x6500 | (val); \ r.r_cx = sizeof(buf); \ intrpt(0x21, r); \ if(!errnr) #else /*# !(defined(_MICROC_)) */ IREGS r; DBG_ENTER("nlsNewInfo", Suppl_nls) r.r_es = FP_SEG(&buf[0]); r.r_di = FP_OFF(&buf[0]); r.r_bx = r.r_dx = 0xffff; r.r_ax = 0x6500; #define DOS(val) r.r_ax = 0x6500 | (val); \ r.r_cx = sizeof(buf); \ intrpt(0x21, &r); \ if(!errnr) #define errnr (r.r_flags & 1)? r.r_ax : 0) #endif /*# defined(_MICROC_) */ #endif chkHeap #define getbyte(idx) buf[(idx)] #define getword(idx) (*(word*)&buf[(idx)]) #define cpybyte(field,idx) (suppl_cntry.field = buf[(idx)]) #define cpyword(field,idx) (suppl_cntry.field = (*(word*)&buf[(idx)])) #define cpymem(field,idx) memcpy(suppl_cntry.field, &buf[(idx)] \ , sizeof(suppl_cntry.field) - 1) memzerostrct(suppl_cntry); nlsWriteFallback(&suppl_cntry); DOS(1) { /* Extended country inmformation */ cpyword(country, 3); cpyword(charset, 5); cpyword(datefmt, 7); cpymem(curSymbol, 9); cpymem(thousendsSep, 14); cpymem(decimalSep, 16); cpymem(dateSep, 18); cpymem(timeSep, 20); cpybyte(curFormat, 22); cpybyte(precision, 23); cpybyte(timefmt, 24); cpymem(listSep, 29); } DOS(2) /* uppercase table for normal characters */ savePtr(uppercase); DOS(3) /* lowercase table for normal characters */ savePtr(lowercase); DOS(4) /* uppercase table for filename characters */ savePtr(fupcase); DOS(6) /* lowercase table for normal characters */ savePtr(collate); DOS(5) { /* filename character table */ #ifdef _MICROC_ cpymem(illegalChars, 11); suppl_cntry.illegalChars.lo += 10; copy_seg(get_ds(), buf, *(word*)&buf[3], *(word*)&buf[1], 10); #else /*# !(defined(_MICROC_)) */ suppl_cntry.illegalChars = *(char far * *)&buf[1] + 10; _fmemcpy(buf, *(byte far* *)&buf[1], 10); #endif /*# defined(_MICROC_) */ cpybyte(inclFirst, 3); cpybyte(inclLast, 4); cpybyte(exclFirst, 6); cpybyte(exclLast, 7); suppl_cntry.illegalLen= getbyte(9); } #if defined(DBCS) r.r_ax = 0x6300; r.r_ds = r.r_si = 0; intrpt(0x21, &r); if ( !(r.r_flags & 1) && r.r_ds && r.r_si ) { suppl_cntry.dbcsTbl = MK_FP(r.r_ds, r.r_si); } #endif suppl_cntry.initialized = 1; chkHeap DBG_LEAVE( aS(suppl_cntry)) } #ifdef TEST main(void) { nlsInfo(); return 0; } #endif /*# defined(TEST) */ ================================================ FILE: suppl/src/copying ================================================ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ================================================ FILE: suppl/src/copying.lb ================================================ GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ================================================ FILE: suppl/src/dbgf_chg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_change su(bsystem): debug ty(pe): sh(ort description): Change the current state of the logging functions he(ader files): lo(ng description): Changes the current state of the logging functions represented by the macros DBG*(). pr(erequistes): More than one debug stack items are present va(lue): none re(lated to): suppl_log_lock suppl_log_push se(condary subsystems): in(itialized by): suppl_log_push wa(rning): bu(gs): fi(le): dbgf_chg.c */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "dynstr.h" #include "str.h" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_change(suppl_log_csptr_t state) { suppl_log_sptr_t p; assert(state); if(suppl_log_lock()) { assert(suppl_Stack); p = state; while(*p) { switch(*p++) { case 'd': /* maximum nesting level */ strnum(p, &S(maxdepth), (char **)&p); break; case 'f': /* files to be logged */ suppl_log_chg_list(S(ownFiles), S(files), &p); break; case 'c': /* functions to be logged */ suppl_log_chg_list(S(ownFunctions), S(functions), &p); break; case 'C': /* classes to be logged */ suppl_log_chg_list(S(ownClasses), S(classes), &p); break; case 'l': /* global log flag */ suppl_log_flag(S(enabled), &p); break; case 'i': /* indention flag */ suppl_log_flag(S(indent), &p); break; } if(*p++ != ';') break; } suppl_log_unlock(); } } ================================================ FILE: suppl/src/dbgf_cl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_chg_list_ su(bsystem): debug ty(pe): H_ sy(nopsis): sh(ort description): Handle a change state item modifying a list he(ader files): lo(ng description): Handles a change state item that modifies a list of names.\par When a new state is created by using a push_state function, the old lists are not duplicated, but their references only. To indicate that a state has modified a list and therefore has an own copy of it, a flag is maintained.\par The change state item consists of a comma-seperated list of names: \tok{?****}, with: \item \tok{****} is the name, and \item \tok{?} specifies if to add \tok{'+'} or remove \tok{'-'} the name. \endlist If no name is specified, all current entries are removed and the default behaviour is changed to except everything \tok{'+'} or deny all \tok{'-'}. pr(erequistes): str != 0 && *str != 0 && flag != 0 && list != 0 va(lue):\endlist none, but \item \tok{*str :=} pointer to next semicolon or end of string \item \tok{*flag := 1} \item \tok{*list}: modified according specified items re(lated to): suppl_log_push suppl_log_pop suppl_log_change_state se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_chg_list_(FLAG *flag , suppl_log_list_t *list , suppl_log_sptr_t *str) { suppl_log_sptr_t p, q; suppl_log_list_t *act, *prv; int flg; assert(flag); assert(list); assert(str); assert(*str); if(*(p = *str) == NUL || *p == ';') /* Nothing to do */ return; if(!*flag) { /* Must create a local copy */ suppl_log_dup_list(list); *flag = 1; } /* Now append the new entries */ chkHeap do { switch(flg = *p) { case '+': case '-': ++p; break; default: flg = '+'; /* default to "enabled" */ break; } if((q = strpbrk(p, ";,")) == 0) /* advance to end of name */ q = strend(p); if(q == p) { /* default specified */ suppl_log_del_list_(list); list->suppl_l_name[0] = flg; } else { act = list; while((act = (prv = act)->suppl_l_nxt) != 0) { if(suppl_log_match_item(act, p)) { /* remove the current item from the list */ chkHeap prv->suppl_l_nxt = act->suppl_l_nxt; free(act); chkHeap act = prv; } } /* Append a new item */ assert(prv); prv->suppl_l_nxt = suppl_log_mkf_item(flg, p, (size_t)(q - p)); } chkHeap p = q; } while(*p++ == ','); *str = p - 1; chkHeap } ================================================ FILE: suppl/src/dbgf_cle.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_class_enabled su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): Check if an information class is enabled he(ader files): lo(ng description): pr(erequistes): str != NULL && list != NULL va(lue): 0: disabled \item else: enabled re(lated to): suppl_log_match_list suppl_log_item_enabled se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_class_enabled(suppl_log_csptr_t str) { return suppl_log_item_enabled(&S(classes), str); } ================================================ FILE: suppl/src/dbgf_clg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_close su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Close the logfile lo(ng description): Closes the logfile, its data and directory information, so that if it asynchroneously terminates, every item written so far really is in the logfile. If something is written into the logfile, the logfile is opened again and the new entries are appended to it. pr(erequistes): va(lue): none re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_close(void) { if(suppl_l_logfile) { fclose(suppl_l_logfile); suppl_l_logfile = 0; /* identify that no LOG file is open */ *suppl_l_openmode = 'a'; /* Don't overwrite next open */ } } ================================================ FILE: suppl/src/dbgf_dl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_del_list_ su(bsystem): debug ty(pe): HL_ sy(nopsis): sh(ort description): Delete a name log list he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): suppl_log_chg_list_ se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_del_list_(suppl_log_list_t *list) { suppl_log_list_t *h, *act; assert(list); chkHeap if((act = list->suppl_l_nxt) != 0) do { h = act->suppl_l_nxt; chkHeap free(act); chkHeap } while((act = h) != 0); list->suppl_l_nxt = 0; chkHeap } ================================================ FILE: suppl/src/dbgf_dpl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_dup_list su(bsystem): debug ty(pe): HL sy(nopsis): sh(ort description): Duplicate a name log list he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): suppl_log_del_list suppl_log_chg_list_ se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_dup_list(suppl_log_list_t *list) { suppl_log_list_t *dupList; assert(list); chkHeap dupList = list; if((list = list->suppl_l_nxt) != 0) do { dupList = dupList->suppl_l_nxt = suppl_log_mk_item(list->suppl_l_name); chkHeap } while((list = list->suppl_l_nxt) != 0); chkHeap } ================================================ FILE: suppl/src/dbgf_et.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_enter su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): Enter a new function and reconfigure logging status he(ader files): lo(ng description): Enters a new function and reconfigures the logging status.\par The old status is preserved, if necessary, into the local data structure allocated within the stack frame of the function. The member \tok{fct_enabled} is newly configured from the passed in library name, function name and function class. The \tok{nestlevel} is incremented.\par The \tok{fct_enabled} follows the following rules: \enum If a library is specified (\tok{library_name != NULL}), this library must be explicitly enabled as function class. Otherwise logging is disabled for this function. \item If a filename is specified and the filename is explicitly mentioned, logging is either enabled or disabled. \item If both function_name and function_class are explicitly found, both must be enabled. Otherwise logging is disabled. \item If only one of them are explicitly found, its status is used. \item If neither of them are explicitly found, one default status must be enabled. \endlist \par By default no item is explicitly available and all default status' default to "disabled". pr(erequistes): local_data != NULL && function_name != NULL && function_class != NULL va(lue): none, but \item \tok{*data} is updated with data that must be preserved during one nest level \item the current nest level is incremented \item the function-depend enable status is re-evaluated re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_enter(suppl_log_sptr_t library_name , suppl_log_csptr_t file_name , suppl_log_linenr_t linenr , suppl_log_local_data_t *local_data , suppl_log_csptr_t function_name , suppl_log_csptr_t function_class) { int ch1, ch2; assert(local_data); assert(function_name); assert(function_class); /* preserve the current settings */ local_data->suppl_l_prv_nestlevel = suppl_l_nestlevel; local_data->suppl_l_prv_fct_enabled = suppl_l_fct_enabled; local_data->suppl_l_fctname = function_name; /* Set the new values */ ++suppl_l_nestlevel; if(library_name) { if(suppl_log_find_list(&S(classes), library_name) != '+') { suppl_l_fct_enabled = 0; goto goon; /* libraries are mandotary */ } } if((ch1 = suppl_log_find_list(&S(files), file_name)) != 0) { suppl_l_fct_enabled = ch1 == '+'; goto goon; } ch1 = suppl_log_find_list(&S(classes), function_class); ch2 = suppl_log_find_list(&S(functions), function_name); if(ch1) suppl_l_fct_enabled = ch1 == '+' && (!ch2 || ch2 == '+'); else if(ch2) suppl_l_fct_enabled = ch2 == '+'; else /* Neither ch1 nor ch2 */ suppl_l_fct_enabled = S(classes).suppl_l_name[0] == '+' || S(functions).suppl_l_name[0] == '+'; goon: if(suppl_log_class_enabled("fct")) { /* Create the log entries when entering a new function */ suppl_log_log_header(); suppl_log_log_item(">%s() \"%s\"", function_name, function_class); if(library_name) suppl_log_log_item(" lib:%s", library_name); if(file_name) suppl_log_log_item(" in %s:%lu", file_name, linenr); suppl_log_log_trailer(); } } ================================================ FILE: suppl/src/dbgf_ext.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_terminate su(bsystem): debug ty(pe): sh(ort description): Terminate the application with a message in the logs he(ader files): lo(ng description): Terminates the application logging the passed in string and "application terminated by debug system" (both without any class), then terminates the application with DBG_EXIT_CODE. pr(erequistes): va(lue): none re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dbgf_chg.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_terminate(suppl_log_csptr_t loginfo) { if(loginfo) suppl_log_log(loginfo); suppl_log_log("Application terminated by debug system"); exit(DBG_EXIT_CODE); } ================================================ FILE: suppl/src/dbgf_fl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_find_list su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Search a name in a log list lo(ng description): Searches for a name through a log list and return if the name is enabled or disabled. pr(erequistes): list != NULL va(lue): 0: no entry of the specified name or \tok{str == NULL} \item else: status of the found entry re(lated to): suppl_log_match_list se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_find_list(suppl_log_list_t *list , suppl_log_csptr_t str) { suppl_log_list_t *act; int flg, ch; assert(list); flg = 0; if(str && (act = list->suppl_l_nxt) != 0) do { if((ch = suppl_log_match_item(act, str)) != 0) flg = ch; } while((act = act->suppl_l_nxt) != 0); return flg; } ================================================ FILE: suppl/src/dbgf_flg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_flag_ su(bsystem): debug ty(pe): H_ sy(nopsis): sh(ort description): Handle a change state item modifying a flag he(ader files): lo(ng description): Handles a change state item that modifies a flag.\par The flag can be: \tok{'+'} or \tok{"on"} or \tok{"1"} (Note: the \em{string} "1", but the numerical "one") meaning \em{enabled} and \tok{'-'} or \tok{"off"} or \tok{"0"} meaning \em{disabled}.\newline No localization support is implemented for these values as they seem to be related to the programmer only. That means that one cannot use the localized variant of \tok{"on"} as defined for the \subsys{cmdline}. pr(erequistes): str != NULL && *str != NULL && flag != NULL va(lue):\endlist none, but \item \tok{*str :=} pointer to next semicolon or end of string \item \tok{*flag :=} specified boolean state re(lated to): suppl_log_push suppl_log_pop suppl_log_change_state se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_flag_(FLAG *flag, suppl_log_sptr_t *str) { suppl_log_sptr_t p; int ch, flg; assert(flag); assert(str); assert(*str); if((ch = *(p = *str)) == NUL || ch == ';') /* Nothing to do */ return; flg = 0; switch(*(p = *str)) { case '\0': case ';': /* Nothing to do */ break; case 'o': case 'O': /* on or off */ switch(*++p) { case 'n': case 'N': goto flgEnable; case 'f': case 'F': if((ch = *++p) == 'f' || ch == 'F') goto flgFound; } break; /* failed */ case '+': case '1': flgEnable: flg = 1; case '-': case '0': flgFound: /* Now the change item must be finished */ if((ch = *++p) == NUL || ch == ';') { *str = p; *flag = flg; } } } ================================================ FILE: suppl/src/dbgf_ien.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_item_enabled su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): Check if an item is enabled he(ader files): lo(ng description): Checks if 1) logging is enabled at all, 2) the nesting level permits logging, 3) the function name logging is passed, and 4) if the item is enabled according the given list. pr(erequistes): str != NULL && list != NULL va(lue): 0: disabled \item else: enabled re(lated to): suppl_log_match_list se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_item_enabled(suppl_log_list_t *list , suppl_log_csptr_t str) { return S(enabled) /* logging enabled at all */ && suppl_l_nestlevel <= S(maxdepth) && suppl_l_fct_enabled && suppl_log_match_list(list, str); } ================================================ FILE: suppl/src/dbgf_lgh.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_log_header su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Prepare to submit a debug log entry lo: Prepares to issue a debug log entry into the logfile.\par This function dumps the standard information (time, continueous number) and the indention. The line is left open right at the position where to write the message to.\newline If the logfile is closed, it is opened automatically. he(ader files): pr(erequistes): va(lue): none re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "nls.h" #include "appname.h" #include "dynstr.h" #include "supplio.h" #include "msgs.h" #include "syslog.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_log_header(void) { char *fnam; nlstime t; assert(suppl_Stack); if(!suppl_log_lock()) return; /* Open the logfile if not done so already */ if(!suppl_l_logfile) { /* If to lock the debug package fails, _item() and _trailer() will silently ignore any calls */ chkHeap if((fnam = appNameEx()) == 0) Esuppl_noMem(); fnam = EStrConcat(2, fnam, DBG_EXTENSION); suppl_l_logfile = Eopen(fnam, suppl_l_openmode); chkHeap free(fnam); } chkHeap nlsCurTime(aS(t)); suppl_log_unlock(); suppl_log_log_item("%02u:%02u:%02u.%02u ", t.ti_hour, t.ti_minute , t.ti_second, t.ti_hundred); if(S(indent)) { /* indent */ int i; suppl_log_log_item("%9ld:", suppl_l_count); for(i = suppl_l_nestlevel; i--; ) suppl_log_log_item("\t|"); } else { /* no indention, dump nestlevel numerical */ suppl_log_log_item("%ld [%d]: ", suppl_l_count, suppl_l_nestlevel); } } ================================================ FILE: suppl/src/dbgf_lgi.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_log_item su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Submit a message into the debug log file he(ader files): pr(erequistes): va(lue): none re(lated to): suppl_log_log_header suppl_log_log_vitem suppl_log_log_trailer se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): ob(ject): suppl_log_log_vitem su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Submit a message into the debug log file he(ader files): pr(erequistes): va(lue): none re(lated to): suppl_log_log_header suppl_log_log_item suppl_log_log_trailer */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "syslog.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_log_item(suppl_log_csptr_t fmt, ...) { va_list ap; va_start(ap, fmt); suppl_log_log_vitem(fmt, ap); va_end(ap); } void suppl_log_log_vitem(suppl_log_csptr_t fmt, va_list ap) { assert(fmt); if(suppl_l_logfile && suppl_log_lock()) { suppl_log_unlock(); vfprintf(suppl_l_logfile, fmt, ap); chkHeap } } ================================================ FILE: suppl/src/dbgf_lgt.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_log_trailer su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Finish a debug log entry he(ader files): pr(erequistes): va(lue): none re(lated to): suppl_log_log_header se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include #include "syslog.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_log_trailer(void) { assert(suppl_Stack); if(suppl_l_logfile && suppl_log_lock()) { putc('\n', suppl_l_logfile); #ifdef DBG_ALWAYS_CLOSELOG /* FreeDOS does not support commit file */ /* DBG_FLUSHLOG */ DBG_CLOSELOG #else #ifdef DBG_ALWAYS_FLUSH_LOG fcommit(suppl_l_logfile); /* make sure the entry is on disk */ #endif #endif ++suppl_l_count; chkHeap suppl_log_unlock(); } } ================================================ FILE: suppl/src/dbgf_lk.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_unlock su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): "Unlock" the debug/logging package he(ader files): lo(ng description): "Unlocks" the debug/logging package to prevent recursively calling of these packages pr(erequistes): va(lue): re(lated to): suppl_log_lock se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): ob(ject): suppl_log_lock su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): "Lock" the debug/logging package he(ader files): lo(ng description): "Locks" the debug/logging package to prevent recursively calling of these packages pr(erequistes): va(lue): re(lated to): suppl_log_unlock se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif static int locked = -1; int suppl_log_lock(void) { if(++locked) { /* recursion */ --locked; return 0; } return 1; } void suppl_log_unlock(void) { --locked; } ================================================ FILE: suppl/src/dbgf_log.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_log su(bsystem): debug ty(pe): _ sy(nopsis): sh(ort description): Write one log entry he(ader files): lo(ng description): Writes one entry into the debug log.\par The entry is prefixed by the time and, if enabled, indented the necessary depth. Then a printf()-like command is executed and one newline chatacter is appended. pr(erequistes): fmt != NULL va(lue): none re(lated to): suppl_log_log_header suppl_log_log_trailer suppl_log_log_item suppl_log_log_vitem se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_log(suppl_log_csptr_t fmt, ...) { va_list ap; assert(fmt); va_start(ap, fmt); suppl_log_log_header(); suppl_log_log_vitem(fmt, ap); suppl_log_log_trailer(); va_end(ap); } ================================================ FILE: suppl/src/dbgf_lv.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_leave su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): Leave a function and reconfigure logging status he(ader files): pr(erequistes): local_data != NULL va(lue): none, but \item the current nest level is resetted to the original value \item the function-depend enable status is re-evaluated re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_leave(suppl_log_local_data_t *local_data) { assert(local_data); assert(local_data->suppl_l_fctname); if(suppl_log_class_enabled("fct")) /* Create the log entries when leaving a function */ suppl_log_log("<%s()", local_data->suppl_l_fctname); if(local_data->suppl_l_prv_nestlevel != suppl_l_nestlevel - 1) suppl_log_log("Missing %u DBG_LEAVE macro(s)" , suppl_l_nestlevel - 1 - local_data->suppl_l_prv_nestlevel); /* restore the former settings */ suppl_l_nestlevel = local_data->suppl_l_prv_nestlevel; suppl_l_fct_enabled = local_data->suppl_l_prv_fct_enabled; chkHeap } ================================================ FILE: suppl/src/dbgf_mfi.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_mkf_item su(bsystem): debug ty(pe): HL sy(nopsis): sh(ort description): Make a new item of a name log list he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "dynstr.h" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif suppl_log_list_t *suppl_log_mkf_item(int flag, const char * const s , size_t length) { suppl_log_list_t *h; assert(s); assert(length); assert(flag == '+' || flag == '-'); chkHeap h = Emalloc(sizeof(suppl_log_list_t) + length); h->suppl_l_nxt = 0; chkHeap memcpy(&h->suppl_l_name[1], s, length); h->suppl_l_name[0] = flag; h->suppl_l_name[1 + length] = NUL; chkHeap return h; } ================================================ FILE: suppl/src/dbgf_mi.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_match_item su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Test if the item matches the requested string he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_match_item(suppl_log_list_t *item , suppl_log_csptr_t s) { assert(item); assert(s); assert(*s); if(memcmp(&item->suppl_l_name[1], s, strlen(&item->suppl_l_name[1]))) return 0; /* no match */ return item->suppl_l_name[0]; /* return the enable/disable status */ } ================================================ FILE: suppl/src/dbgf_mki.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_mk_item su(bsystem): debug ty(pe): HL sy(nopsis): sh(ort description): Make a new item of a name log list he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "dynstr.h" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif suppl_log_list_t *suppl_log_mk_item(const char * const s) { suppl_log_list_t *h; assert(s); assert(*s == '+' || *s == '-'); h = Emalloc(sizeof(suppl_log_list_t) - 1 + strlen(s)); h->suppl_l_nxt = 0; strcpy(&h->suppl_l_name[0], s); chkHeap return h; } ================================================ FILE: suppl/src/dbgf_ml.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_match_list su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Search a name within a log list and return its status he(ader files): Searches for a name through a log list and return if the name is enabled or disabled. If there is no entry of the name within the list, the default status is returned. lo(ng description): pr(erequistes): list != NULL va(lue): 0: disabled or \tok{str == NULL} \item else: enabled re(lated to): suppl_log_find_list se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_match_list(suppl_log_list_t *list , suppl_log_csptr_t str) { int flg; assert(list); if(!str) return 0; if((flg = suppl_log_find_list(list, str)) == 0) /* no explicit entry --> return default */ flg = list->suppl_l_name[0]; return flg == '+'; } ================================================ FILE: suppl/src/dbgf_pop.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_pop su(bsystem): debug ty(pe): sh(ort description): Discard the current state of the logging functions he(ader files): lo(ng description): The state of the logging functions is organized within a stack. The topmost state is the "current" state under which control the logging functions perform their work. This function discards the current state and restores the previous one. The function will not discard the last state. pr(erequistes): more than one state within the status-stack va(lue): none re(lated to): suppl_log_change, suppl_log_push se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dbgf_pop.c */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_pop(void) { if(suppl_log_lock()) { if(suppl_Stack && S(nxt)) { /* OK more than one entry */ suppl_log_stack_t *p; chkHeap if(S(ownClasses)) suppl_log_del_list(S(classes)); if(S(ownFunctions)) suppl_log_del_list(S(functions)); if(S(ownFiles)) suppl_log_del_list(S(files)); chkHeap p = suppl_Stack; suppl_Stack = S(nxt); free(p); chkHeap } suppl_log_unlock(); } } ================================================ FILE: suppl/src/dbgf_prt.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_print_1 su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Test and open one log entry he(ader files): lo(ng description): Tests, if enabled, and, if so, opens one entry in the debug log.\par This function dumps the usual prefix (time, entry number and indention) and the information class into the logfile and leaves the entry open. pr(erequistes): inf_class != NULL va(lue): 0: if logging is disabled for the particular information class \item else: otherwise re(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 se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): The suppl_log_log() function became unsuiteable, because there is no portable way to implement a macro like DBG_PRINT(), which is called with a dynamic parameter list _and_ calls a function with this list and one additional argument. Therefore the logging process is splitted into two functions, what may lead to problems, if they are not called in sequence. bu(gs): co(mpilers): ob(ject): suppl_log_print_2 su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Fill and close one log entry he(ader files): lo(ng description): Fills and closes one entry in the debug log.\par This function dumps the usual information into the debug logfile and closes this entry, thus, it is the \em{back-end} of the suppl_log_print_1() function. pr(erequistes): fmt != NULL va(lue): none re(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 se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): see suppl_log_print_1() bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int suppl_log_print_1(suppl_log_csptr_t inf_class) { if(suppl_log_class_enabled(inf_class)) { suppl_log_log_header(); suppl_log_log_item("%s: ", inf_class); return 1; } return 0; } void suppl_log_print_2(suppl_log_csptr_t fmt, ...) { va_list ap; assert(fmt); va_start(ap, fmt); suppl_log_log_vitem(fmt, ap); suppl_log_log_trailer(); va_end(ap); } ================================================ FILE: suppl/src/dbgf_psh.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_log_push su(bsystem): debug ty(pe): sh(ort description): Duplicates the current state of the logging functions he(ader files): lo(ng description): The state of the logging function is organized within a stack, the topmost item controls the behaviour of the logging functions. This function duplicates the topmost item, thus, preserves the current state to be restored later. pr(erequistes): va(lue): none re(lated to): suppl_log_change, suppl_log_pop se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dbgf_psh.c */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "dynstr.h" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void suppl_log_push(void) { if(suppl_log_lock()) { suppl_log_stack_t *p; assert(suppl_Stack); memcpy(p = Emalloc(sizeof(suppl_log_stack_t)) , suppl_Stack, sizeof(suppl_log_stack_t)); p->suppl_l_nxt = suppl_Stack; suppl_Stack = p; S(ownClasses) = S(ownFunctions) = S(ownFiles) = 0; suppl_log_unlock(); chkHeap } } ================================================ FILE: suppl/src/dbgf_var.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_stack1 su(bsystem): debug ty(pe): L sy(nopsis): sh(ort description): Initial (default) debug stack he(ader files): lo(ng description): Initial debug stack; the default values are: \item no files to be logged; defaults to "disable" \item no functions to be logged; defaults to "disable" \item no classes to be logged; defaults to "disable" \item unlimited depth (32767) \item not enabled \item indent enabled pr(erequistes): va(lue): re(lated to): se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): ob(ject): suppl_Stack su(bsystem): debug ty(pe): sy(nopsis): sh(ort description): Pointer to the current debug stack item he(ader files): lo(ng description): pr(erequistes): va(lue): re(lated to): suppl_log_change se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static suppl_log_push suppl_log_pop wa(rning): bu(gs): co(mpilers): ob: suppl_l_nestlevel su: debug sh: current nesting level of functions during logging re: suppl_log_enter suppl_log_leave in: static suppl_log_enter suppl_log_leave ob: suppl_l_fct_enabled su: debug sh: status if the function name/class allows logging re: suppl_log_enter suppl_log_leave in: static suppl_log_enter suppl_log_leave ob: suppl_l_openmode su: debug sh: how to open the logfile re: suppl_log_enter in: static suppl_log_enter suppl_log_close ob: suppl_l_logfile su: debug sh: opened logfile re: suppl_log_log_header in: static suppl_log_log_header ob: suppl_l_count su: debug sh: line counter of logfile re: suppl_log_log_header in: static suppl_log_log_header */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif suppl_log_stack_t suppl_stack1 = { 0 /* no next item */ , /* files to be logged */ { 0 , { '-', '\0' } } , /* classes to be logged */ { 0 , { '-', '\0' } } , /* functions to be logged */ { 0 , { '-', '\0' } } ,INT_MAX /* maximum nesting level */ ,0 /* logging active? */ ,1 /* indent output? */ ,1 /* 'files' member NOT inherited */ ,1 /* 'classes' member NOT inherited */ ,1 /* 'functions' member NOT inherited */ }; suppl_log_stack_t *suppl_Stack = aS(suppl_stack1); int suppl_l_nestlevel = 0; /* current nesting level */ FLAG suppl_l_fct_enabled = 0; /* function class permits logging */ FILE *suppl_l_logfile = 0; /* logfile opened? */ char suppl_l_openmode[] = "wt"; /* openmode for the logfile first character must be w/a */ long suppl_l_count = 0; /* line counter */ ================================================ FILE: suppl/src/dbgm_chk.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_testMemChain su(bsystem): debug ty(pe): sh(ort description): Test the DOS Memory Chain for corruptions he(ader files): lo(ng description): Tests if the DOS Memory Chain had been corrupted and, if so, the application is terminated with a message onto screen and within logfiles. pr(erequistes): va(lue): none re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dbgm_sr.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #ifndef __GNUC__ #pragma argsused #endif #if defined __TURBOC__ && __TURBOC__ <= 0x201 # define offsetof(s_name, m_name) (size_t)&(((s_name*)0)->m_name) #endif static int checkItem(void *arg, word segm) { (void)arg; if((peekb(segm, offsetof(struct MCB, mcb_type)) != 'M' && peekb(segm, offsetof(struct MCB, mcb_type)) != 'Z') || peekw(segm, offsetof(struct MCB, mcb_size)) >= ~segm) { DBG_POP_STATE DBG_PRINT(Suppl_class_mem, ("Memory Chain corrupted")) cputs("\r\nMemory Chain corrupted!\r\n" "\7Press any key to terminate application\r\n\7"); getch(); DBG_TERMINATE(0) } return 0; } void suppl_testMemChain(void) { static volatile FLAG8 recursive = 1; if(--recursive == 0) { /* prevent recursion */ DBG_PUSH_STATE DBG_CHANGE_STATE("l-") mcb_walk(0, checkItem, 0); DBG_POP_STATE } ++recursive; } ================================================ FILE: suppl/src/dbgv_s0.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_SUPPL su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the library passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of the library passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "SUPPL" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_SUPPL[] = "SUPPL"; ================================================ FILE: suppl/src/dbgv_s10.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_mcb su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{mcb} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{mcb} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "mcb" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_mcb[] = "mcb"; ================================================ FILE: suppl/src/dbgv_s13.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_farmem su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{farmem} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{farmem} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "farmem" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_farmem[] = "farmem"; ================================================ FILE: suppl/src/dbgv_s14.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_dfn su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{dfn} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{dfn} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "dfn" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_dfn[] = "dfn"; ================================================ FILE: suppl/src/dbgv_s15.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_portable su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{portable} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{portable} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "portable" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_portable[] = "portable"; ================================================ FILE: suppl/src/dbgv_s17.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_cmdline su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{cmdline} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{cmdline} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "cmdline" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_cmdline[] = "cmdline"; ================================================ FILE: suppl/src/dbgv_s19.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_arg su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "arg" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_arg[] = "arg"; ================================================ FILE: suppl/src/dbgv_s2.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_appName su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{appName} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{appName} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "appName" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_appName[] = "appName"; ================================================ FILE: suppl/src/dbgv_s20.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_rv su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "rv" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_rv[] = "rv"; ================================================ FILE: suppl/src/dbgv_s22.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_inf su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "inf" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_inf[] = "inf"; ================================================ FILE: suppl/src/dbgv_s23.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_env su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "env" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_env[] = "env"; ================================================ FILE: suppl/src/dbgv_s24.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_mcb su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "mcb" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_mcb[] = "mcb"; ================================================ FILE: suppl/src/dbgv_s25.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_class_mem su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of the class passed to DBG_PRINT() macros he(ader files): lo(ng description): Contains the name of the class passed to DBG_PRINT() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "mem" re(lated to): DBG_PRINT se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_class_mem[] = "mem"; ================================================ FILE: suppl/src/dbgv_s3.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_dynstr su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{dynstr} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{dynstr} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "dynstr" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_dynstr[] = "dynstr"; ================================================ FILE: suppl/src/dbgv_s4.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_env su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{env} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{env} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "env" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_env[] = "env"; ================================================ FILE: suppl/src/dbgv_s5.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_error su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{error} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{error} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "error" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_error[] = "error"; ================================================ FILE: suppl/src/dbgv_s6.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_misc su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{misc} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{misc} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "misc" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_misc[] = "misc"; ================================================ FILE: suppl/src/dbgv_s7.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_supplio su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{supplio} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{supplio} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "supplio" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_supplio[] = "supplio"; ================================================ FILE: suppl/src/dbgv_s8.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Suppl_nls su(bsystem): debug ty(pe): L0 sy(nopsis): sh(ort description): Name of \subsys{nls} passed to DBG_ENTER() macros he(ader files): lo(ng description): Contains the name of \subsys{nls} passed to DBG_ENTER() macros in order to prevent that every function creates its own copy of the word into its data segment. pr(erequistes): va(lue): "nls" re(lated to): DBG_ENTER se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif const char Suppl_nls[] = "nls"; ================================================ FILE: suppl/src/dfn.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the DOS filename functions. Internal header file. */ #ifndef __DFN_LOC #define __DFN_LOC #include #include #include "dfn.h" #define DFN_FILENAME_BUFFER_LENGTH 512 /*!ska Yes, I know that DOS has a more limited length but remember this is only twice as much as a Win95 filename can have. */ #endif ================================================ FILE: suppl/src/dfndeli2.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfndelim2 su(bsystem): dfn ty(pe): sy(nopsis): sh(ort description): Test if a character is any path component delimiter he(ader files): lo(ng description): Tests if a character delimits two path components. This function does match the colon delimiting the drive specification from other path components. pr(erequistes): va(lue): 0: no, not a component delimiter \item 1: yes, is a delimiter re(lated to): dfndelim se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int dfndelim2(const int ch) { #define c (unsigned char)ch return c == '/' || c == '\\' || c == ':'; } ================================================ FILE: suppl/src/dfndelim.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfndelim su(bsystem): dfn ty(pe): sy(nopsis): sh(ort description): Test if a character is a path component delimiter he(ader files): lo(ng description): Tests if a character delimits two path components. This function does not match the colon delimiting the drive specification from other path components. pr(erequistes): va(lue): 0: no, not a component delimiter \item 1: yes, is a delimiter re(lated to): dfndelim2 se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int dfndelim(const int ch) { #define c (unsigned char)ch return c == '/' || c == '\\'; } ================================================ FILE: suppl/src/dfnexpan.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnexpand su(bsystem): dfn ty(pe): H sh(ort description): Expand a path to a fully-qualified one he(ader files): lo(ng description): Generates the fully-qualified path of a given file spec.\par If \tok{*fnam == '\0'} meaning that \para{fnam} is an empty string, \tok{"."} is used.\newline \para{path} is \em{not} expanded itself, meaning\example{|} | dfnexpand("x:foo/bar", "humpf/er") is expanded to \tok{"x:humpf/er\\FOO\\BAR"}. Alternatively one could say that \para{fnam} is preprocessed by \tok{dfnsqueeze()}, but \para{path} is not.\newline If \para{path} does not contain a drive spec, it is assumed that it matches the one of \para{fnam}; see above, too.\newline If \tok{\para{path} == NULL}, the current working path is used. pr(erequistes): fnam != NULL va(lue): NULL: on error \list \tok{ENOMEM}: out of memory \item \tok{ENODRV}: Invalid drive while getting cwd \item \tok{ERANGE}: Buffer of getdcwd() too small \item \tok{ENODEV}: Failed to fetch cwd from drive \endlist \item else: pointer to dynamically allocated buffer with the generated path re(lated to): dfnuexpand dfnsqueeze dfnpath dfnmerge dfnsplit se(condary subsystems): in(itialized by): wa(rning): If the macro \tok{SUPPORT_UNC_PATH} is \em{not} defined prior \tok{#include}'ing the header file, this function does \em{not} support UNC filenames. bu(gs): fi(le): dfnexpan.c ob(ject): dfnuexpand su(bsystem): dfn ty(pe): H sy(nopsis): sh(ort description): Expand a filename to a fully-qualified one he(ader files): lo(ng description): Expands a filename to a fully-qualified one, just as \tok{dfnexpand()}, but supports UNC filenames. pr(erequistes): fnam != NULL va(lue): NULL: on error\item else: pointer to dynamically allocated buffer with the generated path re(lated to): dfnexpand dfnsqueeze dfnpath dfnmerge dfnsplit se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "dfn.loc" #include "dynstr.h" #include "suppl.h" #include "dir.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfnexpand(const char * const fnam, char * const path) { char *h, *p; /* intermediate pointers */ char *dr, *pa, *na, *ex; /* filename components */ char pathDr, *pathPa; /* drive & path of 'path' */ char *dynPath; #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnuexpand", Suppl_dfn) #else DBG_ENTER("dfnexpand", Suppl_dfn) #endif assert(fnam); DBG_ARGUMENTS( ("fnam=\"%s\", path=\"%s\"", fnam, path) ) chkHeap if((h = dfnsqueeze(fnam)) == 0) DBG_RETURN_S( 0) #ifdef SUPPORT_UNC_PATH if(isUNCpath(h)) { /* UNC paths are always fully-qualified */ /* check if the trailing '\\' is present to mark the root direc */ DBG_RETURN_BS((*UNCpath(h) != '\\')? StrAppChr(h, '\\') : h) } #endif chkHeap if(!*h || h[1] != ':' || h[2] != '\\') { /* the spec is not fully-qualified or completely empty */ pathDr = 0; dynPath = 0; if((pathPa = path) != 0 && *pathPa) { if(pathPa[1] == ':') { /* path[] has drive spec */ pathDr = *path; if(!*(pathPa += 2)) { pathPa = 0; goto noPath; } } if(dfndelim(*pathPa) && !pathPa[1]) ++pathPa; /* Trans "/" || "\\" --> "" */ noPath:; } chkHeap if(dfnsplit(h, &dr, &pa, &na, &ex)) { StrFree(h); if(dr) { /* drive specified */ if(pathDr && toFUpper(pathDr) != *dr) /* The specified path is for a different drive */ pathPa = 0; } else { /* drive spec missing */ if((dr = StrChar(pathDr? pathDr: 'A' + getdisk())) == 0) goto errRet; } if(!pa || (*pa != '\\' && *pa != NUL)) { /* no path or a relative one */ if(!pathPa) { /* path has no path spec in it */ if((dynPath = dfnpath(*dr)) == 0) goto errRet; pathPa = dynPath + 2; } if((p = dfnmerge(0, 0, pathPa, pa, 0)) == 0) goto errRet; StrRepl(pa, p); } h = dfnmerge(0, dr, pa, na, ex); } else StrFree(h); errRet: chkHeap free(dr); free(pa); free(na); free(ex); free(dynPath); } chkHeap DBG_RETURN_S( h) } ================================================ FILE: suppl/src/dfnfnam.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnfilename su(bsystem): dfn ty(pe): sh(ort description): Return a pointer to the filename component he(ader files): lo(ng description): Returns the pointer to the filename component of the passed in file spec.\par The "filename component" is the very last component of the file spec and it need not reference to the regular file within the filesystem.\newline If \para{fnam} does not have a filename portion, a pointer to \tok{'\0'} is returned.\newline UNC paths are supported in so far as they don't cause problems with this function. But a \tok{"\\\\server\\share"} string will return a pointer to \tok{"share"} and for \tok{"\\\\server"} \tok{"server"} is returned. pr(erequistes): va(lue): NULL: \para{fnam} == NULL\item else: pointer to filename re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dfnfnam.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "dfn.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfnfilename(const char * const fnam) { const char *p; DBG_ENTER("dfnfilename", Suppl_dfn) if(!fnam) DBG_RETURN_S( 0) DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) p = strchr(fnam, '\0'); while(--p >= fnam && !dfndelim2(*p)); DBG_RETURN_S( (char*)p + 1) } ================================================ FILE: suppl/src/dfnfullp.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnfullpath su(bsystem): dfn ty(pe): H sh(ort description): Expand a path to a minimal fully-qualified one he(ader files): lo(ng description): Generates the fully-qualified path of a given file spec and removes any ".." and "." components.\par Before processing the passed in path is passed through \tok{dfnexpand(path, NULL)}.\newline ".." that chdir above the root directory are ignored, which is very Unix-like, but is not supported by all DOS applications the same way. pr(erequistes): fnam != NULL va(lue): NULL: on error\item else: pointer to dynamically allocated buffer with the generated path; the path may end with a backslash, which means that the passed-in filename must match a directory re(lated to): dfnuexpand dfnsqueeze dfnpath dfnmerge dfnsplit se(condary subsystems): in(itialized by): wa(rning): If the macro \tok{SUPPORT_UNC_PATH} is \em{not} defined prior \tok{#include}'ing the header file, this function does \em{not} support UNC filenames. bu(gs): fi(le): dfnexpan.c ob(ject): dfnufullpath su(bsystem): dfn ty(pe): H sy(nopsis): sh(ort description): Expand a filename to a fully-qualified one he(ader files): lo(ng description): Expands a filename to a fully-qualified one, just as \tok{dfnfullpath()}, but supports UNC filenames. pr(erequistes): fnam != NULL va(lue): NULL: on error\item else: pointer to dynamically allocated buffer with the generated path; the path may end with a backslash, which means that the passed-in filename must match a directory re(lated to): dfnexpand dfnsqueeze dfnpath dfnmerge dfnsplit se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "../../config.h" #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "dfn.loc" #include "dynstr.h" #include "suppl.h" #include "dir.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfnfullpath(const char * const fnam) { char *fullpath; char *paths; char *q; /* intermediate pointers */ char *nxtDelim; int cnt; #ifdef OS_WIN32 #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnufullpath2", Suppl_dfn) #else DBG_ENTER("dfnfullpath2", Suppl_dfn) #endif #else #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnufullpath", Suppl_dfn) #else DBG_ENTER("dfnfullpath", Suppl_dfn) #endif #endif assert(fnam); DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) chkHeap if((fullpath = dfnexpand(fnam, 0)) == 0) DBG_RETURN_S( 0) assert(*fullpath); #ifdef SUPPORT_UNC_PATH if(isUNCpath(fullpath)) paths = UNCpath(fullpath); else #endif { assert(*fullpath && fullpath[1] == ':'); paths = &fullpath[2]; } chkHeap assert(*paths == '\\'); q = paths; while(*q == '\\' && *++q) { /* Check for special directories */ if((nxtDelim = strchr(q, '\\')) == 0) nxtDelim = strchr(q, '\0'); if((cnt = strspn(q, ".")) == nxtDelim - q #ifndef FEATURE_LONG_FILENAMES && cnt < 3 /* DOS limits to "." and ".." */ #endif ) { /* all dots --> special directory */ /* Relocate "q" (cnt-1) path components to the left */ while(--q > paths && --cnt) { /* search next '\' to the left */ while(*--q != '\\'); ++q; } if(*nxtDelim) { /* some components left, move them up */ /* Note: *nxtDelim == *q == '\\', but by copying over this single character one needs not implement a special handling if nxtDelim[1] == '\0' */ memmove(q, nxtDelim, strlen(nxtDelim) + 1); } else { /* this was the last component, but because this was a special directory, the information must be preserved that it is a directory --> append trailing backslash */ q[1] = '\0'; } } else { q = nxtDelim; } } chkHeap DBG_RETURN_S( StrTrim(fullpath)) } ================================================ FILE: suppl/src/dfnmerge.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnmerge su(bsystem): dfn ty(pe): H sh(ort description): Put a filename together he(ader files): lo(ng description): Constructs a filename from components, drive, path, filename and extension.\par The result string is:\newline :\.\newline The ':' is added, if is present.\newline The '\' is added, if and ( or ) are present.\newline The '.' is added, if is present.\par A passed-in value of \tok{NULL} indicates that the particular value is absent; the includes the empty string \tok{""}.\par If specifies an UNC path (\tok{dfnumerge()} only), ':' is substituted by one '\', which is not added, if neither , nor nor is present.\par If no result buffer is specified (\tok{\para{fnam} == NULL}), a buffer is dynamically allocated.\par Unless the macro \tok{SUPPORT_UNC_PATH} is defined prior \tok{#include}'ing the header file, UNC paths are not supported. Though, the only difference is that it is not checked if both filenames are UNC paths or both are not. pr(erequistes): va(lue): NULL: out of memory\item \para{fnam}: if \tok{\para{fnam} != NULL} and no error\item else: pointer to dynamically allocated buffer re(lated to): dfnumerge dfnsqueeze dfnexpand dfnsplit dfnpath se(condary subsystems): in(itialized by): wa(rning): If \tok{path != NULL && *path == '\0'}, the path spec is considered to be absent. This is required to differ the result of \tok{dfnmerge(0, 0, 0, 0, 0)} from the root directory, when passed into \tok{dfnmerge()} as \para{path} again. bu(gs): fi(le): dfnmerge.c ob(ject): dfnumerge su(bsystem): dfn ty(pe): H sh(ort description): Put a filename together he(ader files): lo(ng description): As \tok{dfnmerge()}, but supports UNC paths. pr(erequistes): va(lue): NULL: out of memory\item \para{fnam}: if \tok{\para{fnam} != NULL} and no error\item else: pointer to dynamically allocated buffer re(lated to): dfnmerge dfnusqueeze dfnuexpand dfnusplit se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dfnmerge.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "eno.loc" #include "dfn.loc" #include "suppl.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #define isDelim dfndelim char *dfnmerge(char *fnam, const char * const dr, const char * const Xpath , const char * const nam, const char * const ext) { int len; const char *path; char *p; int delim; /* type of last path component delimiter: 0: none 1: a "real" one ('/' or '\\') or none necessary 2: a colon */ #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnumerge", Suppl_dfn) #else DBG_ENTER("dfnmerge", Suppl_dfn) #endif DBG_ARGUMENTS( ("dr=\"%s\", pa=\"%s\", na=\"%s\", ex=\"%s\", out=%p", dr, Xpath, nam, ext, fnam) ) path = Xpath; if((p = fnam) == 0) { /* determine file nam length */ #ifdef SUPPORT_UNC_PATH len = dr? (*dr == '\\'? strlen(dr) + 1: 3): 1; #else len = dr? 3: 1; /* add the NUL terminator */ #endif if(path) { if(*path) len += strlen(path) + 1; else path = 0; /* no path component specified */ } if(nam) len += strlen(nam); if(ext) len += strlen(ext) + 1; if((fnam = p = eno_malloc(len)) == 0) DBG_RETURN_S( 0) *fnam = NUL; } if(dr) { #ifdef SUPPORT_UNC_PATH if(*dr == '\\') { p = stpcpy(p, dr); /* Test if the drive spec already ends with a delimiter */ delim = isDelim(p[-1]); } else { #endif if(0 != (*p = *dr)) ++p; *p++ = ':'; /* The colon is not a delimiter for root directories */ delim = 2; #ifdef SUPPORT_UNC_PATH } #endif *p = NUL; } else delim = 1; /* no drive --> no delim necessary */ if(path) { switch(delim) { case 0: /* missing delimiter --> need one unless path has one */ if(!isDelim(*path)) *p++ = '\\'; break; } if(!*path) /* The root dir always requires a backslash */ *p++ = '\\'; /* Now, the delimiter is definitely there */ p = stpcpy(p, path); if(0 == (delim = isDelim(p[-1]))) { if(p[-1] == ':') delim = 2; } } if(nam) { if(!delim) { if(!isDelim(*nam)) *p++ = '\\'; delim = 1; } p = stpcpy(p, nam); } if(ext) { if(!delim) { *p++ = '\\'; delim = 1; } *p++ = '.'; strcpy(p, ext); } DBG_RETURN_S( fnam) } ================================================ FILE: suppl/src/dfnpath.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnpath su(bsystem): dfn ty(pe): H sh(ort description): Return the fully-qualified current working path of a drive he(ader files): lo(ng description): Returns the fully-qualified filename of the current working directory of a given drive. The drive can be specified as number (\tok{0}: currently working drive, \tok{1}..\tok{32}: A: .. Z: and special Netware search drives), upper-case letters (\tok{'A'}..\tok{'Z'}) and lower-case letters (\tok{'a'}..\tok{'z'}).\par The path contains the drive specification "?:" and does not have a trailing backslash, unless it is the root directory. pr(erequistes): va(lue): NULL: failure; errno is assigned: \list \tok{ENOMEM}: out of memory \item \tok{ENODEV}: Invalid drive while getting cwd \item \tok{ERANGE}: Buffer of getdcwd() too small \item \tok{ENODEV}: Failed to fetch cwd from drive \endlist \item else: pointer to dynamically allocted string of absolute pathname re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dfnpath.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #if defined(__GNUC__) #include #endif #include "dfn.loc" #include "dynstr.h" #include "suppl.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfnpath(int drive) { char *h; DBG_ENTER("dfnpath", Suppl_dfn) DBG_ARGUMENTS( ("drive=%u ('%c')", drive, drive < 32? '.': drive) ) if (islower(drive)) drive -= 'a' - 'A'; if (drive >= 'A') drive -= 'A' - 1; if ((unsigned)drive > 32) { eno_set( ENODEV); DBG_RETURN_S( 0) } if(0 != (h = StrTrim(_getdcwd(drive, 0, DFN_FILENAME_BUFFER_LENGTH)))) DBG_RETURN_S(h) eno_set(ENODEV); DBG_RETURN_S(0) } ================================================ FILE: suppl/src/dfnsplit.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnsplit su(bsystem): dfn ty(pe): H sh(ort description): Split a given filename into its components he(ader files): lo(ng description): Splits a given filename into its components, the drive, path, filename and extension. Each component may be missing, in which case \tok{NULL} is assigned to the particular result pointer.\par If one of the passed-in pointers is \tok{NULL}, this component is not passed back and, hence, not saved into dynamic memory.\newline On native FAT drives (no UNC filename), only the single drive letter, but not the colon is assigned to \tok{*\para{drive}}.\newline (\tok{dfnusplit()} only:) It is assumed that the UNC paths start with two components that have the meaning of "drive", its: \tok{"\\\\server\\share"}. \par Unless the macro \tok{SUPPORT_UNC_PATH} was defined prior \tok{#include}'ing the header file, this function does not support UNC paths. pr(erequistes): fnam != NULL va(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 the dynamically allocated component re(lated to): dfnusplit dfnmerge se(condary subsystems): in(itialized by): wa(rning): The passed in filename is not preprocessed in any way, neither "." components are removed nor the path fully-qualified.\newline If the passed in filename is an UNC path and the UNC support is enabled, \tok{*\para{drive}} is not just a single letter! bu(gs): fi(le): dfnsplit.c ex:\example{|} | char *drive, *path, *name, *ext; | | if(!dfnsplit("d:\\Path1*./Path2.dgf.575\\....mOrk.vOm.Ork" | , &drive, &path, &name, &ext)) | abort("memory full"); | -results in: | drive = "d" | path = "\\Path1*.\\Path2.dgf.575" | name = "....mOrk.vOm" | ext = "Ork" | | if(!dfnsplit("\\any.name", &drive, &path, &name, &ext)) | abort("memory full"); | -results in: | drive = NULL | path = "\\" | name = "any" | ext = "name" | | if(!dfnsplit("d:\\Path1*./Path2.dgf.575\\....mOrk.vOm.Ork" | , &drive, NULL, &name, NULL)) | abort("memory full"); | -results in: | drive = "d" | path = | name = "....mOrk.vOm" | ext = ob(ject): dfnusplit su(bsystem): dfn ty(pe): H sh(ort description): Split a given filename into its components he(ader files): lo(ng description): As \tok{dfnsplit()}, but supports UNC paths. pr(erequistes): fnam != NULL va(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 the dynamically allocated component re(lated to): dfnusplit dfnmerge se(condary subsystems): in(itialized by): wa(rning): The passed in filename is not preprocessed in any way, neither "." components are removed nor the path fully-qualified.\newline If the passed in filename is an UNC path and the UNC support is enabled, \tok{*\para{drive}} is not just a single letter! bu(gs): fi(le): dfnsplit.c */ #include "initsupl.loc" #include "../../config.h" #ifndef _MICROC_ #include #include #include #endif #include "dfn.loc" #include "dynstr.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int dfnsplit(const char * const fnam, char ** const dr, char ** const path , char ** const name, char ** const ext) { const char *p, *h; char *z; int ch; #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnusplit", Suppl_dfn) #else DBG_ENTER("dfnsplit", Suppl_dfn) #endif assert(fnam); DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) #define iff(var,value) if(var) *(var) = (value) iff(dr, 0); iff(path, 0); iff(name, 0); iff(ext, 0); if((p = fnam) == 0) DBG_RETURN_I( !NUL) chkHeap #ifdef SUPPORT_UNC_PATH if(isUNCpath(p)) { /* UNC drive */ h = UNCpath(p); /* h := end of UNC drive */ if(dr) { chkHeap #ifdef FARDATA assert((h - p) < 0x10000l); #endif if((*dr = *h? StrLeft(p, (size_t)(h - p)): eno_strdup(p)) == 0) DBG_RETURN_I( NUL) DBG_RETURN_VALUES( ("dr=\"%s\"", *dr) ) if(!*h) { /* no further portion, but UNC paths are always fully-qualified -> path := root_directory */ DBG_RETURN_BI((*path = eno_strdup("")) != 0) } p = h; /* points to the '\\' marking the root direc */ } } else /* check for non-UNC drive spec */ #endif if(p[1] == ':') { /* drive spec */ chkHeap if(dr) { if((*dr = StrChar(*p)) == 0) DBG_RETURN_I( NUL) } p += 2; } chkHeap if(*p) { /* there are characters left */ /* determine last path component */ h = dfnfilename(p); chkHeap if(h > p) { /* there is a backslash => a path */ if(path) { if((*path = z = eno_malloc(1 + (size_t)(h - p))) == 0) DBG_RETURN_I( NUL) /* because malloc() before squeeze => if multiple '\\'s some memory is wasted */ /* while copying squeeze multiple '\\'s */ /* strip trailing backslash */ chkHeap do { if(dfndelim(ch = *p++)) { /* squeeze */ ch = '\\'; while(dfndelim(*p++)); --p; } if(p >= h) break; *z++ = ch; } while(1); if(z == *path) /* root directory */ *z++ = '\\'; *z = NUL; chkHeap DBG_RETURN_VALUES( ("path=\"%s\"", *path) ) } p = h; /* skip path */ } /* check for special names starting with a dot '.' */ if(*(h = p) == '.') while(*++h == '.'); if((h = strrchr(h, '.')) == 0) /* no extension at all */ DBG_RETURN_BI( name? (*name = eno_strdup(p)) != 0: !NUL) /* copy the name */ chkHeap if(name) { if((*name = StrLeft(p, (size_t)(h - p))) == 0) DBG_RETURN_I( NUL) chkHeap DBG_RETURN_VALUES( ("name=\"%s\"", *name) ) } /* copy the extension */ if(ext) { if((*ext = eno_strdup(h + 1)) == 0) DBG_RETURN_I(NUL) chkHeap DBG_RETURN_VALUES( ("ext=\"%s\"", *ext) ) } } chkHeap DBG_RETURN_I( !NUL) } ================================================ FILE: suppl/src/dfnsquee.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnsqueeze su(bsystem): dfn ty(pe): H sh(ort description): Squeeze the given filename he(ader files): lo(ng description): Flips forward slashes into backslashes, squeezes multiple backslashes into a single one (unless the leading two for UNC paths), all characters are upper-cased (in order to support LFN in the future one should not rely on upcased characters) and removes any "." components except the very last.\newline Note: On the future ".." might be removed, too! pr(erequistes): va(lue): NULL: on failure (ENOMEM)\item else: pointer to dynamically allocated squeezed filename re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dfnsquee.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "eno.loc" #include "dfn.loc" #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfnsqueeze(const char * const fnam) { char *p, *h, *q; #ifdef SUPPORT_UNC_PATH DBG_ENTER("dfnusqueeze", Suppl_dfn) #else DBG_ENTER("dfnsqueeze", Suppl_dfn) #endif DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) if(!fnam || (h = q = eno_strdup(fnam)) == 0) DBG_RETURN_S( 0) #ifdef SUPPORT_UNC_PATH if(isUNCpath(q)) /* keep the two backslashes */ q += 2; #endif p = q; /* where to begin to squeeze */ /* First: Flip the slashes */ while((q = strchr(q, '/')) != 0) *q = '\\'; /* Second: Squeeze & upcase */ q = p; chkHeap do { redo: if(*q == '\\') { /* possibly to be squeezed */ if(q[1] == '\\') { /* Squeeze '\\\\' -> '\\' */ ++q; goto redo; } if(q[1] == '.') { if(q[2] == '\\') { /* squeeze '\\.\\' -> '\\' */ q += 2; goto redo; } #if 0 /* this may lead to confusion -- 2000/06/07 ska*/ if(q[2] == '\0') { /* squeeze '\\.\0' -> '\\' */ *p = '\\'; *++p = NUL; break; } #endif } } } while((*p++ = toFUpper(*q++)) != 0); chkHeap DBG_RETURN_BS( StrTrim(h)) } ================================================ FILE: suppl/src/dfnstat.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfnstat su(bsystem): dfn ty(pe): sh(ort description): Return the attributes of a given file he(ader files): lo(ng description): Returns the attributes of a given file. If non-zero, the return value is a OR'ed combination of the following flags: \item tok{DFN_FILE}: file is a regular file \item tok{DFN_LFN}: LFN entry \item tok{DFN_DIRECTORY}: file is a directory \item tok{DFN_LABEL}: file is a value label \item tok{DFN_READ}: read permissions granted \item tok{DFN_WRITE}: write permissions granted (may invalid for dirs) \item tok{DFN_HIDDEN}: not for normal display to user \item tok{DFN_SYSTEM}: file important for system, unmoveable \nolist Wildcards are \em{not} expanded, if they are present in the filename. pr(erequistes): va(lue): 0: on failure (file/path not found) (OS error code)\item else: file attribute as described above re(lated to): dfnwrdir se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dfnstat.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "suppl.h" #include "dfn.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int dfnstat(const char * const fnam) { IREGS r; int attr; DBG_ENTER("dfnstat", Suppl_dfn) DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) assert(fnam); /* Probe for root directory */ if(*fnam && fnam[1] == ':' && (!fnam[2] || (fnam[2] == '\\' && !fnam[3]))) { /* Root spec or drive letter only */ /* Probe if the drive is ready */ r.r_ax = 0x4409; r.r_bx = toupper(*fnam) - 'A' + 1; intrpt( 0x21, &r ); if( r.r_flags & 1 ) { eno_setOSerror(r.r_ax); DBG_RETURN_I( 0) } DBG_RETURN_X( DFN_DIRECTORY) } r.r_ax = 0x4300; /* get file attributes */ r.r_ds = FP_SEG(fnam); r.r_dx = FP_OFF(fnam); intrpt( 0x21, &r ); if( r.r_flags & 1 ) { eno_setOSerror(r.r_ax); DBG_RETURN_I( 0) /* call failed */ } if(((attr = r.r_cx) & 0xf) == 0xf) attr = DFN_LFN; else if(!((attr ^= DFN_WRITE) & (DFN_DIRECTORY | DFN_LABEL))) attr |= DFN_FILE; DBG_RETURN_X( attr) } ================================================ FILE: suppl/src/dfntruen.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dfntruename su(bsystem): dfn ty(pe): H sh(ort description): Return the truename of a given filename he(ader files): lo(ng description): Returns the truename of a given filename as returned by the DOS API function 0x60. The filename must not exceed the length of \tok{DFN_FILENAME_BUFFER_LENGTH} bytes.\par The possibly only useful function in which \tok{dfntruename()} should be used is to determine if two files are actually the same physical file although they have different logical filenames, e.g. assume the file \tok{C:\FREEDOS\SUBST.EXE} exists and one has created the logical drive letter \tok{Z:} by the following command: \tok{SUBST Z: C:\FREEDOS}. One could access the same \em{physical} file via two different logical path specifications: \enum \tok{Z:\SUBST.EXE}, and \enum \tok{C:\FREEDOS\SUBST.EXE}. \endlist \tok{dfntruename()} applied to both path specifications would return the only physical access path used by the DOS kernel.\par \em{But beware!} The truename must not be used as a function to fully-qualify a filename. There are at least two cases when that fails: \enum \tok{JOIN A: C:\LW-A}\newline Now the call \tok{dfntruename("C:/lw-a/file")} results into \tok{"A:\\FILE"}, but drive \tok{A:} is not accessable at all! \enum Networked drives, e.g. CD-ROM drives and LAN drives, does not follow the standard naming. Most of them (if not all) follow the UNC standard. For example:\newline Assume drive \tok{F:} is a Novell Netware drive created by:\newline \tok{MAP ROOT F:=SERVER/VOLUME:PATH1/PATH2/PATH3}\newline the call \tok{dfntruename("f:\\file")} would return \tok{"\\SERVER\\VOLUME\\PATH1\\PATH2\\PATH3\\FILE"}.\par Windows 9x/NT can handle UNC filenames, but this results in much slower access time, because Windows 95 globs the filename through the "network environment" driver each time such name is used. pr(erequistes): va(lue): NULL: on failure (OS error code)\item else: pointer to dynamically allocated filename re(lated to): se(condary subsystems): in(itialized by): wa(rning): The returned filename \em{cannot} be used to generate a fully-qualified pathname.\par The only useful thing to do with the result is to test, if two filenames point to the same physical file. One can think of this function as it would return a string generated of the device and i-node number of the file in Unix (symbolic links resolved). bu(gs): fi(le): dfntruen.c */ #include "../../config.h" #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include "dfn.loc" #include "dynstr.h" #include "suppl.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dfntruename(const char * const fnam) { char *h; IREGS r; DBG_ENTER("dfntruename", Suppl_dfn) assert(fnam); DBG_ARGUMENTS( ("fnam=\"%s\"", fnam) ) chkHeap if((h = eno_malloc(DFN_FILENAME_BUFFER_LENGTH)) != 0) { #ifdef FEATURE_LONG_FILENAMES r.r_flags = 1; /* CY before 21.71 calls! */ r.r_ax = 0x7160; r.r_cx = 0x8002; #else r.r_ax = 0x6000; #endif r.r_ds = FP_SEG(fnam); r.r_si = FP_OFF(fnam); r.r_es = FP_SEG(h); r.r_di = FP_OFF(h); chkHeap intrpt( 0x21, &r ); #ifdef FEATURE_LONG_FILENAMES if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) { r.r_ax = 0x6000; intrpt( 0x21, &r ); #endif if(( r.r_flags & 1 ) ? r.r_ax : 0) { /* failed */ eno_setOSerror( r.r_ax); free(h); DBG_RETURN_S( 0) } #ifdef FEATURE_LONG_FILENAMES } #endif } DBG_RETURN_BS( StrTrim(h)) } ================================================ FILE: suppl/src/dir.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Includes DOS specific directory settings */ #ifndef _DIR__H #define _DIR__H #ifdef __TURBOC__ #include #endif #ifdef _PAC_NOCLIB_ #define MAXDIR 66 /* 64: path; +1: root sign; +1: NUL terminator */ #define MAXDRIVE 3 /* 1: drive letter; +1: ':'; +1: NUL terminator */ #define MAXNAME 9 /* 8: name; +1: NUL terminator */ #define MAXEXT 5 /* 3: name; +1: dot; +1: NUL terminator */ #define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3) /* file attributes for Borland C */ #define FA_NORMAL 0x00 /* no special */ #define FA_RDONLY 0x01 /* Read only */ #define FA_HIDDEN 0x02 /* Hidden */ #define FA_SYSTEM 0x04 /* System */ #define FA_LABEL 0x08 /* Volume */ #define FA_DIREC 0x10 /* Directory */ #define FA_ARCH 0x20 /* Archive */ #define FA_ALL 0x3F /* findfirst()/findnext() block for Borland C */ #define find_t ffblk /* MSC's block structure is the same */ #define _find_t ffblk #endif #ifdef __WATCOMC__ #define MAXDIR 66 /* 64: path; +1: root sign; +1: NUL terminator */ #define MAXDRIVE 3 /* 1: drive letter; +1: ':'; +1: NUL terminator */ #define MAXNAME 9 /* 8: name; +1: NUL terminator */ #define MAXEXT 5 /* 3: name; +1: dot; +1: NUL terminator */ #define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3) #define findfirst(pattern,buf,attrib) _dos_findfirst((pattern), (attrib) \ , (struct find_t*)(buf)) #define findnext(buf) _dos_findnext((struct find_t*)(buf)) #endif #endif ================================================ FILE: suppl/src/dmemcmpf.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fMemiCmp su(bsystem): farmem ty(pe): sh(ort description): Compare two far memory areas case-insensitively via DOS NLS he(ader files): lo(ng description): Compares two far memory areas case-insensitively using DOS NLS pr(erequistes): va(lue): <0: first block is less\item =0: both blocks are equal \item >0: first block is greater re(lated to): memcmp, _fMemFCmp se(condary subsystems): nls in(itialized by): wa(rning): bu(gs): fi(le): dmemcmpf.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "dynstr.h" #include "suppldbg.h" #ifdef _MICROC_ int _fMemiCmp(unsigned const dseg, unsigned dofs , unsigned const sseg, unsigned sofs, unsigned length) { int d; DBG_ENTER("_fMemiCmp", Suppl_farmem) if(!length) DBG_RETURN_I( 0) if((dseg | dofs) == 0) DBG_RETURN_I((sseg | sofs) != 0) if((sseg | sofs) == 0) DBG_RETURN_I(-1) while((d = toUpper(peekb(dseg, dofs++)) - toUpper(peekb(sseg, sofs++))) == 0 && --length); DBG_RETURN_I( d) } #else int _fMemiCmp(const byte far * dest, const byte far * src, unsigned length) { int d; DBG_ENTER("_fMemiCmp", Suppl_farmem) if(!length) DBG_RETURN_I( 0) if(dest == 0) DBG_RETURN_I(src != 0) if(src == 0) DBG_RETURN_I(-1) while((d = toUpper(*dest++) - toUpper(*src++)) == 0 && --length); DBG_RETURN_I( d) } #endif ================================================ FILE: suppl/src/dosalloc.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): DOSalloc su(bsystem): farmem ty(pe): sh(ort description): Allocate a block of memory using the DOS API he(ader files): lo(ng description): Allocates a block of memory directly via the DOS API, this block must be deallocated by \tok{DOSfree()} or any other function using the DOS API to deallocate (free) a block of memory.\par \para{length} specifies the size of the block to allocate in \em{paragraphes}. One paragraphe is a chunk of 16 bytes.\newline \para{mode} is a bitfield specifying what to do with UMBs. If no UMBs are available this setting is ignored (except for bit 0x10). Because only some individual combination make sense, they are enumerated: \item \tok{0x00}: low memory first fit \item \tok{0x01}: low memory best fit \item \tok{0x02}: low memory last fit \item \tok{0x0F}: use current allocation strategy \item \tok{0x40}: high memory first fit \item \tok{0x41}: high memory best fit \item \tok{0x42}: high memory last fit \item \tok{0x80}: first fit, try high then low memory \item \tok{0x81}: best fit, try high then low memory \item \tok{0x82}: last fit, try high then low memory \item \tok{0x8F}: make high memory accessable, but don't change strategy \nolist If bit 0x10 is set, the maximal allocateable block size is returned.\newline If bit 0x10 is clear, a block is allocated and its segment is returned. This segment is the handle to be passed back to \tok{DOSfree()} or the DOS API to de-allocated the memory. The far memory address can be generated by \tok{MK_FP(segment, 0)}.\par To support memory tracking utitilites, like \cmd{MEM}, the applications ID (eight byte name) is passed from its own memory block to the allocated ones. pr(erequistes): va(lue): 0: on failure\item else: segment of allocated block or, if bit 0x10 is set, the number of paragraphes of the largest unused block re(lated to): DOSfree DOSresize se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dosalloc.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "suppl.h" #include "mcb.h" #include "fmemory.h" #include "suppldbg.h" word DOSalloc(word length, int mode) { int UMBLink = 1, allocStrat; USEREGS DBG_ENTER("DOSalloc", Suppl_farmem) DBG_ARGUMENTS( ("len=%u, mode=0x%04x", length, mode) ) if(mode & 0x10) /* probe for max unused block */ length = ~0; else if(!length) DBG_RETURN_I( 0) if(mode & (0x40 | 0x80)) { /* UMBs have to be linked in */ _AX = 0x5802; /* Get UMB Link State */ /* FreeDOS doesn't change the flags if the API call fails */ /* /// Modified to use __emit__(), which doesn't require an assembler, if we're compiling with TurboC. - Ron Cemer */ #if defined(_TC_EARLY_) __emit__((unsigned char)0xf9); /* stc */ #elif defined(__WATCOMC__) || defined(__GNUC__) reg.x.flags |= 1; #else asm { stc } #endif geninterrupt(0x21); /* This fails prior DOS 5 */ UMBLink = _AL; if(_CFLAG) /* no UMBs */ UMBLink = 1, /* disables the UMB Unlink call */ mode &= 0xF; /* Disables side effects with elder DOSs */ else { if(!UMBLink) { /* UMBs need to be linked in */ _BX = 1; /* Link in UMBs */ _AX = 0x5803; /* Set UMB Link State */ geninterrupt(0x21); } } } allocStrat = 0; if((mode & 0xF) != 0xF) { /* allocate the block, with the specified mode --> save the old allocation mode */ _AX = 0x5800; /* Get Allocation Strategy */ /* FreeDOS this call never fails, but doesn't change the flags */ /* /// Modified to use __emit__(), which doesn't require an assembler, if we're compiling with TurboC. - Ron Cemer */ #if defined(_TC_EARLY_) __emit__((unsigned char)0xf8); /* clc */ #elif defined(__WATCOMC__) || defined(__GNUC__) reg.x.flags &= ~1; #else asm { clc } #endif geninterrupt(0x21); allocStrat = _AL; if(_CFLAG) /* MCB chain destroyed */ length = 0; /* don't return here, because of UMB state */ else { _BX = mode & ~0x10; /* allocation strategy to set */ _AX = 0x5801; /* Set Allocation Strategy */ geninterrupt(0x21); } } if(length) { /* now, try to allocate the block */ _BX = length; /* size of block */ _AH = 0x48; /* Allocate Memory Block */ geninterrupt(0x21); length = _AX; if(_CFLAG) length = (mode & 0x10)? _BX: 0; /* allocation failed */ else /* allocation OK; update name field */ _fmemcpy(MK_FP(SEG2MCB(length), MCB_OFF_NAME) , MK_FP(SEG2MCB(_psp), MCB_OFF_NAME), 8); if((mode & 0xF) != 0xF) { /* reset allocation strategy */ _BX = allocStrat; _AX = 0x5801; geninterrupt(0x21); } } /* reset UMBLink state */ if(!UMBLink) { _BX = 0; /* Unlink UMBs from chain */ _AX = 0x5803; geninterrupt(0x21); } DBG_RETURN_I( length) /* allocated block */ } ================================================ FILE: suppl/src/dosfree.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): DOSfree su(bsystem): farmem ty(pe): sh(ort description): De-allocate a block of memory using the DOS API he(ader files): lo(ng description): De-allocates a block of memory directly via the DOS API. This block must be allocated by \tok{DOSalloc()} or any other function using the DOS API to deallocate (free) a block of memory. pr(erequistes): va(lue): 0: on success\item else: DOS error code re(lated to): DOSalloc DOSresize se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dosfree.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppl.h" #include "suppldbg.h" int DOSfree(nM(const word) segm) #ifdef _MICROC_ #ifndef SUPPL_LOG_FUNCTIONS asm { mov ax, asmName(segm, 4) or ax, ax ; /* no segment to free */ jz DOSfree1 mov es, ax mov ah, 49h int 21h DOSfree1: } #else { IREGS r; DBG_ENTER("DOSfree", Suppl_farmem) DBG_ARGUMENTS( ("segm=%04x", segm) ) r.r_ax = 0x4900; r.r_es = segm; DBG_RETURN_BI(invokeDOS(aS(r))); } #endif #else { USEREGS DBG_ENTER("DOSfree", Suppl_farmem) DBG_ARGUMENTS( ("segm=%04x", segm) ) _ES = segm; _AH = 0x49; /* Free Memory Block */ geninterrupt(0x21); DBG_RETURN_BI( _AX) } #endif ================================================ FILE: suppl/src/dossize.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): DOSresize su(bsystem): farmem ty(pe): sh(ort description): Resize a block of memory using the DOS API he(ader files): lo(ng description): Resizes a block of memory directly via the DOS API. This block must be allocated by \tok{DOSalloc()} or any other function using the DOS API. pr(erequistes): va(lue): 0: on success\item else: on failure re(lated to): DOSalloc, DOSfree se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dossize.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppl.h" #include "mcb.h" #include "suppldbg.h" int DOSresize(word segm, word newLen) { USEREGS DBG_ENTER("DOSresize", Suppl_farmem) DBG_ARGUMENTS( ("segm=0x%04x, len=%u", segm, newLen) ) if(!segm) DBG_RETURN_I( 1) /* no segment */ #ifdef _MICROC_ /* Micro-C's int86() does not support ES */ segm; /* mov ax, segm */ asm "mov es, ax"; newLen; /* mov ax, newLen */ asm { mov bx, ax mov ah, 4ah int 21h sbb ax, ax } #ifdef SUPPL_LOG_FUNCTIONS DBG_RETURN_BI(nargs()) #endif /* implizitly returning AX */ #else _ES = segm; /* block to resize */ _BX = newLen; /* new size in paragraphs */ _AH = 0x4a; /* DOS call Modify Allocated Memory */ geninterrupt(0x21); DBG_RETURN_BI( _CFLAG) /* return the Carry flag */ #endif } #ifdef _MICROC_ word resizeBlk(const word segm, const unsigned length) { return DOSresize(segm, BLK_byte2para(length)); } #endif ================================================ FILE: suppl/src/dstrchar.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *StrChar(int ch) Create a dynamic string containing the single character ch. Return: NULL: malloc() returned NULL else: pointer to the malloc()'ed string Target compilers: Micro-C v3.13, v3.14; Borland C v2, v3.1, v4.52 ob(ject): StrChar su(bsystem): dynstr ty(pe): H sh(ort description): Create a dynstring from a character lo(ng description): Creates a dynamic string out of a single character va: NULL: if \tok{malloc()} fails (ENOMEM) \item else: pointer to dynamically allocated string pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dstrchar.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "dynstr.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrChar(int ch) { char *h; DBG_ENTER("StrChar", Suppl_dynstr) DBG_ARGUMENTS( ("ch='%c' (0x02x)", ch > 32? ch: ' ', ch) ) chkHeap if((h = eno_strdup(" ")) != 0) *h = ch; chkHeap DBG_RETURN_S( h) } ================================================ FILE: suppl/src/dstrfupr.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *StrFUpr(char s[]) Upcase the string s[] using the toFUpper() function. s may be NULL. Return: s[] ob(ject): StrFUpr su(bsystem): nls ty(pe): sh(ort description): Upcase the string using the DOS NLS lo(ng description): Upcases the string using the DOS NLS information for filenames. The string is overwritten, pr(erequistes): re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): va: \para{s} fi(le): dstrupr.c */ #include "initsupl.loc" #include #include "nls_f.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrFUpr(char *s) { char *p; DBG_ENTER("StrFUpr", Suppl_nls) if((p = s) != 0) while((*p = toFUpper(*p)) != NUL) ++p; DBG_RETURN_S( s) } ================================================ FILE: suppl/src/dstrleft.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *StrLeft(char s[], unsigned length) Return the left length characters of s. If strlen(s) < length, the string is duplicated. s may be NULL. Return: NULL: s==NULL, malloc() failed else: pointer to the malloc()'ed buffer Target compilers: Micro-C, Borland C v2, v3.1, v4.52 ob(ject): StrLeft su(bsystem): dynstr ty(pe): H sh(ort description): Duplicate the first n characters into the heap lo(ng description): Duplicates the first \para{len} characters of the string \para{str} into the heap. pr(erequistes): va: NULL: if \tok{malloc()} fails (ENOMEM), \tok{s == NULL} (EINVAL) \item else: pointer to dynamically allocated memory re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): fi(le): dstrleft.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "dynstr.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrLeft(const char * const s, size_t length) { char *h; unsigned l; DBG_ENTER("StrLeft", Suppl_dynstr) if(!s) { eno_set(EINVAL); DBG_RETURN_S( 0) } DBG_ARGUMENTS( ("str=\"%s\", len=%u", s, length) ) if((l = (unsigned)strlen(s)) < length) length = l; chkHeap if((h = eno_malloc(length + 1)) != 0) { memcpy(h, s, length); h[length] = NUL; } chkHeap DBG_RETURN_S( h) } ================================================ FILE: suppl/src/dstrrepl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *StrRepl_(char *dest[], const char src[]) Free dest[0] and place src there Return: src ob(ject): StrRepl_ su(bsystem): dynstr ty(pe): H_ sh(ort description): Replace a dynstring with a new dynstring lo(ng description): Replaces a dynamic string with another dynamic string.\par \em{Note}: The new string must be a dynamic string already, it is \em{not} created anew by this function. pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va: \para{src} fi(le): dstrrepl.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrRepl_(char ** const dest, char * const src) { DBG_ENTER("StrRepl_", Suppl_dynstr) assert(dest); chkHeap free(*dest); chkHeap DBG_RETURN_BS( dest[0] = src) } ================================================ FILE: suppl/src/dstrtrim.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): StrTrim su(bsystem): dynstr ty(pe): H sh(ort description): Reallocate a dynstring lo(ng description): Reallocates a dynamic string to its smallest possible buffer. pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): The passed in string is \em{not} expected as a variable, thus, the result is not stored there, but returned as return value only. bu(gs): fi(le): dstrtrim.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "dynstr.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrTrim(char * const s) { char *p; DBG_ENTER("StrTrim", Suppl_dynstr) if(!s) DBG_RETURN_S( 0) chkHeap if((p = eno_realloc(s, strlen(s) + 1)) == 0) { DBG_STRING("realloc() should never have failed!!") chkHeap DBG_RETURN_S( s) } chkHeap DBG_RETURN_S( p) } ================================================ FILE: suppl/src/dstrupr.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *StrUpr(char s[]) Upcase the string s[] using the toUpper() function. s may be NULL. Return: s[] ob(ject): StrUpr su(bsystem): nls ty(pe): sh(ort description): Upcase the string using the DOS NLS lo(ng description): Upcases the string using the DOS NLS information. The string is overwritten, pr(erequistes): re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): va: \para{s} fi(le): dstrupr.c */ #include "initsupl.loc" #include #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *StrUpr(char *s) { char *p; DBG_ENTER("StrUpr", Suppl_nls) if((p = s) != 0) while((*p = toUpper(*p)) != NUL) ++p; DBG_RETURN_S( s) } ================================================ FILE: suppl/src/eeopen.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ FILE *Eopen(const char * const fnam, const char * const mode); Open the file as Fopen(), terminate the program on failure ob(ject): Eopen su(bsystem): error ty(pe): S sh(ort description): Open a new stream and open a FILE pointer lo(ng description): Wrapps \tok{fopen()}. On failure the program is terminated with the error message: "Cannot open file \"%s\"" pr(erequistes): re(lated to): Ecreate Eclose Eread Ewrite Fopen Fxopen se(condary subsystems): supplio in(itialized by): wa(rning): bu(gs): va(lue): a valid FILE pointer fi(le): eeopen.c */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "msgs.h" #include "supplio.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif FILE *Eopen(const char * const fnam, const char * const mode) { FILE *f; DBG_ENTER("Eopen", Suppl_error) if((f = Fopen(fnam, mode)) == 0) Esuppl_openFile(fnam); chkHeap DBG_RETURN_S( f) } ================================================ FILE: suppl/src/eestrcon.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ char *EStrConcat(int argcnt, ...) Concats up to argcnt strings together and malloc() a buffer that will receive the result. If one of the string == NULL, this string is ignored. On failure, the program is terminated with the "out of memory" error. Return: the malloc'ed buffer ob(ject): EStrConcat su(bsystem): error ty(pe): H sh(ort description): Concat several strings together lo(ng description): Concats several strings together, by using the \tok{StrConcat()} function, and terminates the program on failure with the error message: "Out of memory" pr(erequistes): re(lated to): StrConcat se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): va(lue): constructed dynamic string fi(le): eestrcon.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "dynstr.h" #include "msgs.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #ifdef _MICROC_ register char *EStrConcat(int argcnt) { unsigned cnt, *poi; unsigned Xcnt, *Xpoi; unsigned length; char *h, *p; DBG_ENTER1 cnt = nargs(); DBG_ENTER2("EStrConcat", "error") DBG_ARGUMENTS( ("argcnt=%u cnt=%u", argcnt, cnt) ) Xpoi = poi = cnt * 2 - 2 + &argcnt; Xcnt = cnt = min(cnt, *poi); for(length = 1; cnt--;) if(*--poi) length += strlen(*poi); chkHeap if((h = p = malloc(length)) == 0) Esuppl_noMem(); chkHeap while(Xcnt--) if(*--Xpoi) p = stpcpy(p, *Xpoi); chkHeap DBG_RETURN_S( h) } #else /* !_MICROC_ */ char *EStrConcat(int argcnt, ...) { va_list strings; char *p, *s; size_t length, l; DBG_ENTER("EStrConcat", Suppl_error) DBG_ARGUMENTS( ("argcnt=%u cnt=%u", argcnt, argcnt) ) va_start(strings, argcnt); chkHeap p = Estrdup(""); chkHeap length = 1; while(argcnt--) { s = va_arg(strings, char *); if(s && *s) { l = length - 1; Eresize(p, length += strlen(s)); strcpy(p + l, s); } } va_end(strings); chkHeap DBG_RETURN_S( p) } #endif /* _MICROC_ */ ================================================ FILE: suppl/src/elvis.rc ================================================ set nomore set autoindent set autowrite set noerrorbells set exrc set showmatch set shiftwidth=4 set tabstop=4 abbr #i #include abbr! #i #include abbr #d #define abbr! #d #define abbr #f #ifdef abbr! #f #ifdef abbr #n #ifndef abbr! #n #ifndef abbr #l #else abbr! #l #else abbr #e #endif abbr! #e #endif abbr MC Micro-C abbr! MC Micro-C abbr BC Borland C/Turbo C abbr! BC Borland C/Turbo C abbr TC Turbo C abbr! TC Turbo C abbr WC Watcom C abbr! WC Watcom C abbr PAC Pacific HiTech C abbr! PAC Pacific HiTech C abbr #E #define ESUPPL_ abbr! #E #define ESUPPL_ abbr #m #ifdef _MICROC_ abbr #M #ifndef _MICROC_ map q 0wCunless_segm(segm) ================================================ FILE: suppl/src/eno.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ Declarations for the local errno - wrappers */ #ifndef __SUPPL_ERRNO_LOC #define __SUPPL_ERRNO_LOC /* Need size_t */ #include #include #define eno_set(eno) \ (errno = (eno)) int eno_setOSerror(int errnr); char *eno_strdup(const char * const fnam); void *eno_malloc(const size_t len); void *eno_realloc(void * const poi, const size_t len); #if !defined(_MICROC_) && !defined(__GNUC__) char *eno_fdupstr(const char far * const s); #endif /* !_MICROC_ && !__GNUC__ */ #endif ================================================ FILE: suppl/src/enoallc.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): eno_malloc su(bsystem): error ty(pe): HL sy(nopsis): sh(ort description): as malloc(), but assigns errno he(ader files): lo(ng description): as malloc(), but assigns errno = ENOMEM on failure pr(erequistes): va(lue): NULL: on out-of-memory \item else: dynamically allocated block of memory re(lated to): eno_strdup, Strdup, malloc se(condary subsystems): mem xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "eno.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void *eno_malloc(const size_t len) { void *h; DBG_ENTER("eno_malloc", Suppl_error) DBG_ARGUMENTS( ("size=%u", len) ) chkHeap if(0 == (h = malloc(len))) eno_set( ENOMEM); chkHeap DBG_RETURN_P(h) } ================================================ FILE: suppl/src/enoreal.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): eno_realloc su(bsystem): error ty(pe): HL sy(nopsis): sh(ort description): as realloc(), but assigns errno he(ader files): lo(ng description): as realloc(), but assigns errno = ENOMEM on failure pr(erequistes): va(lue): NULL: on out-of-memory \item else: dynamically allocated block of memory re(lated to): eno_strdup, Strdup, malloc se(condary subsystems): mem xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "eno.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void *eno_realloc(void * const poi, const size_t len) { void *h; DBG_ENTER("eno_realloc", Suppl_error) DBG_ARGUMENTS( ("poi=%p, size=%u", poi, len) ) if(0 == (h = realloc(poi, len))) eno_set( ENOMEM); DBG_RETURN_P(h) } ================================================ FILE: suppl/src/enosdup.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): eno_strdup su(bsystem): error ty(pe): HL sy(nopsis): sh(ort description): as Strdup(), but assigns errno he(ader files): lo(ng description): as Strdup(), but assigns errno = ENOMEM on failure pr(erequistes): va(lue): \tok{NULL}: \tok{\para{fnam} == NULL} or on out-of-memory \item else: dynamically allocated block of memory re(lated to): strdup, Strdup, eno_malloc se(condary subsystems): mem xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "eno.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *eno_strdup(const char * const s) { DBG_ENTER("eno_strdup", Suppl_error) DBG_ARGUMENTS( ("s=\"%s\"", s) ) if(s) { char *h = strdup(s); if(h) DBG_RETURN_S(h) eno_set( ENOMEM); } DBG_RETURN_S(0) } ================================================ FILE: suppl/src/enosetos.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ Assigns a DOS error code to _doserrno and errno. ob(ject): eno_setOSerror su(bsystem): error ty(pe): HL sy(nopsis): sh(ort description): Assign a DOS error code to _doserrno and errno he(ader files): lo(ng description): Assigns a DOS error code to _doserrno and recodes the value into the corresponding errno equivalent, which is storred, too. pr(erequistes): va(lue): \tok{errnr} re(lated to): eno_set se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include "eno.loc" #include "suppldbg.loc" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #if defined(__TURBOC__) || defined(__GNUC__) extern char _dosErrorToSV []; #elif __WATCOMC__ extern int __set_errno_dos(unsigned int err); #else #error "Unsupported compiler!" #endif int eno_setOSerror(int errnr) { #ifdef __TURBOC__ int eno; #endif DBG_ENTER("eno_setOSerror", Suppl_error) DBG_ARGUMENTS( ("errnr=%u", errnr) ) #if defined(__TURBOC__) if((unsigned)errnr > 88) { DBG_INFO( ("Errnr exceeds range") ) eno = EFAULT; } else { eno = _dosErrorToSV[errnr]; } errno = eno; _doserrno = errnr; #elif __WATCOMC__ __set_errno_dos(errnr); #endif DBG_RETURN_I( errnr) } ================================================ FILE: suppl/src/env_chg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_change su(bsystem): env ty(pe): sh(ort description): Insert/replace/delete a variable lo(ng description): If \tok{\para{value} != NULL}, the variable is inserted or replaced, if it already exists within the environment.\newline If \tok{\para{value} == NULL}, the variable is removed from the environment.\newline Both \para{var} and \para{value} may point to an empty string. pr(erequistes): var != NULL re(lated to): chgenv env_add se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{0}: Cannot insert variable \item \tok{1}: variable replaced or deleted \item \tok{2}: variable not found (could not delete) \item \tok{3}: variable newly inserted \item \tok{4}: no environment at all \item \tok{-1}: \tok{\para{varname} == NULL} fi(le): env_chg.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_change(word segm, const char * const var, const char * const value) { unsigned offset; DBG_ENTER("env_change", Suppl_env) DBG_ARGUMENTS( ("env=%u, var=\"%s\", value=\"%s\"", segm, var, value) ) chkMem if(var == 0) DBG_RETURN_I( -1) unless_segm(segm) DBG_RETURN_I( 4) DBG_ARGUMENTS( ("effective env=%u", segm) ) /* Check if the variable is already in */ if((offset = env_findVar(segm, var)) != 0xffff) /* Overwrite/delete variable */ DBG_RETURN_BI( !env_ovrVarOffset(segm, offset, 0, value)) /* not in environment */ if(!value) /* nothing to delete */ DBG_RETURN_I( 2) /* Try to insert the variable */ DBG_RETURN_BI( env_appVar(segm, var, value)? 0: 3) } ================================================ FILE: suppl/src/env_del.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_delete su(bsystem): env ty(pe): sh(ort description): Delete an environment segment lo(ng description): Deletes the given environment segment.\par If it is \tok{0} (zero) or the default environment, the field of the PSP is updated with \tok{0} (zero) to indicate that no default environment exists. pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): none fi(le): env_del.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "environ.loc" #include "suppl.h" #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void env_delete(word segm) { DBG_ENTER("env_delete", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem unless_segm(segm) DBG_EXIT DBG_ARGUMENTS( ("effective env=%u", segm) ) pokew(SEG2MCB(segm), MCB_OFF_OWNER, _psp); freeBlk(segm); chkMem /* Make sure the deleted segment won't be referenced */ env_relocateSegment(segm, 0); DBG_EXIT } ================================================ FILE: suppl/src/env_dvar.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): dupvar su(bsystem): env ty(pe): H sh(ort description): Duplicate a variable into heap lo(ng description): Retreive the value of a variable of the default environment and duplicate its value into the heap. pr(erequistes): re(lated to): env_dupvar cpyenv se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{NULL}: out of memory (ENOSPC), variable not found (ENOENT), no environment at all (ENXIO) \item else: pointer to allocated buffer fi(le): env_dvar.c ob(ject): env_dupvar su(bsystem): env ty(pe): H sh(ort description): Duplicate a variable into heap lo(ng description): Retreive the value of a variable of the specified environment and duplicate its value into the heap. pr(erequistes): re(lated to): env_dupvar cpyenv se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{NULL}: out of memory or variable not found \item else: pointer to allocated buffer fi(le): env_dvar.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include #include "environ.loc" #include "eno.loc" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *dupvar(const char * const var) { return env_dupvar(0, var); } char *env_dupvar(word segm, const char * const var) { int ofs; /* offset of the variable */ char *h; DBG_ENTER("env_dupvar", Suppl_env) DBG_ARGUMENTS( ("env=%u, var=\"%s\"", segm, var) ) chkMem unless_segm(segm) { eno_set(ENXIO); DBG_RETURN_S( 0) } if(var == 0 /* nothing to do */ || (ofs = env_findVar(segm, var)) == -1) { /* variable not found */ eno_set(ENOENT); DBG_RETURN_S( 0) } if(0 == (h = _fdupstr(MK_FP(segm, ofs + strlen(var) + 1)))) eno_set(ENOMEM); DBG_RETURN_S(h) } ================================================ FILE: suppl/src/env_find.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_findVar su(bsystem): env ty(pe): sh(ort description): Find a variable lo(ng description): Searches case-sensitively for a variable in the given environment pr(erequistes): segm != 0 re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{(word)-1}: failure; not found (ENOENT), \tok{segm == 0 || val == 0} (EINVAL) \item else: offset of first case-sensitive match fi(le): env_find.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.h" #include "fmemory.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word env_findVar(const word segm, const char * const var) { word offset; int len; DBG_ENTER("env_findVar", Suppl_env) DBG_ARGUMENTS( ("env=%u, var=\"%s\"", segm, var) ) chkMem /* for security reason, check if environment is present at all */ if(!segm || !var) { eno_set(EINVAL); DBG_RETURN_U( -1) /* No env --> no var can be found */ } /* No var --> nothing to search for */ DBG_ARGUMENTS( ("effective env=%u", segm) ) offset = 0; /* env starts always at location 0 */ len = strlen(var); while(peekb(segm, offset)) { /* there is another variable */ if(peekb(segm, offset + len) == '=' && _fmemcmp(MK_FP(segm, offset), TO_FP(var), len) == 0) DBG_RETURN_U( offset) /* we found it */ /* skip to the next variable */ offset += env_varlen(segm, offset); } /* all variables were tested, nothing found */ eno_set(ENOENT); DBG_RETURN_U( -1) } ================================================ FILE: suppl/src/env_fora.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_forall su(bsystem): env ty(pe): sh(ort description): Enumerate all variables lo(ng description): Enumerates all variables of a given environment and invokes a function for each found variable. The callback function must be of type \tok{ENV_WALKFUNC}, which prototype is: \example{|} |int FCT(void *arg, word env, word offset) The argument \para{arg} is passed unchanged to the callback function and may be used to pass arbitary information from the program via \tok{env_forAll} to the callback function.\newline If the callback function returns \tok{0} (zero), the enumeration process continues; otherwise the loop breaks immediately.\par On loop, \tok{env_forAll} continues with the next variable following the one starting at the position passed to the callback function. pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{-1}: parameter out of range \list \tok{ENXIO}: No environment at all \item \tok{EINVAL}: invalid argument \endlist \item \tok{0}: all variables enumerated, callback function returned \tok{0} (zero) every time \item else: the return value of the callback function fi(le): env_fora.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "environ.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_forAll(word segm, ENV_WALKFUNC fct, void *arg) { word ofs; int retVal; DBG_ENTER("env_forAll", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem unless_segm(segm) { eno_set(ENXIO); return -1; } if(!fct) { eno_set(EINVAL); return -1; } DBG_ARGUMENTS( ("effective env=%u", segm) ) for(ofs = 0; peekb(segm, ofs); ofs += env_varlen(segm, ofs)) { DBG_INFO( ("invoke callback function with (%u:%u)", segm, ofs) ) if((retVal = (*fct)(arg, segm, ofs)) != 0 /* call function & break */ || !peekb(segm, ofs)) /* callback function cleared env */ DBG_RETURN_I( retVal) } DBG_RETURN_I( 0) } ================================================ FILE: suppl/src/env_free.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_endOfVars su(bsystem): env ty(pe): L sh(ort description): Return the first byte behind the environment variables lo(ng description): Returns the offset of the first byte of the environment that is not a part of the variables area. pr(erequistes): \para{segm} != 0 re(lated to): se(condary subsystems): in(itialized by): bu(gs): va(lue): offset of first byte behind the environment variables fi(le): env_free.c ob(ject): env_firstFree su(bsystem): env ty(pe): L sh(ort description): Return the first byte not used by the environment areas lo(ng description): Returns the offset of the first byte of the environment that is unused currently. pr(erequistes): \para{segm} != 0 re(lated to): se(condary subsystems): in(itialized by): wa(rning): This offset may point outside of the environment, if it is completely filled. bu(gs): va(lue): offset of first unused byte of the environment fi(le): env_free.c ob(ject): env_freeCount su(bsystem): env ty(pe): L sh(ort description): Count the number of unused bytes of the environment lo(ng description): Returns the number of unused bytes of the environment. pr(erequistes): \para{segm} != 0 re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): If the segment is >= 64KB long and is filled >= (64KB - 1), this function returns invalid values. va(lue): offset of first unused byte of the environment fi(le): env_free.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.h" #include "mcb.h" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word env_endOfVars(const word segm) { word offset; DBG_ENTER("env_endOfVars", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem assert(segm != 0); offset = 0; /* env starts always at location 0 */ while(peekb(segm, offset)) /* there is a variable */ offset += env_varlen(segm, offset); DBG_RETURN_U( offset) /* This is the terminator byte */ } word env_firstFree(const word segm) { DBG_ENTER("env_firstFree", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem assert(segm != 0); DBG_RETURN_BU( env_string(segm, env_strings(segm))) } word env_freeCount(const word segm) { DBG_ENTER("env_firstCount", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem assert(segm != 0); DBG_RETURN_BU( mcb_length(segm) - env_firstFree(segm)) } ================================================ FILE: suppl/src/env_insv.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_appVar su(bsystem): env ty(pe): L sh(ort description): Append a variable to the end of the environment lo(ng description): Inserts a variable before the end of the variables area of the environment pr(erequistes): re(lated to): env_change putenv env_insVarOffset se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \endlist integer SUPPL error code\newline \item \tok{ESUPPL_OK}: variable inserted or \tok{\para{value} == NULL} \item \tok{ESUPPL_NOMEM}: failed to insert variable \item \tok{ESUPPL_INVAL}: parameter out of range \item \tok{ESUPPL_NOENV}: no environment at all fi(le): env_insv.c ob(ject): env_insVarOffset su(bsystem): env ty(pe): L sh(ort description): Insert a variable into the environment lo(ng description): Inserts a variable before the specified offset of an environment pr(erequistes): re(lated to): env_change putenv env_appVar se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{ESUPPL_OK}: variable inserted or \tok{\para{value} == NULL} \item \tok{ESUPPL_NOMEM}: failed to insert variable \item \tok{ESUPPL_INVAL}: parameter out of range \item \tok{ESUPPL_NOENV}: no environment at all fi(le): env_insv.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.loc" #include "errcodes.h" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_appVar(word segm, const char * const var, const char * const value) { DBG_ENTER("env_appVar", Suppl_env) DBG_ARGUMENTS( ("env=%u, var=\"%s\", value=\"%s\"", segm, var, value) ) chkMem unless_segm(segm) DBG_RETURN_I( ESUPPL_NOENV) DBG_ARGUMENTS( ("effective env=%u", segm) ) DBG_RETURN_BI( env_insVarOffset(segm, env_endOfVars(segm) , var, value)) } int env_insVarOffset(word segm, word offset, const char * const var , const char * const value) { int lenN, lenV, lenG; DBG_ENTER("env_insVarOffset", Suppl_env) DBG_ARGUMENTS( ("env=%u, ofs=%u, var=\"%s\", value=\"%s\"", segm, offset, var, value) ) chkMem unless_segm(segm) DBG_RETURN_I( ESUPPL_NOENV) DBG_ARGUMENTS( ("effective env=%u", segm) ) if(!value) /* ignore */ DBG_RETURN_I( ESUPPL_OK) if(!var) DBG_RETURN_I( ESUPPL_INVAL) if(env_freeCount(segm) < (lenG = (lenN = strlen(var)) + (lenV = strlen(value)) + 2) || lenG <= 1) /* longer than 32KB */ DBG_RETURN_I( ESUPPL_NOMEM) /* sorry, no space free in the env seg */ /* 1) move the following variables and the string table out of the way */ _fmemmove(MK_FP(segm, offset + lenG), MK_FP(segm, offset) , env_firstFree(segm) - offset); /* 2) move the variable */ chkMem _fmemcpy(MK_FP(segm, offset), TO_FP(var), lenN); chkMem _fmemcpy(MK_FP(segm, offset + lenN + 1), TO_FP(value), lenV + 1); chkMem pokeb(segm, offset + lenN, '='); chkMem DBG_RETURN_I( ESUPPL_OK) } ================================================ FILE: suppl/src/env_len.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_varlen su(bsystem): env ty(pe): sh(ort description): Return the number of bytes used by the variable lo(ng description): Returns the number of bytes used by the variable at the specified offset, including \tok{NUL} terminator byte. pr(erequistes): \para{segm} != NULL re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): number of bytes used by the variable fi(le): env_len.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.loc" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif unsigned env_varlen(const word segm, const word offset) /* Return the length of the string at segm:offset */ { assert(segm != 0); return _fstrlen(MK_FP(segm, offset)) + 1; } ================================================ FILE: suppl/src/env_mtch.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_matchVar su(bsystem): env ty(pe): sh(ort description): Retreive the name of a variable lo(ng description): Retrieves the case-sensitive name of a variable.\par If no case-sensitive match is located within the environment, the first case-insensitive match is found and overwrites the passed in buffer of the name of the variable. pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{1}: parameter out of range \item \tok{2}: no match found, \para{var][]} unchanged \item \tok{3}: no environment at all, \para{var][]} unchanged \nolist If \tok{(\para{return_value} & 7) == 0}, the return value is any combination of the following numbers: \item \tok{4}: more than one case-sensitive match found \item \tok{8}: more than one case-insensitive match found \item \tok{16}: at least one case-sensitive match found \item \tok{32}: at least one case-insensitive match found \nolist If \tok{(\para{return_value} & (4 | 16)) == 0}, the \tok{var[]} array is unchanged. Otherwise its contents is updated with the name of the first case-insensitively matched variable. fi(le): env_mtch.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "fmemory.h" #include "suppl.h" #include "dynstr.h" #include "environ.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_matchVar(word segm, char * const var) { int retVal, varLen; word firstOfs, ofs; DBG_ENTER("env_matchVar", Suppl_env) DBG_ARGUMENTS( ("env=%u, var=\"%s\"", segm, var) ) chkMem if(!var) DBG_RETURN_I( 1) /* no variable to search for */ unless_segm(segm) DBG_RETURN_I( 3) /* no environment at all */ DBG_ARGUMENTS( ("effective env=%u", segm) ) retVal = ofs = 0; varLen = strlen(var); /* offset of '=' sign */ while(peekb(segm, ofs)) { if(peekb(segm, ofs + varLen) == '=') { /* length is OK */ if(_fmemcmp(MK_FP(segm, ofs), TO_FP(var), varLen) == 0) { /* case-sensitive match */ retVal |= (retVal & 16)? 4: 16; } else if(_fMemiCmp(MK_FP(segm, ofs), TO_FP(var), varLen) == 0) { /* case-insensitive match */ if(!retVal) firstOfs = ofs; retVal |= (retVal & 32)? 8: 32; } } ofs += env_varlen(segm, ofs); } if(!retVal) /* no match found */ DBG_RETURN_I( 2) if(!(retVal & (16 | 4))) /* no case-sensitive match -> update var */ _fmemcpy(TO_FP(var), MK_FP(segm, firstOfs), varLen); chkMem DBG_RETURN_BI( retVal & (32 | 16 | 8 | 4)) } ================================================ FILE: suppl/src/env_new.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_create su(bsystem): env ty(pe): sh(ort description): Create a new environment lo(ng description): Creates a new environment of a given length pr(erequistes): re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{0}: failure; out of memory (ENOMEM), parameter out of range (EINVAL) \item else: address of new environment fi(le): env_new.c */ #include "initsupl.loc" #include #include "environ.h" #include "suppl.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word env_create(const unsigned length) { word segm; int allocMode; DBG_ENTER("env_create", Suppl_env) DBG_ARGUMENTS( ("len=%u", length) ) chkMem if(length == 0) { eno_set(EINVAL); return 0; } switch(env_resizeCtrl & (ENV_FIRSTFIT | ENV_LASTFIT)) { case ENV_FIRSTFIT: allocMode = 0; break;/* first fit */ case ENV_LASTFIT: allocMode = 2; break;/* last fit */ default: allocMode = 1; break;/* best fit */ } DBG_ARGUMENTS( ("allocMode=%u, use UMB?=%u", allocMode, !!(env_resizeCtrl & ENV_USEUMB)) ) /* try to allocate block in the UMBs */ if(!(env_resizeCtrl & ENV_USEUMB) || (segm = allocBlk(length, allocMode | 0x40)) == 0) segm = allocBlk(length, allocMode); /* try the low memory */ chkMem if(segm) poked(segm, 0, 0); /* initialize to an unused environment */ else eno_set(ENOMEM); chkMem DBG_RETURN_U( segm) } ================================================ FILE: suppl/src/env_nost.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_nullStrings su(bsystem): env ty(pe): sh(ort description): Empty string area lo(ng description): Removes all strings from the string area of the environment. Can be called if \tok{env_check()} returned "invalid string area". pr(erequistes): re(lated to): env_strings se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \endlist integer SUPPL error code\newline \item \tok{ESUPPL_OK}: success \item \tok{ESUPPL_NOMEM}: no room to write counter \item \tok{ESUPPL_NOENV}: no environment at all fi(le): env_nost.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "errcodes.h" #include "environ.loc" #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_nullStrings(word segm) { word ofs; DBG_ENTER("env_nullStrings", Suppl_env) DBG_ARGUMENTS( ("env=%u", segm) ) chkMem unless_segm(segm) DBG_RETURN_I( ESUPPL_NOENV) DBG_ARGUMENTS( ("effective env=%u", segm) ) ofs = env_endOfVars(segm) + 1; /* offset of string counter word */ if(mcb_length(segm) - 2 <= ofs) DBG_RETURN_I( ESUPPL_NOMEM) pokew(segm, ofs, 0); chkMem DBG_RETURN_I( ESUPPL_OK) } ================================================ FILE: suppl/src/env_ovrw.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_ovrVarOffset su(bsystem): env ty(pe): L sh(ort description): Overwrite a variable lo(ng description): Overwrites the variable at a given offset in the environment.\par If \tok{\para{value} == NULL}, the variable is removed.\newline If \tok{\para{var} == NULL}, the name of the variable is kept unchanged. pr(erequistes): The offset must be point into the variable area. re(lated to): env_insVarOffset se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \endlist integer SUPPL error code\newline \item \tok{ESUPPL_OK}: success \item\tok{ESUPPL_INVENV}: corrupted environment \item\tok{ESUPPL_NOMEM}: environment too small \item\tok{ESUPPL_NOENV}: no environment at all fi(le): env_ovrw.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "errcodes.h" #include "environ.loc" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_ovrVarOffset(word segm, word ofs, const char *var , const char * const value) { int ch; int lenO, lenON, lenN, lenV, lenG; DBG_ENTER("env_ovrVarOffset", Suppl_env) DBG_ARGUMENTS( ("env=%u, ofs=%u, var=\"%s\", value=\"%s\"", segm, ofs, var, value) ) chkMem unless_segm(segm) DBG_RETURN_I( ESUPPL_NOENV) DBG_ARGUMENTS( ("effective env=%u", segm) ) if(!value) { /* delete variable */ env_subVarOffset(segm, ofs); chkMem DBG_RETURN_I( ESUPPL_OK) } lenON = 0; /* keep the length of the var name for later when the total length of the variable is checked to NOT exceed 32KB */ if(!var) { /* keep the current variable name */ /* skip until the '=' sign is found */ while((ch = peekb(segm, ofs)) != '=') { ++ofs; ++lenON; if(!ch) /* env corrupt */ DBG_RETURN_I( ESUPPL_INVENV) } var = ""; /* the name is preserved */ } /* Moved assignments before if(): Aggressive compiler optimizations may cause parts of this statement to not be calculated. -- 2000/0705 Ron Cemer */ lenO = env_varlen(segm, ofs); lenG = (lenN = strlen(var)) + (lenV = strlen(value)) + 2; if(lenG + lenON < 0 /* single var may not exceed 32KB */ || (lenO < lenG /* will consume more space */ && env_freeCount(segm) <= lenG - lenO)) /* not enough memory */ DBG_RETURN_I( ESUPPL_NOMEM) /* adjust the following variable(s) and the string area */ if(lenG != lenO) _fmemmove(MK_FP(segm, ofs + lenG), MK_FP(segm, ofs + lenO) , env_firstFree(segm) - (ofs + lenO)); chkMem if(lenN) _fmemcpy(MK_FP(segm, ofs), TO_FP(var), lenN); chkMem pokeb(segm, ofs + lenN, '='); chkMem _fmemcpy(MK_FP(segm, ofs + lenN + 1), TO_FP(value), lenV + 1); chkMem DBG_RETURN_I( ESUPPL_OK) } ================================================ FILE: suppl/src/env_repl.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_replace su(bsystem): env ty(pe): sh(ort description): Replace an environment by another one lo(ng description): Replaces or moves one environment to another one. The following modes control various features: \item\tok{ENV_DELETE}: Remove environment \para{env} on success \item\tok{ENV_COPY}: Copy the contents of the old environment into the new one. If the size of the new environment is less than the size of the old one, the contents could be destroyed. \item\tok{ENV_CLEAR}: Initialize the new environment to contain no variables and no strings. \tok{ENV_COPY} superceeds this flag. \item\tok{ENV_CREATE}: Create a new environment of the length specified as the third argument. If this flag is not set, the third parameter specifies an already created environment to be used. \item\tok{ENV_FREECOUNT}: Only applicable if \tok{ENV_CREATE} is set. The third argument specifies the amount of bytes that shall be unused in the new environment after copying the old one, if necessary. This flag is supperceeded by \tok{ENV_LIMITED}. \item\tok{ENV_LIMITED}: Only applicable if \tok{ENV_CREATE} is set. The length of the new environment is choosen as the lowest possible number. The third argument is ignored and need not to be specified at all. \nolist To duplicate an environment one can use: \example{|} |newEnv = env_replace(oldEnv? oldEnv: env_glbSeg | , ENV_CREATE | ENV_FREECOUNT | ENV_COPY, 0) or \example{|} |newEnv = env_replace(oldEnv? oldEnv: env_glbSeg | , ENV_CREATE | ENV_LIMITED | ENV_COPY) The first example creates an environment with the same size as the old one; the second one uses the smallest possible size to fit the old contents in.\newline If the \tok{?:} construct is not used to pass the old environment into the function \em{and} \tok{\para{oldEnv} == 0}, \tok{env_replace()} will also change the default segment to the newly created one. Unless the \tok{ENV_DELETE} flag is set, this could leave the old environment inaccessable within memory wasting resources. pr(erequistes): re(lated to): env_create env_delete se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): \tok{0}: on failure: errno is assigned \list \tok{ENXIO}: if no source environment could be identified \item \tok{ENOMEM}: could not allocated enough memory \item \tok{E2BIG}: destination environment exceeds 64KB \item \tok{EINVAL}: specified destination environment segment is not present \item \tok{EEXIST}: source and destination environment are equal \endlist \item else: new environment fi(le): env_repl.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "mcb.h" #include "suppl.h" #include "environ.loc" #include "fmemory.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #ifdef _MICROC_ register wor env_replace(word XOenv /*, int mode, unsigned segm/length*/) #else #include word env_replace(word Oenv, int mode, ...) #endif { unsigned env, segm; DBG_ENTER1 #define length segm #ifdef _MICROC_ unsigned Oenv, mode; env = nargs() * 2 + &XOenv; Oenv = *(unsigned *)env; mode = ((unsigned *)env)[1]; segm = ((unsigned *)env)[2]; #else { va_list ap; va_start(ap, mode); segm = va_arg(ap, unsigned); va_end(ap); } #endif DBG_ENTER2("env_replace", "env") DBG_ARGUMENTS( ("env=%u, mode=0x%x, segm/length=%u", Oenv, mode, segm) ) chkMem unless_Xsegm(env, Oenv) { eno_set(ENXIO); DBG_RETURN_U( 0) /* no source environment */ } DBG_ARGUMENTS( ("effective env=%u", env) ) if(mode & ENV_CREATE) { /* create a new environment */ if(mode & ENV_LIMITED) length = env_firstFree(env); else if(mode & ENV_FREECOUNT) { if(addu(&length, env_firstFree(env))) { eno_set(E2BIG); DBG_RETURN_U( 0) } } if((segm = env_create(length)) == 0) DBG_RETURN_U( 0) } else { /* the 3rd argument is a segment */ unless_segm(segm) { eno_set(EINVAL); DBG_RETURN_U( 0) } if(segm == env) { eno_set(EEXIST); DBG_RETURN_U( 0) } } assert(segm); assert(env); chkMem if(mode & ENV_COPY) #ifndef _MICROC_ #ifdef min #undef min #endif #define min(a,b) (((a)<(b))?(a):(b)) #endif _fmemcpy(MK_FP(segm, 0), MK_FP(env, 0) , min(mcb_length(segm), mcb_length(env))); else if(mode & ENV_CLEAR) ENV_CLEAR_SEGM(segm); /* the first 3 bytes must be zero */ chkMem /* Update other global references by the new segment. If DELETE is enabled, delete() won't find the old references anymore, thus, keeps the new segments in those references */ if(!Oenv) env_relocateSegment(env, segm); chkMem if(mode & ENV_DELETE) env_delete(env); chkMem DBG_RETURN_U( segm) } ================================================ FILE: suppl/src/env_rlsg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_relocateSegment su(bsystem): env ty(pe): sh(ort description): Update relocated environment segments lo(ng description): Updates other global variables, such as \tok{env_glbSeg} and \tok{env_dfltSeg}, that a segment has been changed. Deleted segments are called with \tok{tosegm == 0}. pr(erequistes): segm != 0 re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): va(lue): none fi(le): env_del.c */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "environ.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void env_relocateSegment(const word segm, const word tosegm) { DBG_ENTER("env_relocateSegment", Suppl_env) DBG_ARGUMENTS( ("env=%u to=%u", segm, tosegm) ) assert(segm); /* Make sure the deleted segment won't be referenced */ if(segm == env_glbSeg) { env_setGlbSeg(tosegm); DBG_INFO(("Change global segment: %04x -> %04x", segm, tosegm)) } if(segm == env_dfltSeg) { env_setDfltSeg(tosegm); DBG_INFO(("Change default segment: %04x -> %04x", segm, tosegm)) } DBG_EXIT } ================================================ FILE: suppl/src/env_scnt.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_stringcounter su(bsystem): env ty(pe): sy(nopsis): sh(ort description): Modify and return the counter of environment strings he(ader files): lo(ng description): Adds \para{diff} to the current number of environment strings and return the result. pr(erequistes): va(lue): 0: No environment (ENXIO) or no string (EZERO)\item else: Number of strings re(lated to): env_string se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "environ.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int env_strcounter(word segm, int diff) { word cntOfs; DBG_ENTER("env_strcounter", Suppl_env) DBG_ARGUMENTS( ("env=%u, diff=%d", segm, diff) ) chkMem unless_segm(segm) { eno_set(ENXIO); DBG_RETURN_I( 0) } DBG_ARGUMENTS( ("effective env=%u", segm) ) diff += peekw(segm, cntOfs = env_endOfVars(segm) + 1); if(!diff) eno_set(EZERO); pokew(segm, cntOfs, diff); DBG_RETURN_U( diff) } ================================================ FILE: suppl/src/env_sdup.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_strdup su(bsystem): env ty(pe): H sy(nopsis): sh(ort description): Duplicate an environment string into the heap he(ader files): lo(ng description): Duplicates an environment string into the heap. The string must be deallocated by the user. pr(erequistes): va(lue): \tok{NULL}: on failure; errno is assigned \list \tok{ENXIO}: no environment found \tok{ENOENT}: no such string (string number too high) \tok{ENOMEM}: out of memory \endlist \item else: pointer to allocated string re(lated to): env_string se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #include #endif #include "environ.loc" #include "fmemory.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *env_strdup(word segm, const int index) { char *buf; word ofs; unsigned length; DBG_ENTER("env_strdup", Suppl_env) DBG_ARGUMENTS( ("env=%u, idx=%d", segm, index) ) chkMem unless_segm(segm) { eno_set(ENXIO); DBG_RETURN_S( 0) /* no environment at all */ } DBG_ARGUMENTS( ("effective env=%u", segm) ) if((ofs = env_string(segm, index)) == 0 || ofs == env_firstFree(segm)) { eno_set(ENOENT); DBG_RETURN_S( 0) /* string number too high */ } chkHeap if((buf = eno_malloc(length = env_varlen(segm, ofs))) != 0) _fmemcpy(TO_FP(buf), MK_FP(segm, ofs), length); chkHeap DBG_RETURN_S( buf) } ================================================ FILE: suppl/src/env_size.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_resize su(bsystem): env ty(pe): sy(nopsis): sh(ort description): Resize an environment he(ader files): lo(ng description): Resizes an environment by the amount of bytes specified via \para{delta}. The contents is retained, except if the environment shrinks below the last used byte.\par If \tok{\para{delta} == 0}, the length of the environment is returned rather than its address. The environment itself remains unchanged.\par If the block shrinks below the currently first free byte limit or the block must be moved, the global variable \tok{env_resizeCtrl} controls various special modes.\par If the block is resized below the first free byte limit, the contents of the environment is most probably destroyed and should be totally cleared before it is used. pr(erequistes): va(lue): 0: on failure; out-of-memory (ENOMEM), if EZERO, \tok{\para{delta} == 0} and the length of the source environment is zero \item else: if \tok{\para{delta} == 0}, the size of the environment segment; otherwise the possibly new segment address of the environment re(lated to): env_resizeCtrl env_setsize se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): ob(ject): env_setsize su(bsystem): env ty(pe): sy(nopsis): sh(ort description): Set the size of an environment he(ader files): lo(ng description): Resizes an environment to the amount of bytes specified via \para{newLength}. The contents is retained, except if the environment shrinks below the last used byte.\par If \tok{\para{newLength} == 0}, the environment segment is deallocated.\par See \tok{env_resize} for more information. pr(erequistes): va(lue): 0: on out-of-memory (ENOMEM) or environment was deleted (EZERO)\item else: the possibly new segment address of the environment re(lated to): env_resizeCtrl env_resize se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "environ.loc" #include "mcb.h" #include "suppl.h" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word env_setsize(word Osegm, unsigned newLength) { unsigned segm, length; DBG_ENTER("env_setsize", Suppl_env) DBG_ARGUMENTS( ("env=%u, new length=%u", Osegm, newLength) ) chkMem if(newLength == 0) { /* remove segment */ env_delete(Osegm); eno_set(EZERO); DBG_RETURN_I( 0) } env_Xsegm(segm, Osegm); length = mcb_length(segm); /* returns 0 on segm == 0 */ DBG_ARGUMENTS( ("effective env=%u, cur len=%u", segm, length) ) if(length > newLength) { /* shrink the block */ /* Because length > newLength > 0 --> segm != 0 */ DBG_STRING("Shrink block") length = env_firstFree(segm); resizeBlk(segm, (length > newLength && !(env_resizeCtrl & ENV_SHRINKBELOW)) ? length /* don't shrink below last used byte */ : newLength); /* shrinking cannot fail --> ignore return value */ } else if(length != newLength) { if(segm) { DBG_STRING("Grow block") if(resizeBlk(segm, newLength)) { /* Grow failed --> try to allocate a new block */ if(!(env_resizeCtrl & ENV_ALLOWMOVE)) { /* fail as to allocate is not allowed */ eno_set(ENOMEM); DBG_RETURN_U(0) } segm = env_replace(Osegm , ENV_DELETE | ENV_COPY | ENV_CREATE, newLength); /* On success, the replace() function already updates glbSeg or dfltSeg if applicable */ } } else { DBG_STRING("Create new environment") if((segm = env_create(newLength)) != 0) { /* This point is reached only, if setsize() has been called with Osegm == dlftSeg == glbSeg == 0. Therefore it is assumed that the global segment is to be set */ env_setGlbSeg(segm); DBG_INFO(("New global environment: %04x", segm)) } } } chkMem DBG_RETURN_U( segm) /* return the segment address */ } word env_resize(word segm, int delta) { unsigned length; DBG_ENTER("env_resize", Suppl_env) DBG_ARGUMENTS( ("env=%u, delta=%d", segm, delta) ) length = mcb_length(env_segment(segm)); if(delta == 0) { /* it's a request of the current length */ eno_set(EZERO); DBG_RETURN_U( length) } /* honor the arethmetic (int) warp in the expressions */ if(delta < 0) /* shrink block */ DBG_RETURN_BU( env_setsize(segm, length <= -delta? 0: length + delta)) /* grow block */ DBG_RETURN_BU( env_setsize(segm , inM(65535, 65535U) - length < (unsigned)delta? inM(65535, 65535U) : length + (unsigned)delta)) } ================================================ FILE: suppl/src/env_strg.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_string su(bsystem): env ty(pe): sy(nopsis): sh(ort description): Return the address of an environment string he(ader files): lo(ng description): Returns the offset of a string into the specified environment.\par If \tok{index == env_strings()}, the first unused byte behind the last string is returned. pr(erequistes): va(lue): 0: on failure; index too large (ENOENT) or no environment (ENXIO) \item else: offset of string re(lated to): env_stringcounter se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "environ.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word env_string(word segm, int index) { word ofs; DBG_ENTER("env_string", Suppl_env) DBG_ARGUMENTS( ("env=%u, idx=%d", segm, index) ) chkMem unless_segm(segm) { eno_set(ENXIO); DBG_RETURN_I( 0) } DBG_ARGUMENTS( ("effective env=%u", segm) ) /* the string number "index" maybe equal to the number of strings, in which case the proper position of a new string is to be returned. */ if(peekw(segm, ofs = 1 + env_endOfVars(segm)) < index) { eno_set(ENOENT); DBG_RETURN_I( 0) /* string number too high */ } ofs += 2; /* 1st string */ while(index--) /* skip current string */ ofs += env_varlen(segm, ofs); DBG_RETURN_I( ofs) } ================================================ FILE: suppl/src/env_sub.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_subVarOffset su(bsystem): env ty(pe): sy(nopsis): sh(ort description): Remove an environment variable he(ader files): lo(ng description): Removes the environment variable at a specified offset pr(erequistes): \tok{\para{segm} != 0} \item \para{offset} must point into the variables area of the environment va(lue): none re(lated to): env_insVarOffset env_ovrVarOffset env_change se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "environ.h" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void env_subVarOffset(word segm, word offset) { register unsigned moveStart; DBG_ENTER("env_subVarOffset", Suppl_env) DBG_ARGUMENTS( ("env=%u, ofs=%u", segm, offset) ) chkMem assert(segm); assert(offset < env_endOfVars(segm)); moveStart = offset + env_varlen(segm, offset); _fmemmove(MK_FP(segm, offset), MK_FP(segm, moveStart), env_firstFree(segm) - moveStart); chkMem DBG_EXIT } ================================================ FILE: suppl/src/env_var1.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): env_resizeCtrl su(bsystem): ty(pe): sy(nopsis): sh(ort description): Controls how the \subsys{env} internally works he(ader files): lo(ng description): This variable contains a \tok{'|'} combination of the following macros, defined in ENVIRON.H: \item \tok{ENV_SHRINKBELOW}: allows to resize the environment segment below its last used byte (will destroy environment, is necessary to delete env) \item \tok{ENV_ALLOWMOVE}: allows to relocate environment segment if to grow it fails (meaning to move it into another memory segment) \item \tok{ENV_USEUMB}: when the environment segment is relocated, search in the UMBs first \item \tok{ENV_FIRSTFIT}: when the environment segment is relocated, use the memory allocation strategy \em{First Fit} \item \tok{ENV_LASTFIT}: when the environment segment is relocated, use the memory allocation strategy \em{Last Fit} \item If both \tok{ENV_FIRSTFIT} and \tok{ENV_LASTFIT} are set, the behaviour is undefined \item If neither \tok{ENV_FIRSTFIT} nor \tok{ENV_LASTFIT} are set, \em{Best Fit} is used \nolist The default settings are: deny shrinking & moving, use UMBs, best fit pr(erequistes): va(lue): none re(lated to): env_resize env_setsize se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static; may be changes any time by the user directly wa(rning): bu(gs): */ #include "initsupl.loc" #include "environ.h" unsigned env_resizeCtrl = ENV_USEUMB; /* control flags */ ================================================ FILE: suppl/src/env_var2.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): suppl_dfltEnvSegm su(bsystem): ty(pe): sy(nopsis): sh(ort description): default environment for SUPPL he(ader files): lo(ng description): All functions of \subsys{env}, that accept a \tok{0] as environment segment, first use \tok{env_dfltSeg} first, \tok{env_glbSeg} then. The variable \tok{suppl_dfltEnvSegm} contains the value read by \tok{env_dfltSeg} and written by \tok{env_setDfltSeg}. This variable is also automatically updated by functions, that delete or relocate an environment segments.\par default: \tok{0} pr(erequistes): va(lue): none re(lated to): env_dfltSeg env_setDfltSeg se(condary subsystems): xr(ef): im(port): fi(le): in(itialized by): static; may be changes any time by the user directly wa(rning): bu(gs): */ #include "initsupl.loc" #include "environ.h" word suppl_dfltEnvSegm = 0; ================================================ FILE: suppl/src/environ.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Environment functions. Internal header file. */ #ifndef __ENVIRON_LOC #define __ENVIRON_LOC #include #include "environ.h" /* env_segm(segm) <-> segm := segm || env_dfltSeg || env_glbSeg Assigns & returns the target environment segment of variable segm */ #define env_segment(segm) ((segm)? (segm) \ : env_dfltSeg? env_dfltSeg \ : env_glbSeg) #define env_segm(segm) ((segm) = env_segment((segm))) /* if-no-environment-segment macro */ #define unless_segm(segm) if(!(segm) \ && ((segm) = env_dfltSeg) == 0 \ && ((segm) = env_glbSeg) == 0) /* The Xsegm variants take the initial value of segm as a second parameter */ #define env_Xsegm(segm,orgSeg) ((segm) = env_segment(orgSeg)) /* if-no-environment-segment macro */ #define unless_Xsegm(segm,orgSeg) if(((segm) = (orgSeg)) == 0 \ && ((segm) = env_dfltSeg) == 0 \ && ((segm) = env_glbSeg) == 0) #define ENV_CLEAR_SEGM(segm) poked((segm), 0, 0) #endif ================================================ FILE: suppl/src/erfc_00f.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* DON'T MODIFY THIS FILE! This is an auto-generated file (by mkerrfct.pl), don't modify because next time the script runs, your modifications are lost. Defines one of the default error functions. */ #include "msgs.loc" #include "msgs.lng" void Esuppl_noMem(void) { error0(E_noMem); } ================================================ FILE: suppl/src/erfc_015.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* DON'T MODIFY THIS FILE! This is an auto-generated file (by mkerrfct.pl), don't modify because next time the script runs, your modifications are lost. Defines one of the default error functions. */ #include "msgs.loc" #include "msgs.lng" void Esuppl_openFile(const char * const fnam) { error(E_openFile, fnam); } ================================================ FILE: suppl/src/ffmaxbuf.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Fmaxbuf su(bsystem): supplio ty(pe): H sh(ort description): Allocate a large chunk of memory pr(erequistes): buf != NULL && len != NULL va(lue): \tok{0}: on success; \tok{*buf} := pointer to dynamically allocated buffer, \tok{*len} := length of the buffer \item else: on failure re(lated to): se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "supplio.loc" #include "eno.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int Fmaxbuf(byte ** const Xbuf, size_t * const Xlen) { byte *buf; size_t len; DBG_ENTER("Fmaxbuf", Suppl_supplio) assert(Xbuf); assert(Xlen); len = 32 * 1024u; /* try to allocate 32KB */ chkHeap while((buf = malloc(len)) == 0) if((len >>= 1) < 16) { eno_set(ENOMEM); DBG_RETURN_I( 1) /* out of memory */ } *Xbuf = buf; *Xlen = len; chkHeap DBG_RETURN_VALUES( ("buf=%p, len=%u", buf, len) ) DBG_RETURN_I( 0) } ================================================ FILE: suppl/src/fgetpos.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): fgetpos su(bsystem): portable ty(pe): S sh(ort description): ISO9899 compatible \tok{fgetpos()} function lo: ISO9899 compatible \tok{fgetpos()} function to aquire the current stream position into a \tok{(fpos_t)} structure. pr(erequistes): stream != NULL && pos != NULL va(lue): 0: on succes\item else: on failure re(lated to): fsetpos FFgetpos se(condary subsystems): supplio in(itialized by): wa(rning): bu(gs): co(mpilers): Pacific HiTech C only */ #include "initsupl.loc" #ifdef _PAC_NOCLIB_ #include "supplio.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int fgetpos(FILE * const stream, fpos_t * const pos) { long p; /* The description of ftell() suggests that this function never fails?! */ if((p = ftell(stream)) == -1l) return 1; *pos = p; return 0; } #endif ================================================ FILE: suppl/src/file_id.diz ================================================ This package contains: SUPPL a supplemental library written by Copyright (C) 1995-98 Steffen Kaiser Release Version 2.7 Also included are: - a patched version of DMAKE v4.00 - the utilities: RM, MSGCOMP, _XSET, FOREACH ================================================ FILE: suppl/src/filefind.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile: FILEFIND.C $ $Locker: ska $ $Name: $ $State: Exp $ ob(ject): findfirst su(bsystem): portable ty(pe): sh(ort description): Initiate a file search loop lo(ng description): Initiates a file search loop.\par This function returns the first entry matching the specified pattern within a directory and initializes the structure \para{ff} that subsequent calls to \tok{findnext()} will enumerate all entries matching the pattern. \example{|} |struct ffblk ff; |int done; | |done = findfirst(pattern, aF(ff), attributes); |while(!done) { | // do something with the values of the structure ff | done = findnext(aF(ff)); |} pr(erequistes): ff != NULL && pattern != NULL va(lue): 0: on success\item else: OS error code (usually interpreted as "no more matching entries") re(lated to): findnext se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): Pacific HiTech C only ob(ject): findnext su(bsystem): portable ty(pe): sh(ort description): Continue a directory enumeration loop lo(ng description): Continues a directory enumeration loop; for more details see function \tok{findfirst()}. pr(erequistes): ff != NULL va(lue): 0: on success\item else: OS error code (usually interpreted as "no more matching entries") re(lated to): findfirst se(condary subsystems): in(itialized by): findfirst wa(rning): bu(gs): co(mpilers): Pacific HiTech C only */ #include "initsupl.loc" #if defined(_PAC_NOCLIB_) || defined(__GNUC__) #include "suppl.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id: FILEFIND.C 1.5 1999/12/13 02:23:13 ska Exp ska $"; #endif int findfirst(const char * const pattern, struct ffblk *ff, int attrib) { void far *dta; IREGS r; int rv; /* DOS uses the DTA to store the internal search data to. The usual implementation of find*() keeps the first 21 bytes of the DTA or simply hope that no DOS will use more than 21 byte and point the DTA directly on the search data buffer. */ dta = getdta(); setdta((void far*)ff); r.r_dx = FP_OFF(pattern); r.r_ds = FP_SEG(pattern); r.r_cx = attrib; r.r_ax = 0x4e00; rv = invokeDOS(&r); setdta(dta); return rv; } int findnext(struct ffblk *ff) { void far *dta; IREGS r; int rv; dta = getdta(); setdta((void far*)ff); r.r_ax = 0x4f00; rv = invokeDOS(&r); setdta(dta); return rv; } #endif ================================================ FILE: suppl/src/fmemchr.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fmemchr su(bsystem): farmem ty(pe): sy(nopsis): sh(ort description): Search a far string for a character he(ader files): pr(erequistes): pointer must not be \tok{NULL} va(lue): 0: value not found\item else: offset of first occurence of character re(lated to): se(condary subsystems): portable xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): If \tok{offset == 0} and the character is located at the first position of the string, \tok{0} is returned, too. co(mpilers): Micro-C only */ #include "initsupl.loc" #ifdef _MICROC_ #include unsigned _fmemchr(unsigned const seg, unsigned ofs, const unsigned value, unsigned length) { unsigned char v, i; while(v = value; length--;) if(peekb(seg, ofs) == v) return ofs; else if(!++ofs) break; return 0; } #else #if defined(_TC_EARLY_) #include #include "fmemory.h" char far *_fmemchr(const char far* const s, int ch, unsigned length) { const byte far *p; for(p = (const byte far*)s; length--; ++p) if(*p == ch) return (char far*)p; return 0; } #endif #endif ================================================ FILE: suppl/src/fmemcmp.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fmemcmp su(bsystem): farmem ty(pe): sy(nopsis): sh(ort description): Compare two far memory areas he(ader files): pr(erequistes): pointers must not be equal to \tok{NULL} va(lue): \tok{== 0}: both areas are equal \item \tok{> 0}: 1st area > 2nd area \item \tok{< 0}: 1st area < 2nd area re(lated to): memcmp _fmemicmp se(condary subsystems): portable xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): Micro-C and Pacific HiTech C */ #include "initsupl.loc" #ifdef _MICROC_ #include int _fmemcmp(unsigned const dseg, unsigned dofs , unsigned const sseg, unsigned sofs, unsigned length) { int d; if(!length) return 0; while((d = peekb(dseg, dofs++) - peekb(sseg, sofs++)) == 0 && --length); return d; } #else #if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) #include #include "fmemory.h" int _fmemcmp(const void far * const s1, const void far * const s2 , unsigned length) { const byte far *p; const byte far *q; int d; if(!length) return 0; p = s1; q = s2; while((d = *p++ - *q++) == 0 && --length); return d; } #endif #endif ================================================ FILE: suppl/src/fmemcpy.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fmemcpy su(bsystem): farmem ty(pe): sy(nopsis): sh(ort description): Copy a far memory areas onto another lo: Copies one far memory area onto another one, the destination area must be at least \para{length} bytes long.\par If both areas overlap themselves, the behaviour is undefined. he(ader files): pr(erequistes): pointers must not be equal to \tok{NULL} va(lue): none re(lated to): memcpy _fmemmove se(condary subsystems): portable xr(ef): im(port): fi(le): in(itialized by): wa(rning): Both areas must not overlap each other. bu(gs): co(mpilers): Micro-C only */ #include "initsupl.loc" #ifdef _MICROC_ #include void _fmemcpy(unsigned const dseg, unsigned const dofs , unsigned const sseg, unsigned const sofs, unsigned length) { copy_seg(dseg, dofs, sseg, sofs, length); } #else #if defined(_TC_EARLY_) #include #include "fmemory.h" void far *_fmemcpy(void far * const s1, const void far * const s2, unsigned length) { byte far*p; const byte far*q; if(length) { p = s1; q = s2; do *p++ = *q++; while(--length); } return s1; } #endif #endif ================================================ FILE: suppl/src/fmemory.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Set up the compiler depend macros for far memory subsystem */ #ifdef COMPILE #undef COMPILE #endif #ifdef _MICROC_ #define COMPILE #define fargDecl(type,name) unsigned name/**/_segm, unsigned name/**/_ofs #define fargPass(name) name/**/_segm, name/**/_ofs #endif #if defined(_TC_EARLY_) #define COMPILE #define fargDecl(type,name) type far * const name #define fargPass(name) name #endif #ifdef COMPILE #include #include "fmemory.h" /* Don't create a new function as the "+1" is just one byte normally. This function has to be called lots of time to save more of these single bytes than a new function actually would cost */ #define _fstrlen1(name) (_fstrlen(fargPass(name)) + 1) #define COMPILE #endif ================================================ FILE: suppl/src/fmemove.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fmemmove su(bsystem): farmem ty(pe): sy(nopsis): sh(ort description): Copy a far memory areas onto another lo: Copies one far memory area onto another one, the destination area must be at least \para{length} bytes long. Both areas may overlap themselves. he(ader files): pr(erequistes): pointers must not be equal to \tok{NULL} va(lue): none re(lated to): memmove _fmemcpy se(condary subsystems): portable xr(ef): im(port): fi(le): in(itialized by): wa(rning): bu(gs): co(mpilers): Micro-C and Pacific HiTech C */ #include "initsupl.loc" #ifdef _MICROC_ #include #include "fmemory.h" void _fmemmove(unsigned dseg, unsigned dofs , unsigned sseg, unsigned sofs, unsigned length) { unsigned seg, ofs; if(!length) return; /* 1st: normalize pointers for compare */ _fnormalize(dseg, dofs); _fnormalize(sseg, sofs); if(sseg == dseg && sofs == dofs) return; seg = sseg; /* end of source area */ ofs = sofs + length; _fnormalize(seg, ofs); /* 2nd: check, if the areas overlap and if this matters at all */ /* Bad results will occur, if sseg:sofs < dseg:dofs < seg:ofs */ if(_fcompare(sseg, sofs, dseg, dofs) < 0 && _fcompare(dseg, dofs, seg, ofs) <= 0) { /* perform manually */ dofs += length; /* both point behind the areas now */ sofs += length; do pokeb(dseg, --dofs, peekb(sseg, --sofs)); while(--length); } else _fmemcpy(dseg, dofs, sseg, sofs, length); } #else #if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) #include #include "fmemory.h" void far *_fmemmove(void far * const s1, const void far * const s2 , unsigned length) { byte far *p; byte far *q; byte far *h; if(!length) return s1; p = _fnormalize(s1); q = _fnormalize((void far*)s2); h = _fnormalize(q + length); /* Cases: p == q --> nothing to do no overlapping areas --> call _fmemcpy() p < q && overlapping --> ..ABCDE 1234 If the string ABCDE is copied from the beginning one-by-one over 1234, the result is OK. --> call _fmemcpy() p > q && overlapping --> ABCDE ..1234 If now one starts from the beginning of ABCDE, the 'A' will overwrite the position of '1', which is also 'E' --- but 'E' would be copied later another time. --> copy backwardly */ if(p == q) return s1; /* * without the typecasts TC++1 ignores the segment portions completely */ #ifdef __GNUC__ if(p > q && p <= h) { #else if((char huge*)p > (char huge*)q && (char huge*)p <= (char huge*)h) { #endif /* overlapping areas */ p += length; q += length; do *--p = *--q; while(--length); } else { _fmemcpy(s1, s2, length); } return s1; } #endif #endif ================================================ FILE: suppl/src/fnorm.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fnormalize su(bsystem): farmem ty(pe): sh(ort description): Normalize a far memory pointer lo(ng description): Normalizes a far memory pointer. A normalized pointer has an offset smaller than 16. pr(erequistes): va(lue): none: Micro-C \item normalize far pointer: Pacific HiTech C re(lated to): _fcompare se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): Micro-C and Pacific HiTech C */ #include "initsupl.loc" #ifdef _MICROC_ #include void _fnormalize_(unsigned *seg, unsigned *ofs) { *seg += *ofs >> 4; *ofs &= 0xf; } #else #include #include void far *_fnormalize(void far *poi) { return MK_FP(FP_SEG(poi) + (FP_OFF(poi) >> 4), FP_OFF(poi) & 0xF); } #endif ================================================ FILE: suppl/src/fputmc.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): fputmc su(bsystem): supplio ty(pe): sh(ort description): Dump the same character multiple times lo(ng description): Writes the same character multiple times into the stream.\par If \tok{cnt == 0}, nothing happens. pr(erequistes): f != NULL va(lue): \para{ch}: on success\item \tok{EOF}: on failure re(lated to): putc se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #include #include #include "suppldbg.h" #ifdef SUPPL_LOG_FUNCTION #include #endif #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int fputmc(int ch, int cnt, FILE *f) { int i; char buf[80]; DBG_ENTER("fputmc", Suppl_supplio) assert(f); DBG_ARGUMENTS( ("ch='%c' (0x%02x), cnt=%u", isprint(ch)? ch: ' ', ch & 0xff, cnt) ) if(!cnt) DBG_RETURN_I( ch) i = sizeof(buf)-1; if (cnt < sizeof(buf)-1) i = cnt; memset(buf, ch, i); buf[i] = '\0'; while(cnt > 0) { if(fprintf(f, "%s", buf) == EOF) DBG_RETURN_I( EOF) cnt -= sizeof(buf)-1; if (cnt < sizeof(buf)-1) buf[cnt] = '\0'; } DBG_RETURN_I( ch) } ================================================ FILE: suppl/src/fstrcpy.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fstrcpy su(bsystem): farmem ty(pe): sh(ort description): Copy a far string onto another lo(ng description): Copies a far string onto another one. The destination string must have at least \tok{_fstrlen()+1} bytes in size. pr(erequistes): pointers must not be \tok{NULL} va(lue): none re(lated to): strcpy se(condary subsystems): portable in(itialized by): wa(rning): bu(gs): co(mpilers): Micro-C only */ #include "initsupl.loc" #include "fmemory.loc" #ifdef COMPILE void _fstrcpy(fargDecl(char, dst), fargDecl(const char, src)) { _fmemcpy(fargPass(dst), fargPass(src), _fstrlen1(src)); } #endif ================================================ FILE: suppl/src/fstrdup.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fdupstr su(bsystem): farmem ty(pe): sh(ort description): Duplicate a far string into local heap lo(ng description): Duplicates the far string into the local, usually near heap pr(erequistes): the source pointer must not be \tok{NULL} va(lue): NULL: on failure\item else: pointer to the string in the heap re(lated to): strdup se(condary subsystems): portable in(itialized by): wa(rning): This function cannot be named \tok{_fstrdup}, because this would interfere with the implementation of string functions of compilers supporting far poiners and a far heap. bu(gs): co(mpilers): */ #include "initsupl.loc" #ifdef _MICROC_ #include #include "dynstr.h" #include "fmemory.h" #include "suppldbg.h" char *_fdupstr(unsigned const segm, unsigned const ofs) { size_t len; char *p; if(!(p = malloc(len = _fstrlen(MK_FP(segm, ofs)) + 1))) return 0; copy_seg(TO_FP(p), segm, ofs, len); return p; } #else #include #include #include #include "fmemory.h" #include "suppldbg.h" char *_fdupstr(const char far * const s) { size_t len; char *p; chkHeap if((p = malloc(len = _fstrlen(s) + 1)) == 0) return 0; _fmemcpy(TO_FP(p), s, len); chkHeap return p; } #endif ================================================ FILE: suppl/src/fstrlen.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): _fstrlen su(bsystem): farmem ty(pe): sh(ort description): Return the length of a far string pr(erequistes): the pointer must not be \tok{NULL} va(lue): length of far string re(lated to): strlen se(condary subsystems): portable in(itialized by): wa(rning): bu(gs): co(mpilers): Micro-C only */ #include "initsupl.loc" #ifdef _MICROC_ #include unsigned _fstrlen(unsigned const seg, unsigned const ofs) { unsigned p; for(p = ofs; peekb(seg, p); ++p); return p - ofs; } #else #if defined(_TC_EARLY_) #include #include #include "fmemory.h" unsigned _fstrlen(const char far * const s) { const byte far *p = (const byte far*)s; while (*p++); assert((p - (const byte far*)s) <= 0x10000l); return (unsigned)(p - (const byte far*)s) - 1; } #endif #endif ================================================ FILE: suppl/src/gm_chgm.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Erealloc su(bsystem): error ty(pe): 0H sh(ort description): Reallocate a chunk of memory lo(ng description): Reallocate a dynamically allocated chunk of memory.\par If \tok{poi == NULL}, a new block is allocated.\newline If \tok{len == 0}, the block is deallocated.\newline If \tok{poi == NULL && len == 0}, the behaviour is undefined.\par On failure, the program is terminated with the error message: "Out of memory". pr(erequistes): va(lue): pointer to reallocated chunk re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #ifndef _MICROC_ #include #include #endif /*# !defined(_MICROC_) */ #include #include "msgs.h" #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif /*# defined(RCS_Version) */ /* * Reallocate a chunk of memory and terminate the application on failure */ void *Erealloc(void *p1, size_t size) { void *p; DBG_ENTER("Erealloc", Suppl_error) DBG_ARGUMENTS( ("poi=%p, new_len=%u", p1, size) ) chkHeap if((p = realloc(p1, size)) == 0 && size) Esuppl_noMem(); chkHeap DBG_RETURN_P( p) } ================================================ FILE: suppl/src/gm_dup.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Estrdup su(bsystem): error ty(pe): 0H sh(ort description): Duplicate a string into heap lo(ng description): Duplicates a string into the heap.\par If \tok{s == NULL}, \tok{NULL} is returned.\newline On failure, the program is terminated with the error message: "Out of memory". pr(erequistes): va(lue): NULL: if \tok{s == NULL}\item else: pointer to duplicated string re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #ifndef _MICROC_ #include #include #endif /*# !defined(_MICROC_) */ #include #include "msgs.h" #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif /*# defined(RCS_Version) */ /* * Duplicate a string into the local heap. * On failure: Terminate with an error message */ char *Estrdup(const char * const str) { char *h; DBG_ENTER("Estrdup", Suppl_error) if(!str) DBG_RETURN_S( 0) DBG_ARGUMENTS( ("str=\"%s\"", str) ) chkHeap if((h = strdup(str)) == 0) Esuppl_noMem(); chkHeap DBG_RETURN_S( h) } ================================================ FILE: suppl/src/gm_gtmem.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Emalloc su(bsystem): error ty(pe): 0H sh(ort description): Allocate a chunk of memory lo(ng description): Allocates a new chunk of memory from the heap.\par If \tok{size == 0}, the behaviour is undefined.\newline On failure, the program is terminated with the error message: "Out of memory". pr(erequistes): va(lue): pointer to newly allocated memory re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #ifndef _MICROC_ #include #include #endif /*# !defined(_MICROC_) */ #include #include "msgs.h" #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif /*# defined(RCS_Version) */ /* * Allocate a chunk of memory * On failure: Terminate with an error message */ void *Emalloc(size_t size) { byte *h; DBG_ENTER("Emalloc", Suppl_error) DBG_ARGUMENTS( ("len=%u", size) ) chkHeap if((h = malloc(size)) == 0) Esuppl_noMem(); chkHeap DBG_RETURN_P( h) } ================================================ FILE: suppl/src/gm_res.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): Eresize su(bsystem): error ty(pe): 0H_ sh(ort description): Resize a chunk of dynamic memory lo(ng description): Resizes a chunk of dynamic memory.\par If \tok{*poi == NULL}, a new chunk is allocated.\newline If \tok{len == 0}, the chunk is deallocated On failure, the program is terminated with the error message: "Out of memory". pr(erequistes): \tok{poi != NULL} and \tok{*poi} must be either \tok{NULL} or a chunk of dynamic memory or a dynamic string va(lue): pointer to reallocated memory \tok{*poi} re(lated to): se(condary subsystems): dynstr in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include #include "dynstr.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif void *Eresize_(void ** const poi, size_t len) { DBG_ENTER("Eresize", Suppl_error) assert(poi); DBG_ARGUMENTS( ("*poi=%p, new_len=%u", *poi, len) ) chkHeap DBG_RETURN_BP( *poi = Erealloc(*poi, len)) } ================================================ FILE: suppl/src/initsupl.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Set up the compiler depend macros -and- Set up SUPPL global macros */ #include "supl_def.h" /* Identify to compile a SUPPL file */ #define _SUPPL_ #if 0 /* Add the RCS ID into the files */ #ifndef NDEBUG #define RCS_Version #endif #endif /* * Debug settings * Note: Debugging is globally turned off when the NDEBUG macro is * defined, which causes to nullify assert()'s, too. * See SUPPLDBG.H for more details. */ /* Enable all debug/logging features of SUPPL */ /* #define SUPPL_DBG_ALL */ #define SUPPL_DBG_HEAP #define SUPPL_DBG_MEMORY /* #define SUPPL_LOG_MEMORY */ #define SUPPL_LOG_FUNCTION /* Prevent possible program crashes: If the logfiles are closed rather than just flushed, the possibility that the data is really commited to disk instead of kept in memory (BUFFERs) is much higher; the disadvantage is that the logfiles are opened and closed for each line individually, what makes logging a very time-consuming action. FLUSH is a weaker method, but less time-consuming. CLOSE superceeds FLUSH. */ #define DBG_ALWAYS_CLOSELOG /* #define DBG_ALWAYS_FLUSHLOG */ /* #define SYSLOG_ALWAYS_FLUSHLOG */ /* Mark all files of this library as part of it */ #define DBG_LIBRARY Suppl_SUPPL ================================================ FILE: suppl/src/intr.asm ================================================ ; File: ; intr.asm ; Description: ; Assembly implementation of calling an interrupt ; ; Copyright (c) 2000 ; Steffen Kaiser ; All Rights Reserved ; ; This file is part of FreeDOS. ; ; FreeDOS is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version ; 2, or (at your option) any later version. ; ; DOS-C is distributed in the hope that it will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ; the GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public ; License along with DOS-C; see the file COPYING. If not, ; write to the Free Software Foundation, Inc., ; 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ; %include "model.inc" %ifidn __OUTPUT_FORMAT__, elf ; only for ia16-elf-gcc compilations %define COMPILE 1 segment .text bits 16 global intrf global _intrf intrf: _intrf: %elifidni COMPILER, WATCOM ; and Open Watcom %define COMPILE 1 segment _TEXT global intrf_ global _intrf_ intrf_: _intrf_: %endif %ifdef COMPILE push bp ; Standard C entry %ifidn __OUTPUT_FORMAT__, elf push es ; gcc-ia16 has es caller-saved %endif push bx push cx mov bx, dx push dx push si push di push ds mov [cs:intr_1-1], al jmp short intr_2 ; flush the instruction cache intr_2: mov ah, [bx+18] ; SZAPC flags sahf mov ax, [bx] mov cx, [bx+4] mov dx, [bx+6] mov bp, [bx+8] mov si, [bx+10] mov di, [bx+12] push word [bx+14] ; ds mov es, [bx+16] mov bx, [bx+2] pop ds int 0 intr_1: pushf push ds push bx mov bx, sp mov ds, [ss:bx+6] mov bx, [ss:bx+12] ; address of REGPACK mov [bx], ax pop word [bx+2] mov [bx+4], cx mov [bx+6], dx mov [bx+8], bp mov [bx+10], si mov [bx+12], di pop word [bx+14] mov [bx+16], es pop word [bx+18] pop ds pop di pop si pop dx pop cx pop bx %ifidn __OUTPUT_FORMAT__, elf pop es %endif pop bp ret ; retf/retn model specific, see model.inc %endif ================================================ FILE: suppl/src/invokedo.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile: INVOKEDO.C $ $Locker: ska $ $Name: $ $State: Exp $ ob(ject): invokeDOS su(bsystem): portable ty(pe): sh(ort description): Call the DOS system API lo(ng description): Calls the DOS system API interrupt 0x21. The initial register values passed to the system are read from the \tok{IREGS} structure \para{prp}. On exit, the register values are dumped into the same structure overwriting the passed-in values. pr(erequistes): prp != NULL va(lue): 0: Carry flag was clear on return\item else: AX register, if Carry flag was set. Most DOS functions use the Carry flag to indicate an error condition and return the error number in the register AX, please consult a DOS system API reference, such as Ralf Brown's interrupt list, for more details. re(lated to): IREGS se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "suppl.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id: INVOKEDO.C 1.9 1999/12/13 02:23:22 ska Exp ska $"; #endif int invokeDOS(IREGS *prp) { DBG_ENTER("invokeDOS", Suppl_portable) assert(prp); DBG_ARGUMENTS( ("AX=0x%04x", prp->r_ax) ) intrpt(0x21, prp); DBG_RETURN_BI( (prp->r_flags & 1)? prp->r_ax: 0) } ================================================ FILE: suppl/src/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak TOP2LVL = 1 TOP = ../.. !include "$(TOP)/config.mak" SUPPL=suppl_$(SHELL_MMODEL) CC = $(CC) -I.. all : ../$(SUPPL).lib OBJS1 = addu.obj byte2par.obj cntry.obj dfndeli2.obj dfndelim.obj dfnexpan.obj dfnfnam.obj OBJS2 = dfnfullp.obj dfnmerge.obj dfnpath.obj dfnsplit.obj dfnsquee.obj dfnstat.obj OBJS3 = dfntruen.obj dmemcmpf.obj dosalloc.obj dosfree.obj dossize.obj dstrchar.obj OBJS4 = dstrfupr.obj dstrleft.obj dstrrepl.obj dstrtrim.obj dstrupr.obj enoallc.obj OBJS5 = enoreal.obj enosdup.obj enosetos.obj env_chg.obj env_del.obj env_dvar.obj env_find.obj OBJS6 = env_fora.obj env_free.obj env_insv.obj env_len.obj env_mtch.obj env_new.obj OBJS7 = env_nost.obj env_ovrw.obj env_repl.obj env_rlsg.obj env_scnt.obj env_size.obj OBJS8 = env_strg.obj env_sub.obj env_var1.obj env_var2.obj ffmaxbuf.obj fgetpos.obj OBJS9 = fmemchr.obj fmemcmp.obj fmemcpy.obj fmemove.obj fnorm.obj fputmc.obj fstrcpy.obj OBJS10 = fstrdup.obj fstrlen.obj _getdcwd.obj mcb_1st.obj mcb_is.obj mcb_leng.obj mcb_nxt.obj OBJS11 = mcb_walk.obj stpcat.obj stpcpy.obj toupperx.obj filefind.obj invokedo.obj intr.obj DOBJS1 = app_ievx.obj app_ini_.obj app_name.obj app_namx.obj app_vars.obj dbgf_chg.obj DOBJS2 = dbgf_cl.obj dbgf_cle.obj dbgf_clg.obj dbgf_dl.obj dbgf_dpl.obj dbgf_et.obj DOBJS3 = dbgf_ext.obj dbgf_fl.obj dbgf_flg.obj dbgf_ien.obj dbgf_lgh.obj dbgf_lgi.obj DOBJS4 = dbgf_lgt.obj dbgf_lk.obj dbgf_log.obj dbgf_lv.obj dbgf_mfi.obj dbgf_mi.obj DOBJS5 = dbgf_mki.obj dbgf_ml.obj dbgf_pop.obj dbgf_prt.obj dbgf_psh.obj dbgf_var.obj DOBJS6 = dbgm_chk.obj dbgv_s0.obj dbgv_s2.obj dbgv_s3.obj dbgv_s4.obj dbgv_s5.obj DOBJS7 = dbgv_s6.obj dbgv_s7.obj dbgv_s8.obj dbgv_s10.obj dbgv_s13.obj dbgv_s14.obj DOBJS8 = dbgv_s15.obj dbgv_s17.obj dbgv_s19.obj dbgv_s20.obj dbgv_s22.obj dbgv_s25.obj DOBJS9 = eeopen.obj eestrcon.obj env_sdup.obj erfc_00f.obj erfc_015.obj gm_res.obj DOBJS10 = gm_dup.obj gm_chgm.obj gm_gtmem.obj nlstime.obj strnum.obj s_skipws.obj s_skipwd.obj # Prepare Librarian Response File suppllib.rsp: $(ECHOLIBDEP) makefile.mak $(RMFILES) suppllib.rsp $(ECHOLIB) suppllib.rsp $(OBJS1) $(ECHOLIB) suppllib.rsp $(OBJS2) $(ECHOLIB) suppllib.rsp $(OBJS3) $(ECHOLIB) suppllib.rsp $(OBJS4) $(ECHOLIB) suppllib.rsp $(OBJS5) $(ECHOLIB) suppllib.rsp $(OBJS6) $(ECHOLIB) suppllib.rsp $(OBJS7) $(ECHOLIB) suppllib.rsp $(OBJS8) $(ECHOLIB) suppllib.rsp $(OBJS9) $(ECHOLIB) suppllib.rsp $(OBJS10) $(ECHOLIB) suppllib.rsp $(OBJS11) $(ECHOLIB) suppllib.rsp $(DOBJS1) $(ECHOLIB) suppllib.rsp $(DOBJS2) $(ECHOLIB) suppllib.rsp $(DOBJS3) $(ECHOLIB) suppllib.rsp $(DOBJS4) $(ECHOLIB) suppllib.rsp $(DOBJS5) $(ECHOLIB) suppllib.rsp $(DOBJS6) $(ECHOLIB) suppllib.rsp $(DOBJS7) $(ECHOLIB) suppllib.rsp $(DOBJS8) $(ECHOLIB) suppllib.rsp $(DOBJS9) $(ECHOLIB) suppllib.rsp $(DOBJS10) # Create the library ../$(SUPPL).lib: $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) \ $(OBJS8) $(OBJS9) $(OBJS10) $(OBJS11) $(DOBJS1) $(DOBJS2) $(DOBJS3) $(DOBJS4) \ $(DOBJS5) $(DOBJS6) $(DOBJS7) $(DOBJS8) $(DOBJS9) $(DOBJS10) suppllib.rsp $(RMFILES) ..$(DIRSEP)$(SUPPL).lib $(AR) ..$(DIRSEP)$(SUPPL).lib @suppllib.rsp $(LIBLIST) ..$(DIRSEP)$(SUPPL).lst ================================================ FILE: suppl/src/mcb_1st.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): mcb_first su(bsystem): mcb ty(pe): sh(ort description): Return the first MCB lo(ng description): Returns the first MCB within the chain pr(erequistes): va(lue): The first MCB re(lated to): se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word mcb_first(void) { word ofs, mcb; USEREGS DBG_ENTER("mcb_first", Suppl_mcb) _AH = 0x52; /* get list of list */ geninterrupt(0x21); ofs = _BX; /* mcb:ofs := pointer to list of lists */ mcb = _ES; if(ofs < 2) --mcb, ofs += 16; /* Avoid the segment warp */ DBG_RETURN_U( peekw(mcb, ofs - 2) ) /* 1st MCB */ } ================================================ FILE: suppl/src/mcb_is.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): isMCB su(bsystem): mcb ty(pe): sh(ort description): Test if a MCB is valid lo(ng description): Tests if a given MCB is valid. pr(erequistes): va(lue): 0: is no MCB\item else: is a MCB re(lated to): isPSP isEnv mcb_walk se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif static int isMCBcomp(void *arg, word mcb) { return mcb == (unsigned)arg; } int isMCB(const word mcb) { DBG_ENTER("isMCB", Suppl_mcb) DBG_ARGUMENTS( ("mcb=%u", mcb) ) DBG_RETURN_BI( mcb_walk(0, aF(isMCBcomp), (void*)mcb)) } ================================================ FILE: suppl/src/mcb_leng.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): mcb_length su(bsystem): mcb ty(pe): sh(ort description): Return the length of a memory block as \tok{(int)} lo(ng description): Returns the length of a memory block in bytes, \em{but} in the range 0..65534!\par The specified value must be the address to the \em{memory segment} rather than the address of the associated MCB! pr(erequistes): va(lue): 0: \tok{segm == 0} or the block is really empty \item \tok{0xFFFFu}: the block is larger than 64KB \item else: the size of the block at address \para{segm}, in range 0..65520 bytes re(lated to): se(condary subsystems): bu(gs): co(mpilers): wa:+ Unlike most of the functions of this subsystem the specified address must point to the real memory segment rather than its MCB! */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif unsigned mcb_length(const word segm) /* Return the length of the memory block starting at segm */ { unsigned length; DBG_ENTER("mcb_length", Suppl_mcb) DBG_ARGUMENTS( ("segm=%u", segm) ) if(segm == 0) { /* security value */ DBG_STRING("Invalid memory segment") DBG_RETURN_I( 0) } length = peekw(SEG2MCB(segm), MCB_OFF_SIZE); /* len of block in paras */ DBG_RETURN_BI( length >= 4096? /* larger than 64KB */ ~0: length << 4) } ================================================ FILE: suppl/src/mcb_nxt.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): nxtMCB su(bsystem): mcb ty(pe): sh(ort description): Skip to next MCB in chain lo(ng description): Skips to next MCB in the chain. To enrich the error detection mechanism the functions fails, if the passed in MCB \para{mcb} points to does not have the magic number 'M'. pr(erequistes): mcb != 0 va(lue): 0: no further MCB in chain \item else: address of next MCB re(lated to): isMCB se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include #include "mcb.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif word nxtMCB(word mcb) { DBG_ENTER("nxtMCB", Suppl_mcb) DBG_ARGUMENTS( ("MCB=%u", mcb) ) assert(mcb); DBG_RETURN_BI( peekb(mcb, 0) == 'M' ? MCB2SEG(mcb) + peekw(mcb, MCB_OFF_SIZE) : 0) } ================================================ FILE: suppl/src/mcb_walk.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): mcb_walk su(bsystem): mcb ty(pe): sh(ort description): Enumerate all remaining MCBs of the chain lo(ng description): Enumerates all remaining MCBs of the chain. The callback function pointed to by \para{fct} is invoked for each found MCB. The function must comply to the \tok{MCB_WALKFUNC} type and gets passed in the unchanged \para{arg} parameter and the address of the found MCB. The callback function returns if the enumeration process shall proceed (return value equal to \tok{0} (zero)) or terminate (returns anything unequal to zero).\par If \tok{mcb == 0}, the enumeration begins with the first MCB of the system.\par During the enumeration process UMBs, if any, are linked into the chain. They are unlinked upon return of \tok{mcb_walk()}. pr(erequistes): \para{fct} != NULL va(lue): -1: MCB chain corrupted (maybe returned by the callback function, too) \item 0: all MCB entries enumerated, the callback function always returned zero itself \item else: the value returned by the callback, unequal to zero re(lated to): MCB_WALKFUNC mcb_allParents se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #ifndef NDEBUG #include #endif #include #include "mcb.h" #include "suppl.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int mcb_walk(word mcb, const MCB_WALKFUNC fct, void * const arg) { word ofs; FLAG UMBLink; FLAG8 MCBtype; USEREGS DBG_ENTER("mcb_walk", Suppl_mcb) DBG_ARGUMENTS( ("mcb=%u", mcb) ) assert(fct); if(!mcb) /* begin with the 1st MCB */ mcb = mcb_first(); DBG_ARGUMENTS( ("effective mcb=%u", mcb) ) /* for walking, link in UMB list */ UMBLink = 1; /* Don't unlink UMBs */ { _AX = 0x5802; /* Get UMB Link state */ /* /// Modified to use __emit__(), which doesn't require an assembler, if we're compiling with TurboC. - Ron Cemer */ #if defined(_TC_EARLY_) __emit__((unsigned char)0xf9); /* stc */ #elif defined(__WATCOMC__) || defined(__GNUC__) reg.x.flags |= 1; #else asm { stc } #endif geninterrupt(0x21); if(!_CFLAG && !_AL) { /* There are UMBs && not linked, yet */ UMBLink = _AL; DBG_STRING("Link in UMBs") _BX = 1; /* Link them */ _AX = 0x5803; /* Set UMB Link state */ geninterrupt(0x21); } } while(ofs = -1, (MCBtype = peekb(mcb, MCB_OFF_TYPE)) == 'M' || MCBtype == 'Z') { /* MCB seems to be valid */ if((ofs = (*fct)(arg, mcb)) != 0 /* call fct & break if necessary */ || MCBtype == 'Z') break; /* end of chain */ mcb += peekw(mcb, MCB_OFF_SIZE) + 1; /* advance to next MCB */ } if(UMBLink == 0) { /* unlink UMBs */ DBG_STRING("Unlink UMBs") _AX = 0x5803; _BX = 0; geninterrupt(0x21); } DBG_RETURN_I( ofs) } ================================================ FILE: suppl/src/msgs.lng ================================================ /* standard strings */ #include "nls/english.lng" /* generated error codes */ #include "nls/english.err" ================================================ FILE: suppl/src/msgs.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ SUPPL message implementation Declares the default message handler. */ #ifndef __MSGS_INC #define __MSGS_INC #ifndef _MICROC_ #include #endif #include #include #include "msgs.h" /*#include "msgs.lng"*/ #define errexit exit(125) #define error(msg,param) fprintf(stderr, msg, param); errexit #define error0(msg) fputs(msg, stderr); errexit #define warning(msg,param) fprintf(stderr, msg, param) #define warning0(msg) fputs(msg, stderr) #define msgLock(msg) (msg) #define msgUnlock(msg) #ifdef _MICROC_ #define MSGID char * #else typedef char const * MSGID; #endif extern const char I_wdInc[]; extern const char I_sgnPlus[]; extern const char I_wdDec[]; extern const char I_sgnMinus[]; extern const char I_wdOff[]; extern const char I_wdFalse[]; extern const char I_wdNo[]; extern const char I_wdClear[]; extern const char I_wdOn[]; extern const char I_wdTrue[]; extern const char I_wdYes[]; extern const char I_wdSet[]; extern const char I_wdToggle[]; extern const char I_wdSwitch[]; extern const char I_TcfgErr[]; extern const char I_TcfgNone[]; extern const char I_TcfgStr[]; extern const char I_TcfgExpStr[]; extern const char I_TcfgInt[]; extern const char I_TcfgBool[]; extern const char I_TcfgExpInt[]; extern const char I_TcfgExpBool[]; extern const char I_success[]; extern const char I_error[]; extern const char I_failure[]; #ifdef _MICROC_ #define LookupFct int #else typedef int (*LookupFct)(char *, char *, size_t); #endif /* * Lookup word case-sensitively * The array contains entries to be retrieved dynamically if possible. * * Return: * 0: not found * else: (index + 1) of the found word, the word matches 100% * the entry within the array */ #define lookupword(wd,arr) lookupwd_((wd), (arr), nM((LookupFct))aF(memcmp)) /*size_t lookupword(const char * const wd, const char * const * const arr);*/ /* * Lookup word case-insensitively * The array contains entries to be retrieved dynamically if possible. * * Return: * 0: not found * else: (index + 1) of the found word, the word matches * the entry within the array case-insentitively * the match is performed with the MemiCmp() function */ #define lookupwordi(wd,arr) lookupwd_((wd), (arr), nM((LookupFct))aF(MemiCmp)) /*size_t lookupwordi(const char * const wd, const char * const * const arr);*/ /* * Lookup word user-specific * The array contains entries to be retrieved dynamically if possible. * * Return: * 0: not found * else: (index + 1) of the found word, the word matches * the entry within the supplied function */ size_t lookupwd_(const char * const wd, const MSGID *const arr , inM(int cmpfct, int (*cmpfct)(char *, char *, size_t))); #endif ================================================ FILE: suppl/src/msgs_w.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ void Wsuppl_argMissing(char ch); void Wsuppl_nonArgOption(char ch); void Wsuppl_argOption(char ch); void Wsuppl_lArgOption(const char * const name); void Wsuppl_option(char ch); void Wsuppl_lOption(const char * const name); void Wsuppl_longOption(void); void Wsuppl_noMem(void); void Wsuppl_writeFile(const char * const fnam); void Wsuppl_accessFile(const char * const fnam); void Wsuppl_openFile(const char * const fnam); void Wsuppl_createFile(const char * const fnam); void Wsuppl_readFile(const char * const fnam); void Wsuppl_creatTmpFnam(void); void Wsuppl_tmpOpen(const char * const fnam); void Wsuppl_wrCfgFile(const char *fnam); void Wsuppl_ovrLinkcount(const char *fnam); ================================================ FILE: suppl/src/nls/english.err ================================================ /* automatically generated by mkerrcod.pl */ /* * cfg error codes */ #define E_CFG0 "no error, must be 0 (zero) !\n" #define E_CFG1 "passed argument(s) invalid\n" #define E_CFG2 "out of memory\n" #define E_CFG3 "output file not open\n" #define E_CFG4 "general access error\n" #define E_CFG5 "cannot open file\n" #define E_CFG6 "INI file already opened\n" #define E_CFG7 "user home directory does not exist\n" #define E_CFG8 "key not found\n" #define E_CFG9 "section/value already exists\n" #define E_CFG10 "no section/value to advance to\n" #define E_CFG11 "unrecoverable change of INI file\n" #define E_CFG12 "line is a comment\n" #define E_CFG13 "ill-formed line in INI file\n" #define E_CFG14 "no user INI file\n" #define E_CFG15 "cannot write to INI file\n" #define E_CFG16 "cannot read from INI file\n" /* end of cfg error codes */ ================================================ FILE: suppl/src/nls/english.lng ================================================ /* $Id$ $Locker$ $Name$ $State$ SUPPL message definitions for the English tongue Every entry must be an #define; also, don't prevent multiple inclusion $Log$ Revision 1.1 2006/06/28 16:04:19 blairdude Initial checkin */ /* standard MSGLIB errors */ #define E_argMissing "Option '%c' requires a non-empty argument\n" #define E_nonArgOption "Option '%c' cannot have an argument\n" #define E_argOption "Option '%c' requires an argument\n" #define E_lArgOption "Option '%s' requires an argument\n" #define E_option "Unknown option '%c'\n" #define E_lOption "Unknown option '%s'\n" #define E_longOption "Long options not supported\n" #define E_noMem "Out of memory\n" #define Y_noFNam "<>" #define E_openFile "Cannot open file: %s\n" #define E_createFile "Cannot create file: %s\n" #define E_readFile "Cannot read file: %s\n" #define E_writeFile "Cannot write file: %s\n" #define E_accessFile "Cannot access file: %s\n" #define E_creatTmpFnam "Cannot create filename for temporary file\n" #define E_tmpOpen "Cannot open temporary file: %s\n" #define E_wrCfgFile "Cannot write binary configuration file: %s\n" #define E_ovrLinkcount "Locked the same key too often in cfg file: %s\n" #define I_success "success" #define I_failure "failure" #define I_error "error" #define I_wdInc "inc" #define I_sgnPlus "+" #define I_wdDec "dec" #define I_sgnMinus "-" #define I_wdOff "off" #define I_wdFalse "false" #define I_wdNo "no" #define I_wdClear "clear" #define I_wdOn "on" #define I_wdTrue "true" #define I_wdYes "yes" #define I_wdSet "set" #define I_wdToggle "toggle" #define I_wdSwitch "switch" #define I_TcfgErr "unknown" #define I_TcfgNone "unspecified" #define I_TcfgStr "string" #define I_TcfgExpStr "expandable string" #define I_TcfgInt "integer" #define I_TcfgBool "boolean" #define I_TcfgExpInt "expandable integer" #define I_TcfgExpBool "expandable boolean" /* cfg errors */ #define E_CFGunknown "Unknown error\n" ================================================ FILE: suppl/src/nls.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ DOS NLS implementation -- "use" functions of the NLS info Internal declarations. */ #ifndef __NLS_LOC #define __NLS_LOC #include #include "nls.h" #endif /*# !defined(__CNTRY_H) */ ================================================ FILE: suppl/src/nlstime.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): nlsCurTime su(bsystem): nls ty(pe): sh(ort description): Fill the current time into the NLS structure lo(ng description): Fills the current time into the specified NLS structure. This function only modifies the fields \tok{ti_hour}, \tok{ti_minute}, \tok{ti_second} and \tok{ti_hundred}. The data may range in: \item hour: 0..23 \item minute: 0..59 \item second: 0..59 \item hundred: 0..99 \endlist pr(erequistes): t != NULL va(lue): none; \tok{*t} structure has been updated re(lated to): nlsCurDate se(condary subsystems): portable bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #endif #include "nls.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif #if defined(_MICROC_) || defined(_TC_EARLY_) || defined(__GNUC__) #undef HAVE_DOSTIME #else #define HAVE_DOSTIME #endif void nlsCurTime(nlstime *t) { #ifdef HAVE_DOSTIME struct dostime_t dt; #else USEREGS #endif DBG_ENTER("nlsCurTime", Suppl_nls) assert(t); #ifdef HAVE_DOSTIME _dos_gettime(&dt); t->ti_hour = dt.hour; t->ti_minute = dt.minute; t->ti_second = dt.second; t->ti_hundred = dt.hsecond; #else _AX = 0x2c00; geninterrupt(0x21); t->ti_hour = _CH; t->ti_minute = _CL; t->ti_second = _DH; t->ti_hundred = _DL; #endif DBG_RETURN_VALUES( ("h:m:s.h=%u:%u:%u.%u", t->ti_hour, t->ti_minute, t->ti_second, t->ti_hundred) ) DBG_EXIT } ================================================ FILE: suppl/src/s_skipwd.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): skipwd su(bsystem): misc ty(pe): sh(ort description): Skip to end of word lo(ng description): Skips to the end of the word pointed to by \para{s}.\par The end of a word is any character \tok{ch}, for which \tok{isspace(ch) || ch == '\0'} is true.\newline If \tok{*s} is an end-of-word character itself, \tok{s} is returned. pr(erequistes): va(lue): NULL: if \tok{s == NULL} \item \para{s}: if \tok{*s ==} end-of-word character \item else: first end-of-word character of string \para{s} re(lated to): skipws se(condary subsystems): wa: No quotes are recognized. co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include #include "str.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *skipwd(const char *s) { DBG_ENTER("skipwd", Suppl_misc) if(!s) DBG_RETURN_P( 0) DBG_ARGUMENTS( ("str=%p \"%s\"", s, s) ) while(*s && !isspace(*s)) ++s; DBG_RETURN_P( (char *)s) } ================================================ FILE: suppl/src/s_skipws.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): skipws su(bsystem): misc ty(pe): sh(ort description): Skip any whitespaces lo(ng description): Skips any whitespaces pointed to by \para{s}. pr(erequistes): va(lue): NULL: if \tok{s == NULL} \item \para{s}: if \tok{!isspace(*s) || *s == '\0'} \item else: first non-whitespace character or \tok{'\0'} re(lated to): skipwd se(condary subsystems): wa: No quotes are recognized. co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include #include "str.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif char *skipws(const char *s) { DBG_ENTER("skipws", Suppl_misc) if(!s) DBG_RETURN_P( 0) DBG_ARGUMENTS( ("str=%p \"%s\"", s, s) ) while(isspace(*s)) ++s; DBG_RETURN_P( (char *)s) } ================================================ FILE: suppl/src/sstr.src ================================================ /* $Id$ $Locker$ $Name$ $State$ Secure string functions. They accept NULLs as string/memory pointers. $Log$ Revision 1.1 2006/06/17 03:25:06 blairdude Suppl files in CVS Revision 1.1 1999/01/18 05:32:29 ska Initial revision */ #ifndef __SSTR_H #define __SSTR_H #ifndef _MICROC_ #include #endif #include #define Strcmpi Stricmp #define Strncmpi Strnicmp #define Memcmpi Memicmp ================================================ FILE: suppl/src/stpcat.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): stpcat su(bsystem): portable ty(pe): sh(ort description): Append a string to another lo(ng description): Appends a string to another one and return the end of the constructed string. pr(erequistes): \tok{dst != NULL && src != NULL} and \tok{dst[]} must have enough space to append the string \tok{src[]}. va(lue): pointer to the \tok{'\0'} terminator byte of the resulting string in \tok{dst[]} re(lated to): strcpy se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #include #ifndef _MICROC_ #include #endif #include "suppl.h" #include "suppldbg.h" char *stpcat(char * const dst, const char * const src) { assert(dst); assert(src); return stpcpy(strchr(dst, NUL), src); } ================================================ FILE: suppl/src/stpcpy.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ stpcpy(char *dst, char *src) Copy src onto dst Return a pointer to the '\0' of dst Target compilers: Pacific C v7.51 ob(ject): stpcpy su(bsystem): portable ty(pe): sh(ort description): Copy a string onto another lo(ng description): Copies string \tok{src[]} over \tok{dst[]} and returns the end of the resulting string pr(erequistes): \tok{dst != NULL && src != NULL} and \tok{dst[]} must have enough space to copy \tok{src[]} to va(lue): pointer to \tok{'\0'} terminator byte of the resulting string re(lated to): se(condary subsystems): bu(gs): co(mpilers): Pacific HiTech C only */ #include "initsupl.loc" #ifdef COMPILE #undef COMPILE #endif #ifdef _PAC_NOCLIB_ #define COMPILE #endif #ifdef __WATCOMC__ #define COMPILE #endif #ifdef COMPILE #include #include char *stpcpy(char * const dst, const char * const src) { register char *p; register const char *q; assert(dst); assert(src); p = dst - 1; q = src - 1; while(*++p = *++q); return p; } #endif ================================================ FILE: suppl/src/str.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Supplemental string functions. Internal header file. */ #ifndef __STR_LOC #define __STR_LOC #include #include "str.h" #endif ================================================ FILE: suppl/src/strnum.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob(ject): strnum su(bsystem): cmdline ty(pe): sh(ort description): Parse a numerical option string lo(ng description): Parses a string of a numeric option. The complete supported syntax is:\newline /^\s*[+-]?(0x)?[0-9a-f][oqdbh]?\s*$/i \item The optional "[+-]" signs indicate that the number as signed. In this case the number itself must range between \tok{INT_MIN} and \tok{INT_MAX}. Otherwise the number is \tok{0}..\tok{UINT_MAX}. \item The optional "(0x)" prefix and "[oqdbh]" signs specify the radix of the number:\newlist \item 0x --> hexadecimal (radix == 16), [oqdbh] must not be present \item [oqdbh] --> o & q: octal (radix == 8), d: decimal (radix == 10), b: binary (radix == 2), h: hexadecimal (radix == 16) \endlist The radix defaults to decimal, even if the first digit is \tok{'0'}. \item The numbers itself "[0-9a-f]" can only contain digits valid for the specified radix. \endlist\par If \tok{endp == NULL}, no error position is stored. pr(erequistes): s != NULL && num != NULL va(lue): 0: on success, \tok{*endp} unchanged, \tok{*num} contains the number \item else: on failure, the error position is assigned to \tok{*endp}. \tok{*num} contains the value processed so far, zero when no digit was parsed, yet. re(lated to): strbool atoi strtol se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #endif #include #include #include "str.loc" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif int strnum(const char * const s, int * const num, char ** const endp) { char *p, *q; int neg, radix, ch; unsigned n, maxn, modn; DBG_ENTER("strnum", Suppl_cmdline) assert(s); assert(num); DBG_ARGUMENTS( ("str=\"%s\"", s) ) n = 0; p = skipws(s); /* skip leading whitespaces */ /* Scan sign */ maxn = INT_MAX; switch(*p++) { case '-': neg = 1; break; default: --p; maxn = UINT_MAX; case '+': neg = 0; break; } /* Aquire radix */ q = skipwd(p) - 1; radix = 10; if(*p == '0' && toupper(p[1]) == 'X') { /* C style hexadecimal */ p += 2; radix = 16; } else if(p < q) { /* check the last character */ switch(toupper(*q)) { case 'B': radix = 2; break; case 'O': case 'Q': radix = 8; break; case 'D': radix = 10; break; case 'H': radix = 16; break; default: ++q; /* q is the upper limit */ } } modn = maxn % radix; /* maximum digit if n == maxn */ maxn /= radix; --p; while(++p < q /* there is a next character */ && n <= maxn) { /* can add the next character */ /* transform next ASCII digit into number */ ch = toupper(*p) - '0'; if(ch < 0 /* invalid digit < '0' */ || (ch > 9 && (ch -= 'A' - ('9' + 1)) < 10) /* invalid */ || ch >= radix /* invalid greater than radix */ || (ch > modn && n == maxn)) /* overflow */ break; n = n * radix + ch; } if(p == q) /* ignore trailing whitespaces */ p = skipws(p); *num = neg? -n: n; if(!*p) /* no error */ DBG_RETURN_I( 0) if(endp) *endp = p; DBG_RETURN_I( 1) } ================================================ FILE: suppl/src/suppldbg.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ Declarations for the local debug implementation */ #ifndef __SUPPL_DBG_LOC #define __SUPPL_DBG_LOC #include #include "suppldbg.h" #include "supplio.h" /* Extension appended to application name to form the logfile name */ #define DBG_EXTENSION ".DBG" /* Exit code if debug system terminates application E*() functions use 125 */ #define DBG_EXIT_CODE 124 /* The log list is a double linked list; The sentinel element contains the default flag ('+' == enabled or '-' == disabled). To look up, the list is always completely walked through and the last matched entry is used. Each element is prefixed by either '+' == enabled or '-' == disabled. */ typedef struct SUPPL_LOG_LIST { struct SUPPL_LOG_LIST *suppl_l_nxt; char suppl_l_name[2]; /* Dynamically expanded */ } suppl_log_list_t; /* Declarations for the function logging package "Stack" expands to the currently active logging status and the macro S() expands to a member of this status. */ struct SUPPL_LOG_STATUS { struct SUPPL_LOG_STATUS *suppl_l_nxt; suppl_log_list_t suppl_l_files; /* files to be logged */ suppl_log_list_t suppl_l_classes; /* classes to be logged */ suppl_log_list_t suppl_l_functions; /* functions to be logged */ int suppl_l_maxdepth; /* maximum nesting level */ FLAG suppl_l_enabled; /* logging active? */ FLAG suppl_l_indent; /* indent output? */ FLAG suppl_l_ownFiles; /* 'files' member NOT inherited */ FLAG suppl_l_ownClasses; /* 'classes' member NOT inherited */ FLAG suppl_l_ownFunctions; /* 'functions' member NOT inherited */ }; typedef struct SUPPL_LOG_STATUS suppl_log_stack_t; extern suppl_log_stack_t *suppl_Stack; #define S(member) suppl_Stack->suppl_l_##member extern int suppl_l_nestlevel; /* current nesting level */ extern FLAG suppl_l_fct_enabled; /* function class permits logging */ extern FILE *suppl_l_logfile; /* logfile opened already? */ extern char suppl_l_openmode[]; /* how to open the logfile */ extern long suppl_l_count; /* line counter */ /* Prevent recursion of the debug/logging package */ int suppl_log_lock(void); void suppl_log_unlock(void); #define suppl_log_chg_list(f,l,p) \ suppl_log_chg_list_(&(f), &(l), p) void suppl_log_chg_list_(FLAG *ownCopy , suppl_log_list_t *baseCopy , suppl_log_sptr_t *p); suppl_log_list_t *suppl_log_mkf_item(int flag, suppl_log_csptr_t s , size_t length); suppl_log_list_t *suppl_log_mk_item(suppl_log_csptr_t s); void suppl_log_dup_list(suppl_log_list_t *list); #define suppl_log_del_list(list) \ suppl_log_del_list_(aS(list)) void suppl_log_del_list_(suppl_log_list_t *list); int suppl_log_match_item(suppl_log_list_t *item , suppl_log_csptr_t s); int suppl_log_find_list(suppl_log_list_t *list , suppl_log_csptr_t s); int suppl_log_item_enabled(suppl_log_list_t *list , suppl_log_csptr_t str); int suppl_log_find_list(suppl_log_list_t *list , suppl_log_csptr_t str); int suppl_log_match_list(suppl_log_list_t *list , suppl_log_csptr_t str); #define suppl_log_flag(flag,poi) \ suppl_log_flag_(&(flag), (poi)) void suppl_log_flag_(FLAG *flag, suppl_log_sptr_t *p); void suppl_log_log_item(suppl_log_csptr_t fmt, ...); void suppl_log_log_vitem(suppl_log_csptr_t fmt, va_list ap); void suppl_log_log_header(void); void suppl_log_log_trailer(void); void suppl_log_log_open(void); #endif ================================================ FILE: suppl/src/supplio.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the supplemental I/O functions. Internal declarations. */ #ifndef __SUPPLIO_INC #define __SUPPLIO_INC #include #include #include "supplio.h" #ifdef _MICROC_ #define FF_OPENMODE_ARGS FLAG r, w, a, u, b; #define FF_OPENMODE_ARG &r #endif Suppl_ExtAttr *F_xinfo(const FILE * const fp, Suppl_ExtAttr ** const prev); extern Suppl_ExtAttr suppl_dfltExtAttr; #endif ================================================ FILE: suppl/src/syslog.loc ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Internal declarations for the SYSLOG subsystem. */ #ifndef __SYSLOG_LOC #define __SYSLOG_LOC #include #include #include #include #include "syslog.h" /* How to construct the filenmae from the basename */ #define SYSLOG_FNAM(fnam) EStrConcat(2, fnam, ".LOG") /* Extract level & facility from priority */ #define LEVEL(pri) (((pri) >> 12) & 0xf) #define FACILITY(pri) ((pri) & 0xfff) /* Internal variables */ extern int syslog_options; extern int syslog_facility; extern FILE *syslog_logfile; extern char *syslog_fnam; extern char syslog_openmode[]; extern char *syslog_ident; extern int syslog_opencount; /* * Dump one line via printf() into the log file * Dump the time into the log file. * The log file must be open already. */ void syslog_print(const char * const format, ...); void syslog_vprint(const char * const format, va_list ap); void syslog_print_time(void); /* * Dump a newline character into the log file, if the passed * string does not terminate with one. */ void syslog_eol(const char * const str); #endif ================================================ FILE: suppl/src/toupperx.c ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ ob: toFUpper su(bsystem): nls ty(pe): sh(ort description): Upcases a character for filenames lo(ng description): Transforms a character to uppercase according the DOS NLS table for filename characters. If no such table is available, the standard C \tok{toupper()} function is used. pr(erequistes): va(lue): upcased character in the range: 0..255 re(lated to): nlsInfo toUpper se(condary subsystems): bu(gs): co(mpilers): ob: toUpper su(bsystem): nls ty(pe): sh(ort description): Upcases a character lo(ng description): Transforms a character to uppercase according the DOS NLS table for characters. If no such table is available, the standard C \tok{toupper()} function is used. pr(erequistes): va(lue): upcased character in the range: 0..255 re(lated to): nlsInfo toFUpper toLower se(condary subsystems): bu(gs): co(mpilers): ob: toLower su(bsystem): nls ty(pe): sh(ort description): Lowercases a character for filenames lo(ng description): Transforms a character to lowercase according the DOS NLS table for characters. If no such table is available, the standard C \tok{tolower()} function is used. pr(erequistes): va(lue): lowercased character in the range: 0..255 re(lated to): nlsInfo toUpper se(condary subsystems): bu(gs): co(mpilers): */ #include "initsupl.loc" #ifndef _MICROC_ #include #include #endif #include #include "suppl.h" #include "dynstr.h" #include "cntry.h" #include "fmemory.h" #include "suppldbg.h" #ifdef RCS_Version static char const rcsid[] = "$Id$"; #endif static int toMTrans(int ch, int len, fartbl iM(*)tbl, int (*fct)(int)) { /* If len <= 0x80, the table has been filled only with the values from 0x80..0xFF */ ch &= 0xFF; return (len <= 0x80 && ch < 0x80) ? (byte)fct(ch) /* this is the standard case */ : dpeekb(tbl, ch); } #undef toupper int toFUpper(int ch) { return toMTrans(ch, nlsInfo()->fupcaseLen, nlsInfo()->fupcaseTbl , toupper); } int toUpper(int ch) { return toMTrans(ch, nlsInfo()->uppercaseLen, nlsInfo()->uppercaseTbl , toupper); } #undef tolower #if 0 int toLower(int ch) { return toMTrans(ch, nlsInfo()->lowercaseLen, nlsInfo()->lowercaseTbl , tolower); } #endif ================================================ FILE: suppl/sstr.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This file was automatically generated from SSTR.SRC */ /* $Id$ $Locker$ $Name$ $State$ Secure string functions. They accept NULLs as string/memory pointers. */ #ifndef __SSTR_H #define __SSTR_H #ifndef _MICROC_ #include #endif #include #define Strcmpi Stricmp #define Strncmpi Strnicmp #define Memcmpi Memicmp /* Generated string function replacements */ void *Memccpy(void *dst, void const *src, int ch, size_t length); void *Memchr(void const *s, int ch, size_t length); int Memcmp(char const *s1, char const *s2, size_t length); void *Memcpy(void *dst, void const *src, size_t length); int Memicmp(char const *s1, char const *s2, size_t length); void *Memmove(void *dst, void const *src, size_t length); void *Memset(void *s, int ch, size_t length); char *Stpcat(char *dst, char const *src); char *Stpcpy(char *dst, char const *src); char *Strcat(char *dst, char const *src); char *Strchr(char const *s, int ch); int Strcmp(char const *s1, char const *s2); int Strcoll(char const *s1, char const *s2); char *Strcpy(char *dst, char const *src); size_t Strcspn(char const *str, char const *chset); char *Strdup(char const *s); int Stricmp(char const *s1, char const *s2); size_t Strlen(char const *s); char *Strlwr(char *s); char *Strncat(char *dst, char const *src, size_t length); int Strncmp(char const *s1, char const *s2, size_t length); char *Strncpy(char *dst, char const *src, size_t length); int Strnicmp(char const *s1, char const *s2, size_t length); char *Strnset(char *s, int ch, size_t length); char *Strpbrk(char const *str, char const *chset); char *Strrchr(char const *s, int ch); char *Strrev(char *s); char *Strset(char *s, int ch); size_t Strspn(char const *str, char const *chset); char *Strstr(char const *str, char const *substr); char *Strtok(char *str, char const *delim); char *Strupr(char *s); char *Strend(char *s); #ifdef SUPPL_STR_REMAP /*Remap standard function names to replacements */ #define strupr Strupr #define stricmp Stricmp #define memmove Memmove #define stpcpy Stpcpy #define strspn Strspn #define strchr Strchr #define strnset Strnset #define strcoll Strcoll #define memicmp Memicmp #define strnicmp Strnicmp #define stpcat Stpcat #define memccpy Memccpy #define strcpy Strcpy #define strcspn Strcspn #define memcpy Memcpy #define strlwr Strlwr #define strncpy Strncpy #define strlen Strlen #define strstr Strstr #define strrev Strrev #define memset Memset #define memchr Memchr #define strcmp Strcmp #define memcmp Memcmp #define strncat Strncat #define strcat Strcat #define strdup Strdup #define strtok Strtok #define strncmp Strncmp #define strrchr Strrchr #define strset Strset #define strpbrk Strpbrk #define strend Strend #endif /* defined(SUPPL_STR_REMAP) */ #endif ================================================ FILE: suppl/str.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Supplemental string functions. ob(ject): utoa10 su(bsystem): misc ty(pe): M sh(ort description): Transform an unsigned decimal number into ASCII format lo(ng description): Transforms an unsigned decimal number into its ASCII representation. pr(erequistes): buf != NULL va(lue): none re(lated to): itoa10 se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): ob(ject): itoa10 su(bsystem): misc ty(pe): M sh(ort description): Transform a signed decimal number into ASCII format lo(ng description): Transforms a signed decimal number into its ASCII representation. pr(erequistes): buf != NULL va(lue): none re(lated to): utoa10 se(condary subsystems): in(itialized by): wa(rning): bu(gs): co(mpilers): */ #ifndef __STR_H #define __STR_H #ifndef _MICROC_ #include #include #endif #include char *skipws(const char *s); char *skipwd(const char *s); char *singleword(char *s); /* void itoa10(int num, char * const buf); */ /* void utoa10(int num, char * const buf); */ #ifndef _MICROC_ #define itoa10(num,buf) itoa((num), (buf), 10) #define utoa10(num,buf) ultoa((unsigned)(num), (buf), 10) #else /* negative radix --> signed */ #define itoa10(num,buf) itoa((num), (buf), -10) /* positive radix --> unsigned */ #define utoa10(num,buf) itoa((num), (buf), 10) #endif int strnum(const char * const s, int * const num, char ** const endp); int strbool(char *s); /* memzero() fills a block of memory with 0; used throughout SUPPL where a larger amount of values of data types: (int), (short), (char) and pointers are to initialize with 0 or NULL. It is unportable, but efficient on portable systems; because of this macro places, where to port on failure, are easy to locate. */ /* void memzero(void *poi, size_t length); */ #define memzero(poi,length) memset((poi), 0, (length)) #define memzerobj(object) memzero(&object,sizeof(object)) #define memzerostrct(structure) memzero(aS(structure),sizeof(structure)) #endif ================================================ FILE: suppl/supl_def.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __SUPPL_COMPILER_DEFINES #define __SUPPL_COMPILER_DEFINES /********************************** ***** Pacific HiTech C **********************************/ #ifdef HI_TECH_C /* Probe if PAC is used in conjunction with CLib */ #include #ifdef _CLIB_ #define _PAC_ 1 #else #define _PAC_NOCLIB_ 1 #endif /* _CLIB_ */ #endif /* HI_TECH_C */ /********************************** ***** Early Turbo C++ **********************************/ #ifdef __TURBOC__ #if __TURBOC__ <= 0x297 #define _TC_EARLY_ #else #define _TC_LATER_ #endif #endif #endif ================================================ FILE: suppl/suppl.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the supplemental functions. This header file is part of the "portable" subsystem and will be removed, or moved to another purpose. */ #ifndef __SUPPL_H #define __SUPPL_H #include #include #include #define itemsof(array) (sizeof(array) / sizeof(array[0])) #define NIL(type) ((type)0) /* length of the longmath numbers. */ #define LSIZE sizeof(dword) #ifndef _MICROC_ #define longsubi(a,b) ((a) -= (int)(b)) #define longsubu(a,b) ((a) -= (unsigned)(b)) #define longaddi(a,b) ((a) += (int)(b)) #define longaddu(a,b) ((a) += (unsigned)(b)) #define longmuli(a,b) ((a) *= (int)(b)) #define longmulu(a,b) ((a) *= (unsigned)(b)) #define longdivi(a,b) ((a) /= (int)(b)) #define longdivu(a,b) ((a) /= (unsigned)(b)) #define longseti(a,b) ((a) = (int)(b)) #define longsetu(a,b) ((a) = (unsigned)(b)) #define longshln(a,c) ((a) <<= (c)) #define longshrn(a,c) ((a) >>= (c)) int longcmp(long d1, long d2); #define longcmp_(a,b) ((signed long)(a) - (signed long)(b)) #define longsgn(a) ((signed long)(a)) #define longclr(a) ((a) = 0) #define poked(seg,ofs,value) (*(dword far*)MK_FP(seg,ofs) = (value)) #define pokedd(seg,ofs,hi,lo) (*(dword far*)MK_FP(seg,ofs) = ((dword)(hi)<<16)|(lo)) #define peekd(segm,ofs,value) ((value) = *(dword far*)MK_FP(segm,ofs)) int peekdd(word segm, word ofs, word *valHi, word *valLo); typedef char far *fartbl; /* far table */ #define dpeekc(fartable,idx) (*(((char far *)fartable) + (idx))) #define dpeekb(fartable,idx) (*(((byte far *)fartable) + (idx))) #define dpeekw(fartable,idx) (*(word far*)(((byte far *)fartable) + (idx))) #define _fmemcmpi _fmemicmp #define _fstrcmpi _fstricmp #define memcmpi memicmp #ifdef _PAC_NOCLIB_ int memicmp(const void *s1, const void *s2, unsigned len); void *memccpy(void *s1, const void *s2, int ch, size_t len); #endif #else /* defined(_MICROC_) */ #define longcmp_ longcmp #define longsgn(a) (longtst(a) && ((int*)(a))[1]) #define fartbl dword /* pointer to far table */ #define dpeekc(tbl,idx) (char)dpeekb((tbl), (idx)) int dpeekb(fartbl fartable, int idx); word dpeekw(fartbl fartable, int idx); int memicmp(const void *s1, const void *s2, unsigned len); void *memccpy(void *s1, const void *s2, int ch, size_t len); #endif /* !defined(_MICROC_) */ #define putcm fputcm int fputmc(int ch, int cnt, FILE *f); /* Emit the same character several times into the stream */ word DOSalloc(word length, int mode); /* Allocate a chunk of memory directly via the DOS API. length is the number of paragraphes that shall be allocated. mode is the allocation strategy to be used. If mode specifies to use high memory, the high memory will be automatically made accessable. If the bit 0x10 of mode is set, length is ignored and the size of the largest unallocated block is returned, which can be allocated later. This function does not alter the allocation strategy permanently. Return: 0: Allocation failed else: if 0x10 of mode was clear: segment address of allocated memory if 0x10 of mode was set: the largest unallocated block */ int DOSresize(word segm, word length); /* Resize a chunk of memory directly via the DOS API. segm is the segment to resize, it must be allocated via the DOS API or a comparable function, like DOSalloc(), allocBlk(). length is the new number of paragraphes. If to resize the segment fails, the block of memory is not relocated into a larger space of the DOS memory. Return: 0: resize failed !0: resize OK */ int DOSfree(const word segm); /* Free a chunk of memory directly via the DOS API. segm is the segment to resize, it must be allocated via the DOS API or a comparable function, like DOSalloc(), allocBlk(). Return: 0: free OK !0: DOS error code */ #define allocBlk(length,allocMode) DOSalloc(BLK_byte2para(length), allocMode) #ifdef _MICROC_ word resizeBlk(const word segm, const unsigned length); #else #define resizeBlk(segm,length) DOSresize(segm, BLK_byte2para(length)) #endif #define freeBlk DOSfree /* Free the segment using the DOSfree() function. */ /* No differences, only for completeness. */ unsigned BLK_byte2para(const unsigned bytes); /* Return the number of paragraphes that will be needed to store �bytes� bytes in. If bytes == 0, the return value is zero, too. */ int addu(unsigned *u1, unsigned u2); /* Performs the operation: *u1 += u2; and returns, if an overflow occured. Return: 0: no overflow !0: overflow */ #ifdef __WATCOMC__ #ifdef FARDATA #pragma aux addu = \ "add word ptr es:[bx], ax" \ "sbb ax, ax" \ __parm [__es __bx] [__ax] \ __value [__ax] \ __modify [__es __bx] #else #pragma aux addu = \ "add word ptr [bx], ax" \ "sbb ax, ax" \ __parm [__bx] [__ax] \ __value [__ax] \ __modify [__bx] #endif #endif int invokeDOS(nM(IREGS *prp)); /* Invoke DOS using intr(0x21, prp). Return: 0: DOS returned with Carry flag cleared !0: AX value (DOS error code) if DOS returned with Carry flag set */ #ifndef _CLIB_ char *stpcat(char * const dst, const char * const src); /* Append src to dst and return the address of the '\0' character of dst */ #endif #if defined(__WATCOMC__) || defined(__GNUC__) char *stpcpy(char * const dst, const char * const src); /* Copy src into dst Return pointer to '\0' terminator of dst */ /* different names */ #ifndef ffblk #include struct ffblk { char ff_reserved[21]; byte ff_attrib; unsigned ff_ftime; unsigned ff_fdate; long ff_fsize; char ff_name[13]; }; #include #endif #ifdef __WATCOMC__ #define findfirst(pattern,buf,attrib) _dos_findfirst((pattern), (attrib) \ , (struct find_t*)(buf)) #define findnext(buf) _dos_findnext((struct find_t*)(buf)) #define FA_RDONLY _A_RDONLY #define FA_ARCH _A_ARCH #define FA_SYSTEM _A_SYSTEM #define FA_HIDDEN _A_HIDDEN #define FA_DIREC _A_SUBDIR #define FA_LABEL _A_VOLID #else /* __GNUC__ */ int findfirst(const char * const pattern, struct ffblk *ff, int attrib); int findnext(struct ffblk *ff); #define FA_RDONLY 0x01 #define FA_ARCH 0x20 #define FA_SYSTEM 0x04 #define FA_HIDDEN 0x02 #define FA_DIREC 0x10 #define FA_LABEL 0x08 #endif #ifndef MAXDIR #define MAXDIR 66 /* 64: path; +1: root sign; +1: NUL terminator */ #define MAXDRIVE 3 /* 1: drive letter; +1: ':'; +1: NUL terminator */ #define MAXFILE 9 /* 8: name; +1: NUL terminator */ #define MAXNAME 9 #define MAXEXT 5 /* 3: name; +1: dot; +1: NUL terminator */ #define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3) #endif #endif /* WATCOMC */ #ifdef _PAC_NOCLIB_ char *stpcpy(char * const dst, const char * const src); /* Copy src onto dst, Return a pointer to the '\0' character of dst */ int getdisk(void); /* Return the current working drive. 0 == A:, 1 == B: ... */ int setdisk(void); /* Change the current working drive. 0 == A:, 1 == B: ... Returns the number of available drive letters (not necessary currently accessable). */ /* * Pacific does not offer any OS version information */ unsigned osversion(void); /* Return: _osmajor | (_osminor << 8) */ /* * No findfirst() */ struct ffblk { char ff_reserved[21]; byte ff_attrib; unsigned ff_ftime; unsigned ff_fdate; long ff_fsize; char ff_name[13]; }; int findfirst(const char * const pattern, struct ffblk *ff, int attrib); /* Initiate file search Return: 0 on success */ int findnext(struct ffblk *ff); /* Next file search Return: 0 on success */ void far *getdta(void); /* Return current working DTA */ void setdta(void far *dta); /* Set current working DTA */ unsigned _psp_(void); /* Return the current PSP */ void ctrlbrk(int (*fct)(void)); /* Set new ^Break handler */ #endif /* _PAC_NOCLIB_ */ #ifdef COMPILE #undef COMPILE #endif #ifdef _MICROC_ #define COMPILE #endif #ifdef _PAC_NOCLIB_ #define COMPILE #endif #ifdef __WATCOMC__ #define COMPILE #endif #ifdef _TC_EARLY_ #define COMPILE #endif #ifdef COMPILE #undef COMPILE char *_getdcwd(int drive, char *buf, unsigned length); /* Return the fully-qualified path of drive in the format: ?:\...\...\... If buf == NULL, a buffer of length bytes is allocated. Return: NULL: On failure else: on success (buf or allocated buffer) */ #endif int getbootdisk(void); /* as getdisk() but returns the boot drive Return: 1 == A:, 2 == B: 0: failure */ #endif ================================================ FILE: suppl/suppldbg.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $RCSfile$ $Locker$ $Name$ $State$ SUPPL common debugging features If used by an application, SUPPL and the application will use the same debugging driver and, therefore, debugging extends from the application into the functions included from SUPPL. This is useful especially while debugging heap actions (alloc/dealloc). Note #1: If NDEBUG is defined, all debugging features are turned off! Note #2: This #include file MUST be included at the end of the list, at least behind all the standard #includes referencing via '<...>'. Otherwise it is possible that some redefines do not work or the compiler will detect errors within standard include files. Understood debugging features: SUPPL_DBG_MEMORY: Causes that the macro chkMem performs an extensive test of the logical memory management of DOS and the C runtime environment. SUPPL_DBG_HEAP: Causes that the macro 'chkHeap' actively checks the local heap for corruption. chkHeap includes chkMem! SUPPL_LOG_MEMORY: Causes to redefine heap-related CLib functions (malloc, calloc, realloc, free,& strdup). SUPPL_LOG_FUNCTION: Note: These package was inspired by Fred Fish's DBUG package shipped with DMake v3+. When the macro SUPPL_LOG_NO_INFO is #define'ed prior including this header file, the macro DBG_INFO() expands to nothing. Causes to active all of the DBG_* macros: DBG_ENTER() - logs that a function was entered DBG_ENTER1/DBG_ENTER2() - as DBG_ENTER, *1 -> declaration, *2 -> fct DBG_ARGUMENTS() - logs function arguments DBG_RETURN_VALUES() - logs function return values DBG_EXIT() - logs that a function was exited DBG_LEAVE() - logs that a function was exited (with parameter, no log) DBG_LONG_RETURN() - logs that a function was exited (with param & log) DBG_RETURN_?() - logs that a function was exited (with param & log) DBG_PRINT() - logs arbitary information DBG_INFO() - logs arbitary information of information class "inf" DBG_STRING() - logs a string in information class "inf" DBG_CHANGE_STATE() - changes logging status DBG_PUSH_STATE() - duplicates current logging status DBG_POP_STATE() - forget current logging status & restore previous one DBG_TERMINATE() - terminate application with a log message */ #ifndef __SUPPLDBG_H #define __SUPPLDBG_H #include #ifndef _MICROC_ #include #endif #include /* * Initialize all macros with dummy values. They are undefined later * right before a debugging specific value is added. * Initializing them here ensures that they are correctly set for * non-debugging. */ #define chkHeap ; #define chkMem ; #ifdef NDEBUG /* native debug support disabled? */ /* Turn off every SUPPL specific debugging feature */ #undef SUPPL_DBG_HEAP #undef SUPPL_DBG_MEMORY #undef SUPPL_LOG_MEMORY #undef SUPPL_LOG_FUNCTION #else #ifdef SUPPL_DBG_ALL /* Turn on every SUPPL specific debugging feature */ #define SUPPL_DBG_HEAP #define SUPPL_DBG_MEMORY #define SUPPL_LOG_MEMORY #define SUPPL_LOG_FUNCTION #endif #endif /* !defined(NDEBUG) */ #ifdef SUPPL_ALWAYS_DEBUG_HEAP #define SUPPL_DBG_HEAP #endif #ifdef SUPPL_ALWAYS_DEBUG_MEMORY #define SUPPL_DBG_MEMORY #endif #ifdef SUPPL_DBG_MEMORY #undef chkMem #define chkMem suppl_testMemChain(); #endif #ifdef SUPPL_DBG_HEAP /* Define the macro 'chkHeap' to actively test the local heap for corruption. Note: The macro must be used without semicolon! */ #undef chkHeap #if __TURBOC__ > 0x201 #include #ifdef NDEBUG #define chkHeap suppl_testHeap(); chkMem #else #define chkHeap assert(heapcheck() == _HEAPOK); chkMem #endif #else #define chkHeap chkMem #endif #endif #ifdef SUPPL_LOG_MEMORY #include "syslog.h" /* Use internal wrappers for CLib symbols */ #ifdef malloc #undef malloc #endif #ifdef realloc #undef realloc #endif #ifdef calloc #undef calloc #endif #ifdef free #undef free #endif #ifdef strdup #undef strdup #endif #define malloc(size) suppl_malloc((size)) #define calloc(nelem,size) suppl_calloc((nelem), (size)) #define realloc(poi,size) suppl_realloc((poi), (size)) #define free(poi) suppl_free((poi)) #define strdup(poi) suppl_strdup((poi)) #endif #ifdef SUPPL_LOG_FUNCTION /* The following macros are defined: DBG_EXTENSION Extension of the logfile DBG_LIBRARY If redefined by the user, this macros specifies the name of the library, the current file is located in. Defaults to none. DBG_ALWAYS_FLUSHLOG If defined, the log file is flushed each time one entry has been written successfully into the logfile. (compile-time option - see INITSUPL.LOC!) DBG_ALWAYS_CLOSELOG If defined, the log file is closed each time one entry has been written successfully into the logfile. (compile-time option - see INITSUPL.LOC!) Use this option if system crashes corrupt the logfile or same entries won't appear there. NONE OF THESE MACROS MUST NOT BE USED WITH A TRAILING SEMICOLON! DBG_CLOSELOG Close the logfile. DBG_FLUSHLOG Flush the log file and make sure all data is written to disk and the directory entry has been updated. This function should be called each time when it is possible that the program is going to crash or is going to be asynchroneously terminated (e.g. Ctrl-Alt-Del). DBG_ENTER(char *function_name, char *function_class) Enters the function with name "function_name" and class. (see STATE) It must be the first statement immediately following the variable declaration, because it will define a variable as well. This macro must be pairly used with DBG_LEAVE or DBG_EXIT. All of the other macros won't work without DBG_ENTER. DBG_ENTER1 Is the variable declaration part of DBG_ENTER() DBG_ENTER2(char *function_name, char *function_class) Is the function calling part of DBG_ENTER() DBG_ARGUMENTS( (char *format_spec, arguments) ) Logs the arguments of the current function. The parameters follow the same rules as in DBG_PRINT. The only difference to DBG_PRINT is that the output can be selectively enabled/disabled. DBG_RETURN_VALUES( (char *format_spec, arguments) ) Logs the retrun values of the current function. The parameters follow the same rules as in DBG_PRINT. The only difference to DBG_PRINT is that the output can be selectively enabled/disabled. DBG_EXIT Exits a void function. The "return" statement is already included. DBG_LEAVE(return_expression) As DBG_EXIT, but "return_expression" is passed as an argument to "return". The return value is NOT logged automatically. DBG_LONG_RETURN(type, char *format_spec, return_expression) This macro combines: DBG_RETURN_VALUES and DBG_LEAVE. Unfortunately return_expression would be evaluated twice, therefore it is evaluated once and stored into a temporary variable of the specified type; 'type' must (or, at least, should) be of the same type as the function returns. The same applies to the format specification, which is passed to printf(). DBG_RETURN_#(return_expression) As DBG_RETURN(), '#' is the uppercase letter usually find within a printf()-format specification: # type format_spec C char "%c" S char* "\"%s\"" I int "%d" U unsigned "%u" X int "0x%x" L long "%ld" UL unsigned long "%lu" F double "%f" G double "%g" P void * "%p" A 'B' may be prefixed to buffer "return_expression" within a temporary variable to suppress side effects and/or multiple evalutation of a complex expression. DBG_PRINT( char *information_class, (char *format_spec, arguments) ) Logs ONE line. "format_spec" is a valid printf() format string and should not contain no '\n' character. Both the format spec and the arguments must be enclosed into parenthises. The information_class specifies whether or not this information is logged (see STATE). DBG_INFO( (char *format_spec, arguments) ) As DBG_PRINT(), but prints message of class "inf". Because these macro may generate a lot of strings, they can be individually disable with the SUPPL_LOG_NO_INFO macro. It must be #define'ed prior including "suppldbg.h" DBG_STRING(char *string) As DBG_INFO(), but prints a string only DBG_PUSH_STATE Duplicates the current logging status. Any subsequent DBG_CHANGE_STATE will effect the newly generated status only. If there is no status currently, this function is ignored. DBG_POP_STATE Discards the topmost logging status and restores the previous one. If there is only one or none pushed status, this function is ignored. DBG_CHANGE_STATE(char *state_spec) Modifies the current logging status according the state_spec. If there is no current status, a new one will be created. The state_spec is a sequence of log_specs delimited by semicolons. A log_spec consists of a log_format_letter and arguments, the arguments can be delimited by commas, if necessary. No superflous whitespaces or such are allowed! The following log_format_letters are understood: d# set the maximum logging depth (#: unsigned number) default: no limit f?*,... files to be logged (*: one file name), each filename is prefixed by '+' enable, or '-' disable file. Wildcards are not allowed. The filename must be specified the same way as the compiler named them in their __FILE__ macro, this is usually the fully-qualified filename. "+" alone logs everything (clears every previous settings), "-" alone logs nothing (also clears every previous settings). default: log everything. c?*,... functions to be logged (*: one function name) Syntax the same as "f*,...", but the string must case-sensitively match the string passed to DBG_ENTER() l? globally enable/disable logging (?: + enable, - disable) i? indent output (?: + enable, - disable) If disbale the nesting level is inserted as number, otherwise as a repetive count of "| " strings C?*,... classes to be logged Syntax the same as "f*,...", but the string must either case-sensitively match one of the classes specified as function_class (DBG_ENTER) or information_class (DBG_PRINT) or one of the SUPPL classes: information classes: "arg" - DBG_ARGUMENTS "rv" - DBG_RETURN_VALUE "fct" - DBG_ENTER & DBG_EXIT/DBG_LEAVE "inf" - informative information function classes: "env" - environment "mcb" - MCB "mem" - memory "str" - string "ini" - INI file "cmd" - command line handling "err" - error wrappers "dfn" - filename functions "fil" - FILE wrappers "lmt" - long mathematics "nls" - NLS "log" - syslog / logging "msc" - misc. Note: function and information classes share the same name space. Note: If the library name is specify with DBG_LIBRARY, one must enable the library as well. All SUPPL files use the library name "SUPPL". E.g. to enable SUPPL logging, it is _not_ sufficient to specify "C+", but "C+,+SUPPL", note that "+SUPPL" must trail "+"! Defaults to '-' (disable everything). DBG_TERMINATE(char *string) logs the string, then "program terminated by debug system", then terminates the application via exit(DBG_EXIT_CODE) */ #ifndef DBG_LIBRARY #define DBG_LIBRARY 0 #endif #define DBG_CLOSELOG \ suppl_log_close(); #define DBG_FLUSHLOG \ suppl_log_flush(); #define DBG_ENTER1 \ auto suppl_log_local_data_t suppl_log_data; #define DBG_ENTER2(fct_name, fct_class) \ suppl_log_enter(DBG_LIBRARY, __FILE__, __LINE__, &suppl_log_data \ , (fct_name), (fct_class)); #define DBG_ENTER(fct_name, fct_class) \ DBG_ENTER1 \ DBG_ENTER2(fct_name, fct_class) #define DBG_ARGUMENTS( info ) \ DBG_PRINT( Suppl_class_arg , info ) #define DBG_RETURN_VALUES( info ) \ DBG_PRINT( Suppl_class_rv , info ) #define DBG_EXIT \ { suppl_log_leave(&suppl_log_data); \ return; } #define DBG_LEAVE(expr) \ { suppl_log_leave(&suppl_log_data); \ return (expr); } #define DBG_LONG_RETURN(type, fmt, expr) \ { type suppl_temp_var; \ suppl_temp_var = (expr); \ DBG_RETURN_VALUES( (fmt, suppl_temp_var) ) \ DBG_LEAVE( suppl_temp_var ) \ } #define DBG_RETURN(fmt, expr) \ { DBG_RETURN_VALUES( (fmt, (expr)) ) \ DBG_LEAVE( (expr) ) \ } #if 1 #define DBG_PRINT(inf_class, info) \ { if(suppl_log_print_1((inf_class))) \ suppl_log_print_2 info; \ } #else #define DBG_PRINT(inf_class, info) \ { if(suppl_log_class_enabled((inf_class))) \ suppl_log_log info; \ } #endif #ifdef SUPPL_LOG_NO_INFO #define DBG_INFO(info) ; #define DBG_STRING(info) ; #else #define DBG_INFO( info ) \ DBG_PRINT( Suppl_class_inf , info ) #define DBG_STRING(str) DBG_INFO( (str) ) #endif #define DBG_PUSH_STATE \ suppl_log_push(); #define DBG_POP_STATE \ suppl_log_pop(); #define DBG_CHANGE_STATE(state) \ suppl_log_change((state)); #define DBG_TERMINATE(loginfo) \ suppl_log_terminate((loginfo)); #else /* Generate pseudo-macros */ #define DBG_CLOSELOG ; #define DBG_FLUSHLOG ; #define DBG_ENTER1 ; #define DBG_ENTER2(fct_name, fct_class) ; #define DBG_ENTER(fct_name, fct_class) ; #define DBG_ARGUMENTS( info ) ; #define DBG_RETURN_VALUES( info ) ; #define DBG_EXIT return; #define DBG_LEAVE(expr) return (expr); #define DBG_LONG_RETURN(t,f,expr) return (expr); #define DBG_RETURN(f,expr) return (expr); #define DBG_PRINT(inf_class, info) ; #define DBG_INFO( info ) ; #define DBG_STRING(str) ; #define DBG_PUSH_STATE ; #define DBG_POP_STATE ; #define DBG_CHANGE_STATE(state) ; #define DBG_TERMINATE(string) suppl_log_exit((string)); #endif /* Format specs used for the DBG_RETURN_*() macros */ #define DBG_RETURN_FMT_SPEC_C "%c" #define DBG_RETURN_FMT_SPEC_S "\"%s\"" #define DBG_RETURN_FMT_SPEC_I "%d" #define DBG_RETURN_FMT_SPEC_U "%u" #define DBG_RETURN_FMT_SPEC_X "0x%x" #define DBG_RETURN_FMT_SPEC_L "%ld" #define DBG_RETURN_FMT_SPEC_UL "%lu" #define DBG_RETURN_FMT_SPEC_F "%f" #define DBG_RETURN_FMT_SPEC_G "%g" #define DBG_RETURN_FMT_SPEC_P "%p" #define DBG_RETURN_BC(expr) DBG_LONG_RETURN(char, DBG_RETURN_FMT_SPEC_C, (expr)) #define DBG_RETURN_BS(expr) DBG_LONG_RETURN(char*, DBG_RETURN_FMT_SPEC_S, (expr)) #define DBG_RETURN_BI(expr) DBG_LONG_RETURN(int, DBG_RETURN_FMT_SPEC_I, (expr)) #define DBG_RETURN_BU(expr) DBG_LONG_RETURN(unsigned, DBG_RETURN_FMT_SPEC_U, (expr)) #define DBG_RETURN_BX(expr) DBG_LONG_RETURN(int, DBG_RETURN_FMT_SPEC_X, (expr)) #define DBG_RETURN_BL(expr) DBG_LONG_RETURN(long, DBG_RETURN_FMT_SPEC_L, (expr)) #define DBG_RETURN_BUL(expr) DBG_LONG_RETURN(unsigned long, DBG_RETURN_FMT_SPEC_UL, (expr)) #define DBG_RETURN_BF(expr) DBG_LONG_RETURN(double, DBG_RETURN_FMT_SPEC_F, (expr)) #define DBG_RETURN_BG(expr) DBG_LONG_RETURN(double, DBG_RETURN_FMT_SPEC_G, (expr)) #define DBG_RETURN_BP(expr) DBG_LONG_RETURN(void *, DBG_RETURN_FMT_SPEC_P, (expr)) #define DBG_RETURN_C(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_C, (expr)) #define DBG_RETURN_S(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_S, (expr)) #define DBG_RETURN_I(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_I, (expr)) #define DBG_RETURN_U(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_U, (expr)) #define DBG_RETURN_X(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_X, (expr)) #define DBG_RETURN_L(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_L, (expr)) #define DBG_RETURN_UL(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_UL, (expr)) #define DBG_RETURN_F(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_F, (expr)) #define DBG_RETURN_G(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_G, (expr)) #define DBG_RETURN_P(expr) DBG_RETURN(DBG_RETURN_FMT_SPEC_P, (expr)) /* * Declarations of functions */ /* Some special log functions: malloc --> malloc(size) = poi; calloc --> malloc(size) = poi; realloc --> realloc(poi, size) = poi; free --> free(poi); strdup --> malloc(size) = poi; These functions will automatically open the logfile if necessary. */ extern void suppl_log_malloc(void const * const newpoi, const size_t size); /* extern void suppl_log_calloc(void const * const newpoi, const size_t nelem, const size_t size); */ #define suppl_log_calloc(newpoi,nelem,size) \ suppl_log_malloc((newpoi), (nelem) * (size)) extern void suppl_log_realloc(void const * const newpoi, const void * const oldpoi, const size_t size); extern void suppl_log_free(const void * const oldpoi); extern void suppl_log_strdup(char const * const newpoi, const char * const string); /* These functions substitutes the associated function and call suppl_log_*(), too. */ extern void *suppl_malloc(const size_t size); extern void *suppl_calloc(const size_t nelem, const size_t size); extern void *suppl_realloc(void * const poi, const size_t size); extern void suppl_free(void * const poi); extern char *suppl_strdup(const char * const string); /* Function to test if the DOS Memory Chain has been corrupted if so, the application is terminated */ extern void suppl_testMemChain(void); extern void suppl_testHeap(void); /* These functions are the backend of the logging package */ typedef unsigned suppl_log_lvl_t; /* nesting level type */ typedef unsigned long suppl_log_linenr_t; /* compiler line number type */ typedef const char * suppl_log_sptr_t; /* string pointer */ typedef const char * const suppl_log_csptr_t; /* string pointer */ typedef struct { suppl_log_lvl_t suppl_l_prv_nestlevel; FLAG suppl_l_prv_fct_enabled; suppl_log_sptr_t suppl_l_fctname; } suppl_log_local_data_t; void suppl_log_enter(suppl_log_sptr_t library_name , suppl_log_csptr_t file_name , suppl_log_linenr_t linenr , suppl_log_local_data_t *data , suppl_log_csptr_t function_name , suppl_log_csptr_t function_class); void suppl_log_leave(suppl_log_local_data_t *data); int suppl_log_class_enabled(suppl_log_csptr_t classname); void suppl_log_log(suppl_log_csptr_t fmt, ...); int suppl_log_print_1(suppl_log_csptr_t inf_class); void suppl_log_print_2(suppl_log_csptr_t fmt, ...); void suppl_log_push(void); void suppl_log_pop(void); void suppl_log_change(suppl_log_csptr_t state); void suppl_log_flush(void); void suppl_log_close(void); void suppl_log_terminate(suppl_log_csptr_t loginfo); void suppl_log_exit(suppl_log_csptr_t loginfo); /* * Strings of the function classes used within SUPPL * defined as constant character arrays to prevent that each file * creates its own local copy of the string in its data segment */ extern const char Suppl_appName[]; extern const char Suppl_cmdline[]; extern const char Suppl_dfn[]; extern const char Suppl_dynstr[]; extern const char Suppl_env[]; extern const char Suppl_error[]; extern const char Suppl_farmem[]; extern const char Suppl_inifile[]; extern const char Suppl_inifile1[]; extern const char Suppl_inifile2[]; extern const char Suppl_inifile3[]; extern const char Suppl_mcb[]; extern const char Suppl_misc[]; extern const char Suppl_nls[]; extern const char Suppl_portable[]; extern const char Suppl_SUPPL[]; extern const char Suppl_supplio[]; extern const char Suppl_syslog[]; extern const char Suppl_usr[]; /* * Strings of the log classes used within SUPPL * defined as constant character arrays to prevent that each file * creates its own local copy of the string in its data segment */ extern const char Suppl_class_arg[]; extern const char Suppl_class_rv[]; extern const char Suppl_class_fct[]; extern const char Suppl_class_inf[]; extern const char Suppl_class_env[]; extern const char Suppl_class_mcb[]; extern const char Suppl_class_mem[]; extern const char Suppl_class_str[]; extern const char Suppl_class_ini[]; extern const char Suppl_class_cmd[]; extern const char Suppl_class_err[]; extern const char Suppl_class_dfn[]; extern const char Suppl_class_fil[]; extern const char Suppl_class_lmt[]; extern const char Suppl_class_nls[]; extern const char Suppl_class_log[]; extern const char Suppl_class_msc[]; #endif /* defined(__DBUG_H) */ ================================================ FILE: suppl/supplio.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Declarations for the supplemental I/O functions. To overcome the difference between Micro-C and ANSI C: All identifiers starts with an uppercase 'F', the leading lowercase 'f' is stripped, if present. Functions that will automatically terminate the program with an appropriate error message if the action fails. They have an uppercase 'E' instead of the 'F'. The Eopen(), Ecreate() and Eclose() functions use the Fxopen() and Fxclose() to save the extended attributes; they use the filename to issue with the error messages. Three functions support the "extended attributes per file" feature: Fxopen(): open a file and generate & store the extended attributes Fxclose(): close the file and destroy the extended attributes Fxinfo(): retrieve the extended attributes The implementation is such that Fxopen() returns a normal (FILE*), in order to be passed to the normal F*() functions, but also sets up an association between the (FILE*) pointer and the extended attributes. If the macro SUPPL_USE_EXTENDED_ATTRIBUTES is defined prior #include'ing this header file, Fxopen() and Fxclose() replace Fopen() and Fclose() by default. */ #ifndef __SUPPLIO_H #define __SUPPLIO_H #include #include #ifndef __PORTABLE_H #include #endif #ifdef _PAC_NOCLIB_ /* * Missing fpos_t and assoc. functions */ typedef long fpos_t; #define fsetpos(stream,position) fseek((stream), *(position), 0) int fgetpos(FILE * const fp, fpos_t * const pos); /* fsetpos() is similar to fseek() and fgetpos() to ftell(), though, better portabel. Both return 0 (zero) on success. */ #endif /* * Macros passed into Fsetmode() */ #define FF_RD 1 /* read access */ #define FF_WR 2 /* write access */ #define FF_RW 3 /* read & write access */ /* * Replacement of stdio functions * All of these macros evaluate all parameter exactly once. */ #define Fflush fflush #define Fyclose fclose #define Frewind rewind #define Fgetc(fp) getc((fp)) #define Fputc(c,fp) putc((c),(fp)) #define Ffgetc(fp) fgetc((fp)) #define Ffputc(c,fp) fputc((c),(fp)) #define Fgets fgets #define Fputs fputs #define Ferror ferror #define Fclearerr clearerr #ifndef _MICROC_ #define Fget(buf,size,fp) fread((buf), 1, (size), (fp)) #define Fput(buf,size,fp) fwrite((buf), 1, (size), (fp)) #define Fgetpos(fp,pos) fgetpos((fp), (pos)) #define Fsetpos(fp,pos) fsetpos((fp), (pos)) #define Fsetmode(fp,mode) /* overcome Micro-C bug with R&W files */ #define Fseeki(fp,ofs) fseek((fp), (long)(ofs), SEEK_CUR) #define Fseekc(fp,pos) Fseeki((fp), (ofs)) #define Fpseekc(fp,pos) Fseeki((fp), *(ofs)) #define Fseeke(fp) fseek((fp), (long)0, SEEK_END) #define Fyopen fopen #define Fseek(fp,pos,whence) fseek((fp), (long)(pos), (whence)) #define Fpseek(fp,pos,whence) Fseek((fp), *(pos), (whence)) #define Fileno(fp) fileno((fp)) #define Fdopen fdopen #define Feof feof #else #include #ifndef SEEK_SET #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #endif #define fpos_t dword #define Fput fput #define Fget fget void Fsetmode(FILE *fp, int mode); int Fgetpos(FILE *fp, fpos_t *pos); #define Fsetpos(fp,pos) Fseek((fp), (pos), SEEK_SET) int Fseeki(FILE *fp, int ofs); #define Fseekc(fp,pos) Fseek((fp), (pos), SEEK_CUR) #define Fpseekc(fp,pos) Fseekc((fp),(pos)) #define Fseeke(fp) fseek((fp), 0, 0, SEEK_END) FILE *Fyopen(char *fnam, char *mode); FILE *Fdopen(int fd, char *mode); int Fseek(FILE *fp, dword *pos, int whence); #define Fpseek Fseek #define Fileno(fp) (fp)->FILE_handle int Feof(FILE *fp); #endif #define FFgetpos(fp,pos) Fgetpos((fp), aS(pos)) #define FFsetpos(fp,pos) Fsetpos((fp), aS(pos)) /* Read/write a buffer to the file. * Is a function in order to evaluate all parameters only once. * Return: * 0: on success */ int FFget(void * const buf, size_t len, FILE *const f); int FFput(const void * const buf, size_t len, FILE *const f); /* * Commit a file * * Flushes the buffers cached by the C library, and * Flushes the buffers cached by the system and also makes sure * that the directory structure is updated. */ #define Fcommit fcommit int fcommit(FILE *fp); int commit(int fd); /* Read a line into dynamical memory. * * There is always an '\n' (newline) character at the end of the line, * even at the end of file without one. * * Return: * NULL: on failure (out of memory) * else: pointer to malloc()'ed buffer, must be free()'ed by the user * if the returned buffer is a pointer to "", EOF or a read * error was encountered. * Note: The "" must also be free()'ed. */ char *Fgetline(FILE * const f); FILE *Ftmpfile(void); /* Create and open a temporary file in binary mode Should be closed by Fxclose() in order to remove the file. Return: NULL: on failure (e.g. malloc() failed, no writeble directory found) else: opened FILE* pointer to be closed with Fxclose() */ FILE *F_tmpfile(const char * const fnam); /* Create and open a temporary file in binary mode Should be closed by Fxclose() in order to remove the file. Return: NULL: on failure (e.g. malloc() failed, or fnam == NULL) removes external file 'fnam' if it exists else: opened FILE* pointer to be closed with Fxclose() */ char *Ftmpnam(const char * const ext); /* Create a temporary filename, create it as a zero-length file and return its name. The name is overwritten the next time Ftmpnam(), Ftmpdir(), Etmpnam() or Etmpdir() is called. Return: NULL: on failure, e.g. malloc() failed, no writeble directory found */ char *Ftmpdir(void); /* Return the current writeble temporary directory with a trailing backslash. The user must free() the returned string manually. This function overwrites the string returned by Ftmpnam() or Etmpnam(). Return: NULL: on failure, e.g. malloc() failed, no directory found else: pointer to pathname */ #define Fposcpy(dst,src) memcpy((dst), (src), sizeof(fpos_t)) /* Copy the value of one position to another location */ /* if debug enabled --> use the function and provide the test if fpos_t==long */ int Fposcmp(const fpos_t * const pos1, const fpos_t * const pos2); #ifdef NDEBUG #define Fposcmp(pos1,pos2) \ longcmp1(nM(*(unsigned long*))pos1, nM(*(unsigned long*))pos2) #endif /* Compare both positions Return: <0: if pos1 < pos2 =0: if pos1 = pos2 >0: if pos1 > pos2 */ #define Fpos2dword(fpos,longPos) (longPos) = (dword)(fpos); #define Fppos2dword(fpos,longPos) *(longPos) = (dword)(fpos); /* Extract the file position from a (fpos_t) type Note: There is _NO_ reverse function. Also note: (fpos_t) is known to contain more than just the file position, when special text handling code is enabled, such as multi-byte characters. */ int Fmaxbuf(byte ** const buf, size_t * const len); /* Allocate are rather large amount of memory, usually a power of 2 Return: 0 on success */ int Fcopyto(FILE * const fdst, FILE * const fsrc, const fpos_t * const pos); /* Copy (a part of) a file to another. Both files must be already opened with the proper permissions and file modes (e.g. both either binary or text, fdst has write permission, fsrc has read permission). Any bytes from fsrc are copied to fdst upto, but excluding to the position 'pos'. If the soruce file is in text mode, it is possible that 'pos' points to an invalid file position. In this case the behaviour is undefined. Return: 0: OK else: on failure */ int Fcopy(FILE * const fdst, FILE * const fsrc); /* Copy any byte from fsrc into fdst Return: 0 on success */ int Fcopyi(FILE * const fdst, FILE * const fsrc, size_t len); /* Copy len byte from fsrc into fdst Return: 0 on success */ int Fcopyl(FILE * const fdst, FILE * const fsrc, dword iM(*) len); /* Copy len byte from fsrc into fdst Return: 0 on success */ int Fcopybuf(FILE * const fdst, FILE * const fsrc, byte * const buf , const size_t len, size_t * const num); /* Copies one block from one stream into another one. Return: 0 on success */ /* * Replace for the F*() functions to automatically terminate the * program if the action fails. * * If the FILE* pointer is associated with an extended attribute, * the message contains the name of the file. */ FILE *Eopen(const char * const fnam, const char * const mode); /* Open file as Fopen(), on failure return: "Cannot open file" */ FILE *Ecreate(const char * const fnam, const char * const mode); /* Open file as Fopen(), on failure return: "Cannot create file" */ void Eclose(FILE *f); /* Close the file and free all allocated resources. If the error flag is true, the program terminates with: "Error to access file" */ #define Erewind Frewind #define Egetc Fgetc #define Efgetc Ffgetc #define Efputc Ffputc #define Eputc Fputc #define Esetmode Fsetmode #define Efileno Fileno /* Definitions that don't generate error states or, if they would be checked, it could be drastically performance drop */ char *Egets(char * const str, size_t size, FILE * const fp); /* Inputs a line from the stream; on failure the program is terminated with: "Cannot read from file" Return: NULL: if EOF else: str */ char *Eputs(const char * const str, FILE * const fp); /* Outputs a line into the stream; on failure the program is terminated with: "Cannot write into file" Return: str */ void *Eget(void * const buf, size_t size, FILE * const fp); /* Read size bytes from the stream into the buffer; on failure terminate the program with: "Cannot read from file" Return: buf */ void Eput(const void * const buf, size_t size, FILE * const fp); /* Write size bytes from the buffer into the stream; on failure terminate the program with: "Cannot write into file" */ #define EEgetpos(fp,pos) Egetpos((fp), aS(pos)) void Egetpos(FILE * const fp, fpos_t * const pos); /* Retreive the file position from the stream; on failure terminate the program with: "Cannot access file" */ #define EEsetpos(fp,pos) Esetpos((fp), aS(pos)) void Esetpos(FILE * const fp, const fpos_t * const pos); /* Seek to the position saved in *pos; on failure terminate the program with: "Cannot access file" */ #define Eclearerr Fclearerr void Eerror(const FILE * const fp); /* Terminate the program with "Cannot access file" if the ferror() statue is true. */ void Ereaderr(const FILE * const fp); void Ewriteerr(const FILE * const fp); /* Terminate the program with "Cannot read from file" or "Cannot write to file" if the ferror() status is true */ #ifndef _MICROC_ #define Eseeki(fp,ofs) Eseek((fp), (long)(ofs), SEEK_CUR) #define Eseekc(fp,pos) Eseeki((fp), (ofs)) #define Epseekc(fp,pos) Eseeki((fp), *(ofs)) #define Eseeke(fp) Eseek((fp), (long)0, SEEK_END) #define Epseek(fp,pos,whence) Eseek((fp), *(pos), (whence)) void Eseek(FILE * const fp, dword pos, int whence); #else #define Eseeki(fp,ofs) Efseek((fp), (ofs), SEEK_CUR) #define Eseeke(fp) Efseek((fp), 0, SEEK_END) void Efseek(FILE *fp, int pos, int whence); #define Eseekc(fp,pos) Eseek((fp), (ofs), SEEK_CUR) #define Epseekc(fp,pos) Eseek((fp), (ofs), SEEK_CUR) #define Epseek Eseek void Eseek(FILE * fp, dword *pos, int whence); #endif /* On failure terminate with: "Cannot access file" */ /* Read a line into dynamical memory. * * On error, an appropriate message is issued and the program * is terminated. * * There is always an '\n' (newline) character at the end of the line, * even at the end of file without one. * * Return: * NULL: EOF (or read error) * else: pointer to malloc()'ed buffer, must be free()'ed by the user */ char *Egetline(FILE * const f); FILE *Etmpfile(void); /* Create and open a binary temporary file. On failure the program is terminated with: Cannot create temporary file The file is create with mode "w+b" */ char *Etmpnam(const char * const ext); /* Create a temporary filename with the extension ext. On failure terminate the program. The returned string is overwritten by the next call to Ftmpnam(), Ftmpdir(), Etmpnam() or Etmpdir(). */ char *Etmpdir(void); /* Return the current writeble temporary directory with a trailing backslash. On failure the program is terminated The returned string must be free()'ed by the user of this function. This function overwrites the string returned by Ftmpnam() or Etmpnam(). */ /* * Extended attributes */ struct Suppl_ExtAttr_ { /* extended attributes */ struct Suppl_ExtAttr_ *sea_nxt; FILE *sea_fp; /* associated FILE* pointer; if NULL this is the default entry */ char *sea_fnam; /* absolute filename; dflt: "<>" */ FLAG sea_istmp; /* is temporary file */ }; #ifdef _MICROC_ #define Suppl_ExtAttr struct Suppl_ExtAttr_ #else typedef struct Suppl_ExtAttr_ Suppl_ExtAttr; #endif extern Suppl_ExtAttr suppl_dfltExtAttr; /* Returned by Fxinfo() on failure */ Suppl_ExtAttr *F_xopen(const char * const fnam, const char * const mode); FILE *Fxopen(const char * const fnam, const char * const mode); FILE *Exopen(const char * const fnam, const char * const mode); void Fxclose(FILE *fp); void Exclose(FILE *fp); Suppl_ExtAttr *F_xinfo(const FILE * const fp, Suppl_ExtAttr ** const prev); Suppl_ExtAttr *Fxinfo(const FILE * const fp); #define E_xinfo F_xinfo #define Exinfo Fxinfo /* Return the extended attributes associated with the FILE* pointer fp; If fp is not associated, a default entry is returned, which 'fp' is NULL, but all other members contain some sort of useful data Note: F_xinfo() is for internal puprose only. */ void Fxcloseall(void); /* Close all functions opened by Fxopen() */ #ifdef SUPPL_USE_EXTENDED_ATTRIBUTES #define Fopen Fxopen #define Fclose Fxclose #define Eopen Exopen #define Eclose Exclose #else #define Fopen Fyopen #define Fclose Fyclose #endif #endif ================================================ FILE: suppl/syslog.h ================================================ /* This file is part of SUPPL - the supplemental library for DOS Copyright (C) 1996-2000 Steffen Kaiser This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id$ $Locker$ $Name$ $State$ Implementation of the Unix-like syslog() function for DOS. The absent of an independed syslogd deamon caused some differences in the internal functionality of the function, meaning that some flags have no effect and that the call to openlog() is mandetory rather than optional. Also, the '%m' is not implemented right now and any useage of this token will result in undefined behaviour (sorry). See also the Linux MAN page: SYSLOG.MAN. */ #ifndef __SYSLOG_H #define __SYSLOG_H #include /***************************************** ******** Constants for flags etc. ******* *****************************************/ /* * openlog() options. Use a | combination of these: */ #define LOG_CONS 0 /* NOT IMPLEMENTED -- NO EFFECT */ /* write directly to system console if there is an error while sending to system logger */ #define LOG_NDELAY 0 /* NOT IMPLEMENTED -- NO EFFECT */ /* open the connection immediately (normally, the con- nection is opened when the first message is logged) */ #define LOG_PERROR 1 /* print to stderr as well */ #define LOG_PID 2 /* include PID with each message */ #define LOG_NOTIME 4 /* unique to SUPPL */ /* do not prepend the date & time syslog() is called */ /* * openlog()/syslog() facilities. Use only one of these: * Note: the DOS implementation does not really use them, instead it * prepends them at the start of the line as a number. */ #define LOG_AUTH 1 /* security/authorization messages (DEPRECATED Use LOG_AUTHPRIV instead) */ #define LOG_AUTHPRIV 2 /* security/authorization messages (private) */ #define LOG_CRON 3 /* clock daemon (cron and at) */ #define LOG_DAEMON 4 /* other system daemons */ #define LOG_KERN 5 /* kernel messages */ #define LOG_LOCAL0 24 #define LOG_LOCAL1 25 #define LOG_LOCAL2 26 #define LOG_LOCAL3 27 #define LOG_LOCAL4 28 #define LOG_LOCAL5 29 #define LOG_LOCAL6 30 #define LOG_LOCAL7 31 /* reserved for local use */ #define LOG_LPR 6 /* line printer subsystem */ #define LOG_MAIL 7 /* mail subsystem */ #define LOG_NEWS 8 /* USENET news subsystem */ #define LOG_SYSLOG 9 /* messages generated internally by syslogd */ #define LOG_USER 10 /* default */ /* generic user-level messages */ #define LOG_UUCP 11 /* UUCP subsystem */ /* * level -- importance of the log message. Can be |'ed to a facility * to construct a priority. * Use only one of these: */ #define LOG_EMERG 0x1000 /* system is unusable */ #define LOG_ALERT 0x2000 /* action must be taken immediately */ #define LOG_CRIT 0x3000 /* critical conditions */ #define LOG_ERR 0x4000 /* error conditions */ #define LOG_WARNING 0x5000 /* warning conditions */ #define LOG_NOTICE 0x6000 /* normal, but significant, condition */ #define LOG_INFO 0x7000 /* informational message */ #define LOG_DEBUG 0x0000 /* debug-level message */ /***************************************** ******** Functions ********************** *****************************************/ void openlog(const char * const ident, int option, int facility); void syslog( int priority, char *format, ...); void syslogo( int priority, char *format, ...); void syslogv( int priority, char *format, va_list ap); void closelog( void ); #endif ================================================ FILE: tests/args.bat ================================================ @echo off echo 0=%0 echo 1=%1 echo 2=%2 echo 3=%3 echo 4=%4 echo 5=%5 echo 6=%6 echo 7=%7 echo 8=%8 echo 9=%9 ================================================ FILE: tests/bat1.bat ================================================ echo in bat 1 call bat2.bat echo back in bat 1 ================================================ FILE: tests/bat2.bat ================================================ echo in bat 2 call bat3.bat ../nonexistantdir/argument1 ..\nonexistantdir\argument2 3\4\5/6 echo back in bat 2 ================================================ FILE: tests/bat3.bat ================================================ echo in bat 3 echo %1 echo all the args [%1 %2 %3 %4 %5 %6 %7 %8 %9] echo leaving bat 3 ================================================ FILE: tests/benny.bat ================================================ @echo off : Test of Benny levels : Run after a program has been invoked, which does set the error level : to 1==A:, 2==B:, ..., 26==Z: (else: error) SET drv= FOR %%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 IF ERRORLEVEL 27 SET drv= IF "%drv%"=="" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL% IF NOT "%drv%"=="" ECHO Drive letter: %drv%: ================================================ FILE: tests/compat.bat ================================================ @ECHO OFF SET DEV=1 IF NOT "%1"=="EXTENDED" IF NOT "%1"=="" GOTO %1 REM This is intended to be a primary batch file for standard MSDOS compatible testing REM Run with option EXTENDED for testing advanced FreeCOM commands supported REM Requires errlvl.exe in same directory and current directory writable REM Note: if piping output to a file without being visible, press Enter twice after a small delay REM Note: if updating, then change SET DEV=0 at top to SET DEV=1 for additional PAUSEs REM This file uses many quirks and tests and is spaghetti like for testing batch file processing REM REM commands with a * are post MSDOS version 6 commands REM commands with a ** are not included in FreeCOM by default but optionally compiled in REM neither * nor ** commands are be tested if 1st argument is not EXTENDED REM unsupported: SETLOCAL ENDLOCAL ASSOC COLOR LOCK UNLOCK ELSE REM REM BATCH file commands: REM ECHO GOTO IF *ELSE NOT EXIST FOR PAUSE SHIFT EXIT *SETLOCAL *ENDLOCAL REM EXECUTION commands: CALL COMMAND LOADFIX LOADHIGH LH PATH *ASSOC REM GENERAL commands: SET CLS *COLOR TYPE PROMPT BREAK VERIFY VER *TITLE REM VOLUME commands: VOL *LOCK *UNLOCK REM DIRECTORY commands: CD CHDIR MD MKDIR RD RMDIR *PUSHD *POPD REM FILE commands: COPY DEL ERASE DIR MOVE REN RENAME TRUENAME REM DATE/TIME commands: DATE TIME REM INTL & CON commands: CHCP CTTY REM note: environment variables also expanded in REMarks REM INTERNAL VARIABLES: %%ERRORLEVEL%% (%ERRORLEVL%) REM ENV VARIABLES: %%COMSPEC%% %%DIRCMD%% %%PROMPT%% %%PATH%% REM FreeCOM commands: ALIAS BEEP CDD DIRS DOSKEY HISTORY LFNFOR **MEMORY ? WHICH WHERE IF "%DEV%"=="1" pause REM PROMPT options: REM $b vertical bar (pipe) *** can't use actual symbol as COMMAND will try to do the redirection REM $d system date REM $e esc char REM $g greater than symbol REM $h destructive backspace REM $i less than symbol REM $n current (default) drive letter REM $p current (default) path including drive REM $q = REM $t sytem time REM $v DOS/COMMAND.COM version string REM $_ \r\n REM $$ $ REM WILDCARDS: * and ? REM PIPING/REDIRECTION: gt overwrite gtgt append pipe and ls pipe to another program REM These are remarks and should be ignored REM this will fail on MS/PC DOS COMMAND.COM but not CMD, ignored by FreeCOM TITLE FreeCOM tests IF "%DEV%"=="1" pause REM testing ECHO IF "%1"=="EXTENDED" ECHO /? ECHO ON ECHO this command should be echo'd and then this comment shown @ECHO OFF ECHO this comment should be shown but the command not echo'd ECHO this should say ECHO is off ECHO ECHO and this should say ECHO is on ECHO ON @ECHO @ECHO OFF ECHO and this should be followed by a blank line ECHO, ECHO the following command shows the version 3 times ECHO *** these will not match other COMMAND.COMs !!! ECHO testing variations of explicit no echo (using @) with echo on ECHO and then explicit no echo (using @) with echo off ECHO and again with just ECHO OFF ECHO ON @VER @ECHO OFF @VER VER IF "%DEV%"=="1" pause REM determine if running under CMD on Windows, ver /r not supported and sets errorlevel ECHO if running under CMD on Windows this will say syntax incorrect ver /r SET SHELL_IS_CMD=0 if "%ERRORLEVEL%"=="1" SET SHELL_IS_CMD=1 REM determine if running under COMMAND.COM, it doesn't support labels longer than 8 chars GOTO tst_cmd_freecom :tst_cmd_ SET SHELL_IS_COMMAND=1 GOTO t_cmd_end :tst_cmd_freecom SET SHELL_IS_COMMAND=0 :t_cmd_end ECHO SHELL_IS_COMMAND is %SHELL_IS_COMMAND% (0 for CMD/FREECOM, 1 for COMMAND) IF "%DEV%"=="1" pause REM TESTING IF and GOTO and comparison to arguments IF "%1"=="EXTENDED" GOTO ext_ver :continue_ver GOTO tst_goto ECHO THIS SHOULD NOT BE SHOWN! :tst_goto ECHO VER complete GOTO skip_ext_ver REM this section only evaluated if EXTENDED passed on command line :ext_ver ECHO EXTENDED version tests ECHO show version help VER /? ECHO show kernel version VER /R ECHO show shell warranty VER /W ECHO show shell redistribution info VER /D ECHO show shell contributors VER /C GOTO continue_ver REM continue normal testing :skip_ext_ver ECHO Testing IF and ERRORLEVEL REM %errorleve% not supported by MSDOS, last command was ver /r so 0 if supported (dos), 1 if not (win) ECHO ERRORLEVEL %ERRORLEVEL% should be 0 or "" on COMMAND (DOS) and 1 with CMD (WIN) ECHO should print Four Three Two One Zero each on its own line SET LVL=4 :loop errlvl %LVL% IF ERRORLEVEL 4 GOTO FOUR IF ERRORLEVEL 3 GOTO THREE IF ERRORLEVEL 2 GOTO TWO IF ERRORLEVEL 1 GOTO ONE echo Zero GOTO tst_show_errlvl :FOUR echo Four SET LVL=3 GOTO loop :THREE echo Three SET LVL=2 GOTO loop :TWO echo Two SET LVL=1 GOTO loop :ONE echo One SET LVL=0 GOTO loop :tst_show_errlvl ECHO if %%ERRORLEVEL%% is supported shows 3 2 1 each on its own line, else ECHO is off 3 times errlvl 3 ECHO %ERRORLEVEL% errlvl 2 ECHO %ERRORLEVEL% errlvl 1 ECHO %ERRORLEVEL% ECHO, ECHO Testing PAUSE IF "%1"=="EXTENDED" PAUSE /? REM CMD and COMMAND will ignore prompt and always show default pause message PAUSE Press any key and then screen will clear & the default pause message will show CLS PAUSE ECHO Testing label variations work : Usual spelling goto label1 ECHO If you see me then label1 didn't work :label1 echo Label 1 found : Prefixed colon goto :label2 ECHO If you see me then label2 didn't work :label2 echo Label 2 found : Prefixed colon seperated by whitespaces : Though 4dos searches for ' label3' here? : doesn't work in CMD or COMMAND, so we check if a bad ver argument has errorlevel 1 and skip it IF NOT "%1"=="EXTENDED" GOTO label3 REM the following line may terminate the batch file if unsupported instead of showing didn't work goto : label3 ECHO If you see me then label3 didn't work :label3 echo Label 3 found IF "%DEV%"=="1" pause ECHO Testing IF and EXISTS ECHO Testing the EXIST format, you should see "((OK))" two times echo. ECHO WARNING!!! this will overwrite NOTAFILE.ERR if it exists and delete it! ECHO This is a test file and should be deleted > NOTAFILE.ERR ECHO. if exist NOTAFILE.ERR echo File NOTAFILE.ERR exists ((OK)) if not exist NOTAFILE.ERR echo File NOTAFILE.ERR does not exist ((ERROR!!??)) REM this will delete NOTAFILE.ERR, but should not display anything in the process ERASE NOTAFILE.ERR if exist NOTAFILE.ERR echo File NOTAFILE.ERR exists ((ERROR!!??)) if not exist NOTAFILE.ERR echo File NOTAFILE.ERR does not exist ((OK)) echo. IF "%DEV%"=="1" pause :tst_SHIFT ECHO invoking self [%0] with showargs as label to goto then testing shift ECHO This will print the batch name showargs and empty arguments from 2 to 9 CALL %0 showargs ECHO back from self IF "%DEV%"=="1" pause ECHO This will print the batch name showargs and arguments matching from 2 to 9 CALL %0 showargs 2 3 4 5 6 7 8 9 ECHO back from self IF "%DEV%"=="1" pause ECHO This will print the batch name showargs and args from 2-9 then repeating to 10 and to 11 CALL %0 showargs 2 3 4 5 6 7 8 9 10 11 ECHO back from self IF "%DEV%"=="1" pause GOTO end_tst_SHIFT ECHO oops why do you see me? PAUSE :showargs echo 0=%0 echo 1=%1 echo 2=%2 echo 3=%3 echo 4=%4 echo 5=%5 echo 6=%6 echo 7=%7 echo 8=%8 echo 9=%9 SHIFT ECHO "%9%" is it blank? no then keep looping IF NOT "%9"=="" GOTO showargs GOTO END :end_tst_SHIFT ECHO, ECHO Testing CALL and COMMAND /C ECHO should see in bat 1, in bat 2, in bat 3, back to bat 2, back to bat 1 ECHO @ECHO OFF > _b1.bat ECHO echo in bat 1 >> _b1.bat ECHO call _b2.bat >> _b1.bat ECHO echo back in bat 1 >> _b1.bat ECHO @ECHO OFF > _b2.bat ECHO echo in bat 2 >> _b2.bat ECHO call _b3.bat >> _b2.bat ECHO echo back in bat 2 >> _b2.bat ECHO @ECHO OFF > _b3.bat ECHO echo in bat 3 >> _b3.bat CALL _b1.bat IF "%DEV%"=="1" pause REM using COMMAND /C form instead of call ECHO COMSPEC is %COMSPEC% %COMSPEC% /C _b1.bat DEL _b1.bat DEL _b2.bat DEL _b3.bat IF "%DEV%"=="1" pause :tst_FOR ECHO, ECHO Testing FOR IF "%1"=="EXTENDED" FOR /? if %SHELL_IS_CMD%==1 GOTO benny_done ECHO BENNY level test - IF ERRORLEVEL HA or IF ERRORLEVEL xa ECHO where A is A-Z for errorcode 1 to 26 and a is a-z for errorcode 1 to 26 ECHO this will fail on Windows COMMAND and 4DOS with HA was unexpected at this time. REM benny test for last drive, requires program to return last drive as errorlevel so we fake as Y using ERRLVL ERRLVL 25 SET drv=: FOR %%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 IF ERRORLEVEL 27 SET drv= IF "%drv%"=="" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL% IF NOT "%drv%"=="" ECHO Faked last drive letter: %drv%: (should be Y) ERRLVL 25 SET drv=: FOR %%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 IF ERRORLEVEL 27 SET drv= IF "%drv%"=="" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL% IF NOT "%drv%"=="" ECHO Faked last drive letter: %drv%: (should be A) ERRLVL 3 SET drv=: FOR %%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 IF ERRORLEVEL 27 SET drv= IF "%drv%"=="" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL% IF NOT "%drv%"=="" ECHO Faked last drive letter: %drv%: (should be C) SET drv= :benny_done FOR %%A IN (3 2 1) DO ECHO %%A IF "%DEV%"=="1" pause :tst_CTTY if %SHELL_IS_CMD%==1 GOTO skip_ctty IF "%1"=="EXTENDED" CTTY /? ECHO. ECHO Testing CTTY ctty nul echo not to be seen ctty con ECHO if nothing was shown then successful IF "%DEV%"=="1" pause :skip_ctty :tst_load if %SHELL_IS_CMD%==1 GOTO skip_load ECHO; ECHO LOADFIX, LOADHIGH, and LH LOADFIX /? LOADHIGH /? LH /? errlvl 33 ECHO %ERRORLEVEL% is 33 REM this is external for MSDOS so don't run for COMMAND IF "%SHELL_IS_COMMAND%"=="1" GOTO skip_lfx LOADFIX errlvl 32 ECHO %ERRORLEVEL% is 32 :skip_lfx LOADHIGH errlvl 31 ECHO %ERRORLEVEL% is 31 LH errlvl 30 ECHO %ERRORLEVEL% is 30 :: TODO add a program that shows it load address to verify lh and loadfix loaded program correctly IF "%DEV%"=="1" pause :skip_load ECHO. ECHO testing if can continue a batch file if changed while executing ECHO @ECHO ON > _b1.bat ECHO ECHO 2nd line of _b1.bat >> _b1.bat ECHO COPY /A _b1.bat + _b2.bat _b1.bat >> _b1.bat REM next line is 1 char short of filling line, should not print blank line ECHO ECHO 4th line of _b1.bat and only line of _b2> _b2.bat ECHO _b1.bat is: TYPE _b1.bat ECHO _b2.bat is: TYPE _b2.bat ECHO running _b1.bat now: CALL _b1.bat ECHO should restore to being off here @ECHO OFF ECHO _b1.bat should now include _b2.bat and all the lines should have printed TYPE _b1.bat IF "%DEV%"=="1" pause ECHO TESTING PATH MD CD RD IF "%1"=="EXTENDED" PATH /? IF "%1"=="EXTENDED" MD /? IF "%1"=="EXTENDED" MKDIR /? IF "%1"=="EXTENDED" CD /? IF "%1"=="EXTENDED" CHDIR /? IF "%1"=="EXTENDED" RD /? IF "%1"=="EXTENDED" RMDIR /? IF "%1"=="EXTENDED" CDD /? ECHO @ECHO Hello from bat 1 > _b1.bat MKDIR TESTING COPY _b1.bat TESTING ECHO PATH is %PATH% PATH SET __PATH=%PATH% PATH TESTING ECHO PATH is now %PATH% PATH CALL _b1.bat SET PATH=%__PATH% ECHO PATH is restored to %PATH% PATH ECHO current path is: CD CD TESTING ECHO new path is: if %SHELL_IS_CMD%==1 ECHO %CD% if %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD if %SHELL_IS_COMMAND%==1 CD del _b1.bat CD .. RD TESTING MD TESTING copy _b1.bat TESTING CHDIR TESTING CALL _b1.bat CHDIR .. REM CDD TESTING if %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD TESTING if %SHELL_IS_CMD%==1 CD TESTING if %SHELL_IS_COMMAND%==1 CD TESTING ECHO still in same path? CD REM CDD - if %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD - if %SHELL_IS_CMD%==1 CD .. if %SHELL_IS_COMMAND%==1 CD .. ECHO should be back to original path CD del TESTING\_b1.bat RMDIR TESTING DEL _b1.bat IF EXIST _b2.bat DEL _b2.bat IF EXIST _b3.bat DEL _b3.bat IF "%DEV%"=="1" pause ECHO. ECHO testing passing long command to FreeCOM and calling a program with a long command ECHO this tests setting CMDLINE for caller and FreeCOM reading CMDLINE as callee ECHO CMDLINE is '%CMDLINE%' ECHO running a long command: ECHO ON %COMSPEC% /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 %COMSPEC% /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 @ECHO OFF echo now test the environment substitution echo path is %path% echo PATH is %PATH% echo Absent variable is %Absent% echo Bad format : %bad format echo Testing double %%comspec%% IF "%DEV%"=="1" pause CLS IF "%1"=="EXTENDED" CLS /? IF "%1"=="EXTENDED" SET /? ECHO env var Pfun is '%Pfun%' IF NOT %SHELL_IS_COMMAND%==1 SET Pfun IF %SHELL_IS_COMMAND%==1 ECHO %Pfun% SET Pfun= SET Pfun=PFUNy ECHO env var PFUNy is '%Pfun%' IF NOT %SHELL_IS_COMMAND%==1 SET Pfun IF %SHELL_IS_COMMAND%==1 ECHO %Pfun% SET Pfun= IF %SHELL_IS_COMMAND%==1 GOTO end_Pfun if %SHELL_IS_CMD%==1 GOTO end_Pfun SET /U Pfun=PFUNy ECHO env var PFUNY is '%Pfun%' ECHO %Pfun% SET Pfun= SET /C Pfun=Pfuny ECHO env var Pfuny is '%Pfun%' SET Pfun SET Pfun= VER /? > _b1.txt SET /E Pfun=VER /? ECHO env var Pfun is '%Pfun%' SET Pfun SET Pfun= SET /E Pfun=TYPE _b1.txt DEL _b1.txt ECHO env var Pfun is '%Pfun%' SET Pfun SET Pfun= ECHO env var Pfun is '%Pfun%' SET Pfun :end_Pfun IF "%DEV%"=="1" pause CLS ECHO. ECHO Testing running a program where part of the program name is passed in as an argument CALL %0 tst_arg lvl 3 GOTO skip_tst_arg :tst_arg ERR%2 %3 IF ERRORLEVEL == 3 ECHO It Worked! GOTO END :skip_tst_arg ECHO And back IF "%DEV%"=="1" pause ECHO. ECHO BREAK and VERIFY, should should each OFF, ON, OFF again (BREAK not shown for some shells) BREAK VERIFY BREAK ON BREAK BREAK OFF BREAK VERIFY ON VERIFY VERIFY OFF VERIFY IF "%1"=="EXTENDED" BREAK /? IF "%1"=="EXTENDED" VERIFY /? IF "%DEV%"=="1" pause ECHO. ECHO Some builtin variables: ECHO current path is %CD% IF "%DEV%"=="1" pause ECHO. ECHO test copy to NUL and redirect to NUL COPY compat.bat NUL > NUL ECHO nothing should have displayed IF "%DEV%"=="1" pause GOTO end_with_funny_prompt :RESTORE PROMPT $p$g GOTO END :end_with_funny_prompt ECHO PROMPT is set to vb date vb lt drive gt path == time\n$Run COMPAT RESTORE gtgt PROMPT $b $d $b $g$h$L$n$g $p $q$q $t$_$v$$Run COMPAT RESTORE $g$g REM this marks the end of the BATCH file since EXIT will terminate the shell REM we expect this to fail on MS/PC DOS command.com so don't do it there IF NOT "%SHELL_IS_COMMAND%"=="1" TITLE Command Prompt SET SHELL_IS_CMD= SET SHELL_IS_COMMAND= SET DEV= :END ================================================ FILE: tests/ctty-nul.bat ================================================ @echo off ctty nul echo not to be seen ctty con ================================================ FILE: tests/dir-test.txt ================================================ Regression tests for dir.c -------------------------- If you add tests, please email them to normat@rpi.edu The following directories must exist: C:\TEMP, D:\TIM, C:\WINDOWS D:\TIM\C Current working directories are: C:\TEMP, D:\TIM Current drive is: C Type the command in the "From" column and make sure the files listed are what are shown in the other columns. From Drive Dir File ---- ----- --- ---- DIR C \TEMP *.* DIR \ C \ *.* DIR \windows C \windows *.* DIR d: D \tim *.* DIR d:\ D \ *.* DIR d:. D \tim *.* DIR file C \TEMP file.* DIR .ext C \TEMP *.ext DIR D:c D \tim\c *.* ================================================ FILE: tests/errlvl.bat ================================================ @echo off ECHO should print Four Three Two One Zero 3 2 1 each on its own line SET LVL=4 :loop errlvl %LVL% IF ERRORLEVEL 4 GOTO FOUR IF ERRORLEVEL 3 GOTO THREE IF ERRORLEVEL 2 GOTO TWO IF ERRORLEVEL 1 GOTO ONE echo Zero GOTO END :FOUR echo Four SET LVL=3 GOTO loop :THREE echo Three SET LVL=2 GOTO loop :TWO echo Two SET LVL=1 GOTO loop :ONE echo One SET LVL=0 GOTO loop :END errlvl 3 ECHO %ERRORLEVEL% errlvl 2 ECHO %ERRORLEVEL% errlvl 1 ECHO %ERRORLEVEL% echo Done ================================================ FILE: tests/errlvl.c ================================================ /* Returns the specified errorlevel */ #include #include main(int argc, char **argv) { if(argc != 2) { fputs("Usage: ERRLVL number\n" "Returns the specified number as errorlevel (exit code)\n" , stderr); return 127; } return atoi(argv[1]); } ================================================ FILE: tests/fdos.out ================================================ D:\FREEDOS\COM074BS\SOURCE\PACK\TEST>echo This is a test batch file This is a test batch file D:\FREEDOS\COM074BS\SOURCE\PACK\TEST>echo ECHO is on Testing with echo off D:\FREEDOS\COM074BS\SOURCE\PACK\TEST>echo Testing wih echo on Testing wih echo on D:\FREEDOS\COM074BS\SOURCE\PACK\TEST>echo off Testing : test2 p1 p2 p3 p4 Testing : p1 p2 p3 p4 Testing : p2 p3 p4 now test the environment substitution path is D:\AMI\TOOLS\MASM611\BIN;D:\AMI\TOOLS\BIN;C:\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BC45\BIN;C:\BRIEF; PATH is D:\AMI\TOOLS\MASM611\BIN;D:\AMI\TOOLS\BIN;C:\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BC45\BIN;C:\BRIEF; Absent variable is Bad format : bad format Testing double %comspec% Call another batch file... Testing : test3.bat t3p1 t3p2 t3p3 Testing : t3p1 t3p2 t3p3 Testing : t3p2 t3p3 Press any key to continue . . . . Returned to TEST2 . Testing : p2 p3 p4 Testing : p3 p4 Testing : p4 ================================================ FILE: tests/hbp001a.bat ================================================ echo on echo Root batch, echo on echo starting hbp001b call hbp001b echo root batch: I'm back, this should be echo'd echo off echo Root batch, echo off echo starting hbp001b call hbp001b echo root batch: I'm back, this should NOT be echo'd ================================================ FILE: tests/hbp001b.bat ================================================ echo This is the start of called batch echo state form caller echo on echo This should always be echoed ================================================ FILE: tests/hbp002.txt ================================================ OK, here is my implementation of the FOR command, files changed : BATCH.C BATCH.H FOR.C There is a problem running form BATCH files. Formthe command line type in something like: for %%a in (a bb ccc) do echo %%a or for %%a in (*.c) do echo %%a Put it in the next release and I'll work on fixing the batch issue. Hans 19 Jul 1998 ================================================ FILE: tests/hbp_001.txt ================================================ Minor changes to BATCH.C and BATCH.H to preserve the staets of the echo flag across batch calls. Please add HBP_001a.bat and hbp_001b.bat to test directory. 19 July 1998 Hans B Pufal ================================================ FILE: tests/label.bat ================================================ @echo off : Test if all the labels work : Usual spelling goto label1 :label1 echo Label 1 found : Prefixed colon goto :label2 :label2 echo Label 2 found : Prefixed colon seperated by whitespaces : Though 4dos searches for ' label3' here? goto : label3 :label3 echo Label 3 found ================================================ FILE: tests/longcmd.bat ================================================ command /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567 ================================================ FILE: tests/msdos.out ================================================ D:\freedos\com074bs\source\PACK\test>echo This is a test batch file This is a test batch file D:\freedos\com074bs\source\PACK\test>echo ECHO is on Testing with echo off D:\freedos\com074bs\source\PACK\test>echo Testing wih echo on Testing wih echo on D:\freedos\com074bs\source\PACK\test>echo off Testing : test2 p1 p2 p3 p4 Testing : p1 p2 p3 p4 Testing : p2 p3 p4 now test the environment substitution path is D:\AMI\TOOLS\MASM611\BIN;D:\AMI\TOOLS\BIN;C:\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BC45\BIN;C:\BRIEF; PATH is D:\AMI\TOOLS\MASM611\BIN;D:\AMI\TOOLS\BIN;C:\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BC45\BIN;C:\BRIEF; Absent variable is Bad format : bad format Testing double %comspec% Call another batch file... Testing : test3.bat t3p1 t3p2 t3p3 Testing : t3p1 t3p2 t3p3 Testing : t3p2 t3p3 Press any key to continue . . . . Returned to TEST2 . Testing : p2 p3 p4 Testing : p3 p4 Testing : p4 ================================================ FILE: tests/refl.bat ================================================ rem @echo off c: cd\reflex reflex%1 rem cls ================================================ FILE: tests/t.bat ================================================ c:\command /c test1 >msdos.out command /c test1 >fdos.out ================================================ FILE: tests/test.bat ================================================ echo echo hi, this is a test freda rem a comment pause @echo the path is %PATH% echo the path is %path% echo Batch file called as : %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 @shift echo shifted : %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 @shift down echo shifted down: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 pause echo this is bogus: %bogus% echo this is a test: %test echo echo off echo goto next echo this line will never be reached :next echo continue form here... echo END OF test.bat ================================================ FILE: tests/test1.bat ================================================ echo This is a test batch file echo @echo off echo Testing with echo off echo on echo Testing wih echo on echo off test2 p1 p2 p3 p4 echo This should not appear!! echo END OF test1.bat ================================================ FILE: tests/test2.bat ================================================ @echo off echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 echo now test the environment substitution echo path is %path% echo PATH is %PATH% echo Absent variable is %Absent% echo Bad format : %bad format echo Testing double %%comspec%% echo Call another batch file... call test3.bat t3p1 t3p2 t3p3 echo . echo Returned to TEST2 echo . echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 echo END OF test2.bat ================================================ FILE: tests/test3.bat ================================================ echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 shift echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8 pause echo END OF test3.bat ================================================ FILE: tests/test4.bat ================================================ dir > q1 dir >> q1 sort q1s dir | sort >>q1s echo END OF test4.bat ================================================ FILE: tests/testenv.c ================================================ #include #include /* OW does not seem to support *env[] arg to main */ extern char **environ; int main(int argc, char *argv[], char *env[]) { int count; puts("Commandline:"); for (count = 0; count < argc; count++) printf("%d: %s\n", count, argv[count]); puts("\nEnvironment:"); for (count = 0; environ[count] != NULL; count++) printf("%d: %s\n", count, environ[count]); putenv("PATH="); puts("\nEnvironment after a setenv (\"PATH=\");:"); for (count = 0; environ[count]; count++) printf("%d: %s\n", count, environ[count]); return 0; } ================================================ FILE: tests/tst-if.bat ================================================ @echo off : IF test script cls ECHO. ECHO TEST SCRIPT FOR THE IF COMMAND ECHO. ECHO Testing the EXIST format ECHO. ECHO It is assumed that the file TST-IF.BAT does exist, but ECHO NICHT-DA.TGL does not exist ECHO. if exist tst-if.bat echo File TST-IF.BAT exists ((OK)) if not exist tst-if.bat echo File TST-IF.BAT does not exist ((ERROR!!??)) if exist nicht-da.tgl echo File NICHT-DA.TGL exists ((ERROR!!??)) if not exist nicht-da.tgl echo File NICHT-DA.TGL does not exist ((OK)) echo. echo You should see "((OK))" two times echo. echo If you see an ERROR, check if the specified file is really echo not there (TST-IF.BAT) or really is there (NICHT-DA.TGL) echo. pause cls ECHO Testing the ERRORLEVEL format ECHO. if exist errlvl.exe goto err_OK if exist errlvl.com goto err_OK echo Cannot find an executable of the ERRLVL program, please echo compile it, in order to run this test goto err_SKIP :err_OK errlvl 0 ::echo Errorlevel %? (must be '0') echo Errorlevel %errorlevel% (must be '0') if not errorlevel 1 echo Probe #1 passed if errorlevel 1 echo Probe #2 failed errlvl 15 ::echo Errorlevel %? (must be '15') echo Errorlevel %ERRORLEVEL% (must be '15') if errorlevel 15 echo Probe #3 passed if errorlevel 16 echo Probe #4 failed if errorlevel 14 echo Probe #5 passed echo. echo You should see passed probes 1, 3,& 5 and no failed one. echo Also make sure that the displayed errorlevels match the one echo mentioned as "must be 'XX'" echo. pause cls ECHO Testing the == format ECHO. if 1==1 echo Probe #1 passed if 2==1 echo Probe #2 failed if not 1==2 echo Probe #3 passed if not 1==1 echo Probe #4 failed if 1 == 1 echo Probe #5 passed if 1 == 2 echo Probe #6 failed if 1 ==1 echo Probe #7 passed if 1 ==2 echo Probe #8 failed if 1== 1 echo Probe #9 passed if 1== 2 echo Probe #10 failed if not 1=="1" echo Probe #11 passed if not "1 2 3 4"=="1 2 3 4" echo Probe #12 failed if "1 2 3 4"=="1 2 3 4" echo Probe #13 passed echo. echo You should see passed probes 1, 3, 5, 7, 9, 11,& 13 and no failed one echo. pause cls ECHO Testing /I and NOT options ECHO. if NOT a==A echo Probe #1 passed if /I a==A echo Probe #2 passed if /I NOT a==A echo Probe #3 failed if NOT /I a==A echo Probe #4 failed if /i b==A echo Probe #5 failed if not /i not b==A ECHO Probe #6 passed if /i a==A echo Probe #7 passed if /i not exist nicht-da.tgl echo Probe #8 passed if /i exist nicht-da.tgl echo Probe #9 failed if not exist nicht-da.tgl echo Probe #10 passed echo. echo You should see passed probes 1, 2, 6, 7, 8, & 10 and no failed ones echo. pause cls ECHO Testing incomplete COMMAND ECHO you should see multiple error messages "IF: Missing command" or similar message ECHO. REM [a==a], [a==a ], [a==a] note the middle one has a space before the end of line and other 2 do not if a==a ECHO Next 3 commands should fail if a==a if a==a if a==a echo. pause cls echo Testing " and extra characters included with == echo . if "a=="a echo Probe #1 passed if "a == "a echo Probe #2 passed if a "== a echo Probe #3 passed if a garbage== a echo Probe #4 passed if a garbage==garbage a echo Probe #5 failed if .a == .a echo Probe #6 passed if " a==" a echo Probe #7 failed, a is not a valid command if " echo==" echo Probe #8 passed echo . echo You should see passed probes 1,2,3,4,6,& 8 with 7 giving a bad command error pause echo. echo Test finished ================================================ FILE: tests/tstcmdln.bat ================================================ @ECHO OFF mkdir "a long dir" > NUL copy testenv.exe "a long dir\testenv.exe" > NUL "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. ECHO CMDLINE should start with quoted "a long dir\testenv.exe" del "a long dir\testenv.exe" > NUL rmdir "a long dir" > NUL ================================================ FILE: tools/28.asm ================================================ org 100h mov ax, 1111h xor bl, bl int 10h ret ================================================ FILE: tools/50.asm ================================================ org 100h mov ax, 1112h xor bl, bl int 10h ret ================================================ FILE: tools/debug.h ================================================ #include "../debug.h" ================================================ FILE: tools/depend.mk ================================================ tools .SEQUENTIAL : utils err_fcts.h strings context lib tools_dir default.mk : ../config.h ..\utils\mktools.exe >$@ tools_dir .SETDIR=tools : default.mk @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += tools_clean tools_clean .SETDIR=tools : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += tools_clobber tools_clobber .SETDIR=tools : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += tools_dist tools_dist .SETDIR=tools : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: tools/files.txt ================================================ Implementation of tools useful for FreeCOM at run-time PTCHSIZE tool to display/restrict the default heap of FreeCOM PTCHLDRV tool to change the drive the FEATURE_CALL_LOGGING creates the logfile on. LOAD_ICD tool to load samples of Installable Commands ICMD_*.NAS NASM sources of samples of Installable Commands ICMD_TPL.NAS template of samples of Installable Commands ICMD_INC.INC command code shared by all samples of Installable Commands KSSF.ASM Kernel Swap Support Faker VSPAWN.ASM VSpawn - KSSF #2 ================================================ FILE: tools/icmd_1.nas ================================================ ;; Installable Command sample #1 ;; ;; Echo command line arguments to screen via INT-10-0E ;; %macro icmdAction 0 mov ax, ds mov es, ax xor ax, ax mov BYTE [si], al ;; zero the length byte --> shell stops interprete inc bx mov al, [bx] mov cx, ax inc bx call oString %endmacro %macro icmdComment 0 DB 'Displays command line and outputs lots of debug information' %endmacro %macro icmdStuff 0 %endmacro ;; include the ICMD template %include 'icmd_inc.inc' ================================================ FILE: tools/icmd_2.nas ================================================ ;; Installable Command sample #2 ;; ;; Do nothing --> if named as an internal command --> disables it ;; %macro icmdAction 0 mov ax, ds mov es, ax mov ax, cs mov ds, ax mov di, si mov si, newCommandName mov cx, newCommandNameEnd - newCommandName rep movsb %endmacro %macro icmdComment 0 DB 'Do nothing (disabling internal command) and outputs lots of debug information' %endmacro %macro icmdStuff 0 newCommandName: DB 0, 'REM ' newCommandNameEnd: %endmacro ;; include the ICMD template %include 'icmd_inc.inc' ================================================ FILE: tools/icmd_3.nas ================================================ ;; Installable Command sample #3 ;; ;; Maps the command into ECHO. ;; ;; %define DEBUG_ME 1 %ifdef DEBUG_ME mov ax, cs add ax, 10h mov ds, ax mov es, ax push ax mov ax, start push ax mov di, myNameLen mov si, tstName xor cx, cx mov cl, [si] inc cl cld rep movsb mov ax, 0ae01h mov bx, tstLine mov si, tstName mov dx, -1 mov es, dx mov cx, 5678h retf tstLine: DB 128,11,'TST11 12345',13,0 times 130-($-tstLine) DB 0 tstName: DB 5,'TST11' times 7 DB ' ' start: %endif %macro icmdAction 0 ; adjust command line buffer mov ax, ds mov es, ax xor ax, ax mov al, [si] ;; icmd's own length sub al, [CS:newCommandName] jz act0 ; nothing to do jc act2 ; command line grows ; command line shrinks inc bx sub BYTE [bx], al jc error inc bx mov di, bx add bx, ax mov al, [di-2] mov cx, ax mov si, bx rep movsb jmp short act5 error: mov ax, cs mov es, ax mov bx, errString call oASCIIZ mov bx, [bp+6] mov ds, [bp+2] mov BYTE [bx], 0 jmp short actEnde act2: ; command line grows mov ch, ah inc bx sub BYTE [bx], al jnc error mov di, bx dec ah add bx, ax mov cl, [di-1] cmp cl, [di] jc error add di, cx add bx, cx std mov si, bx rep movsb inc di sub cx, ax mov al, '.' rep stosb act5: act4: act0: mov es, [bp+2] mov ax, cs mov ds, ax mov di, [bp+6] mov si, newCommandName xor ax, ax mov al, [si] ;; get new command's length of name inc al ;; this byte itself mov cx, ax cld rep movsb actEnde: %endmacro %macro icmdComment 0 DB 'Maps the command into ECHO. and outputs lots of debug information' %endmacro %macro icmdStuff 0 newCommandName: DB 4, 'ECHO' errString: DB 7,'Command line buffer over- or underflow',13,10,0 %endmacro ;; include the ICMD template %include 'icmd_inc.inc' ================================================ FILE: tools/icmd_inc.inc ================================================ ;; Installable Command sample template ;; ;; DS:BX :- command line buffer ;; DS:SI :- command name buffer ;; DX == 0xFFFF :- magic number cmp dx, 0ffffh ;; probe magic number jne chain3 pusha ;; DI -4, SI -6, BP-8, SP-10, BX-12, DX-14, CX-16, AX-18 push ds ;; -2 push es ;; 0 mov bp, sp cmp ah, 0aeh jne chain or al, al je check cmp al, 1 je perform chain: chain2: pop es pop ds popa chain3: jmp word 0:0 chain_addr: check: mov di, sFctCheck call amicalled jc chain2 pop es pop ds popa dec al ;; AL := 0xFF :- OK, it's me iret perform: mov di, sFctPerform call amicalled jc chain2 mov ds, [bp+2] mov bx, [bp+12] mov si, [bp+6] icmdAction mov ds, [bp+2] mov bx, [bp+12] mov si, [bp+6] mov di, sFctReturn call amicalled pop es pop ds popa iret amicalled: mov bx, cs mov es, bx cld mov bx, di call oASCIIZ mov bx, sCmd call oASCIIZ mov es, [bp+2] mov bx, si call oPStringAddr mov bx, cs mov es, bx mov bx, sNL call oASCIIZ mov bx, sLine call oASCIIZ mov bx, [bp+12] inc bx mov es, [bp+2] call oPStringAddr mov bx, sNL call oASCIIZ mov di, myName-1 xor cx, cx mov cl, [SI] inc cx repe cmpsb jne notme mov bx, sIsMe call oASCIIZ clc ret notme: mov bx, sIsNotMe call oASCIIZ stc ret oMyName: push cx push bx mov cl, [ES:myNameLen] mov ch, 0 mov bx, myName call oString pop bx pop cx jmp short oStr1 oPStringAddr: call oESBX oPString: mov cl, [ES:BX] mov al, cl call oAL inc bx mov ch, 0 jmp short oString oASCIIZ: mov cx, -1 oString: mov al, [ES:bx] inc bx or al, al je oStr2 cmp al, 1 je oMyName mov ah, 0eh push bx push bp mov bx, 7 int 10h pop bp pop bx oStr1: loop oString oStr2: ret oAL: push bx push cx mov bx, sB call convALtoBX mov bx, sByte mov cx, 4 push es mov ax, cs mov es, ax call oString pop es pop cx pop bx ret oESBX: push cx push es push bx mov ax, es mov bx, sAddr call convAXtoBX pop ax push ax mov bx, sAddr2 call convAXtoBX mov cx, 9 mov ax, cs mov es, ax mov bx, sAddr call oString pop bx pop es pop cx ret convAXtoBX: push ax mov al, ah call convALtoBX inc bx pop ax convALtoBX: push ax shr al, 4 call convLowALtoBX inc bx pop ax convLowALtoBX: and al, 0fh cmp al, 10 jc conv1 add al, 'A' - '0' - 10 conv1: add al, '0' conv3: mov BYTE [CS:bx], al ret icmdStuff sFctCheck: DB '>>', 1, ': check' sNL: DB 13, 10, 0 sAddr: DB 0,0,0,0, ':' sAddr2: DB 0,0,0,0 sByte: DB '<' sB DB 0, 0, '>' sFctPerform: DB '>>', 1, ': perform', 13, 10, 0 sFctReturn: DB '>>', 1, ': return', 13, 10, 0 sCmd: DB '>>', 1, ': command name: ', 0 sLine: DB '>>', 1, ': command line: ', 0 sIsMe: DB '>>', 1, ': -- is me --', 13, 10, 0 sIsNotMe: DB '>>', 1, ': -- is NOT me --', 13, 10, 0 myNameLen: DB 0 myName: DB 0 DW chain_addr - 4 DW myNameLen DB 0 icmdComment DB 'INSTALLABLE COMMAND - ICD v1.0' ================================================ FILE: tools/icmd_tpl.nas ================================================ ;; Installable Command sample template ;; ;; ;; %macro icmdAction 0 pusha <<<<<<<< Action performed within MUX-AE-01 >>>>>>>>>>>>> popa %endmacro %macro icmdComment 0 DB '<<<<<<<<<<<<<<<< Comment record >>>>>>>>>>>>>>>>>>' %endmacro %macro icmdStuff 0 <<<<<<<<<<<<<< Stuff required by Action >>>>>>>>>>>>>>>> %endmacro ;; include the ICMD template %include 'icmd_inc.inc' ================================================ FILE: tools/kssf.asm ================================================ ;; $Id$ ; Kernel Swap Support Faker ; Useage: kssf freecom [{ arguments }] ; "freecom" is the absolute path to FreeCOM -- including drive, path ; and extenstion ; arguments are any arguments to passed to FreeCOM ; This program fakes all interrupts and behaviour assumed by FreeCOM ; to use the kernel swap support. See DOS\K-SWAP.TXT for more details. %include "../context.inc" STACK_SIZE EQU 64 %define tsrend (tsrend_ - start + 100h + ((tsrend_ - start) & 1)) ABSOLUTE 5ch ; where the temp variables do reside execBlock: eb_envseg RESW 1 eb_cmdline RESD 1 eb_fcb RESD 2 shellCmdLine RESB 2 context RESW 1 ctxt_owner RESW 1 origParent RESW 1 cmd_buf: SEGMENT .text ORG 100h ; this is an executable program, but as small as possible start: jmp goon %ifdef DEBUG strExiting DB 13, 10, 'Exiting KSSF' strNL DB 13, 10, '$', 0 strNotMe DB 'The current PSP is not me!', 7, 13, 10, '$', 0 %endif errString DB 13, 10, 'Failed to execute shell - ' DB 'Exiting Kernel Swap Support Faker.', 7, 13, 10 DB 'Press any key to preceed ...', 13, 10 DB '$', 0 errExecShell: ; Failed to execute the shell mov dx, errString mov ah, 9 int 21h mov ah, 7 int 21h jmp exit err2: jmp err2_ tsrstart: mov ah, 4ah ; Resize memory int 21h jc err2 mainloop: xor ax, ax mov WORD [ES:ctxt_owner], ax ; let the shell brand this KSSF mov bx, execBlock mov ah, 4bh ; load & run shell int 21h mov sp, tsrend + STACK_SIZE ; standard stack position mov ax, cs mov ds, ax jc errExecShell ; failed to execute the shell ;; Run external program if one exists mov ax, [context] or ax, ax jz exit ; no context -> terminate kssf mov es, ax mov ax, [ES:?envSegm] mov WORD [eb_envseg], ax ; applies to shell & prg mov ax, [ES:?prg + 2] ; segment of program name or ax, ax jz execShell ;; execute external program mov dx, [ES:?prg] ; offset of program name les bx, [es:?cmdline] ; pointer to command line mov WORD [eb_cmdline], bx mov WORD [eb_cmdline+2], es mov bx, cs mov es, bx mov bx, execBlock mov ds, ax mov ax, 4b00h int 21h ; execute external program jc execPrg1 xor ax, ax ; no error execPrg1: mov sp, tsrend + STACK_SIZE ; standard stack position mov dx, cs mov ds, dx mov es, [context] mov [ES:?execErr], ax ; error code of DOS-4B API execShell: mov ax, shellCmdLine mov [eb_cmdline], ax mov ax, cs mov [eb_cmdline+2], ax lds dx, [ES:?shell] mov es, ax mov ax, ds ; probe if a name exists or ax, ax jne mainloop exit: ; exit kssf mov ax, cs mov ds, ax ; ensure DS == PSP %ifdef DEBUG mov dx, strExiting mov ah, 9 int 21h mov ah, 62h int 21h mov ax, cs cmp ax, bx je dbg_1 mov dx, strNotMe mov ah, 9 int 21h dbg_1: %endif mov ax, WORD [origParent] ; restore parentPSP to original value mov WORD [ds:16h], ax mov ax, [context] ; let context be deallocated, too or ax, ax jz exit_noCtxt dec ax mov es, ax ; MCB of context mov WORD [ES:1], ds ; owner of context := kssf mov ax, [ES:10h+?envSegm] ; environment segm or ax, ax jz exit_noCtxt dec ax mov es, ax ; MCB of env segm mov WORD [ES:1], ds ; owner of env segm := kssf exit_noCtxt: lds dx, [old_isr21] ; old INT-21 mov ax, 2521h int 21h ; install old handler mov ax, 4c00h int 21h int 20h isr21: ;; DOS interrupt chain cmp dx, 'FD' ;; magic number jne isr21_chain cmp ax, 4bfeh je isr21_do cmp ax, 4bfdh je isr21_do isr21_chain: jmp 0:0 old_isr21 EQU $-4 isr21_do: push ds push cs pop ds push bp mov bp, sp ;; BP+8 == flags push dx push ax mov dx, bx ;; new context mov ah,62h ; get current PSP int 21h mov ax, [ctxt_owner] or ax, ax jnz isr21_1 ;; first call --> brand the KSSF to this process mov WORD [ctxt_owner], bx isr21_1: xchg bx, dx pop ax cmp al, 0feh mov ax, [ctxt_owner] je isr21_getCtxt ;; set Ctxt cmp ax, dx jne isr21_noAcc isr21_setCtxt: xchg [context], bx jmp short isr21_ok isr21_getCtxt: mov bx, [context] cmp ax, dx jne isr21_noAcc isr21_ok: and BYTE [bp+8], 0feh ; clear Carry flag %ifdef DEBUG mov ax, cs ; our PSP / PID %endif isr21_iret: pop dx pop bp pop ds iret isr21_noAcc: or BYTE [bp+8], 1 ; set Carry flag mov ax, 5 jmp short isr21_iret tsrend_: err2_: mov dx, errResize jmp errOut goon: ;; Initialization a.s.o. ; Decode command line argument list mov ax, cs ; Get PSP mov ds, ax mov ax, 3521h int 21h ; Get interrupt vector mov WORD [old_isr21], bx mov WORD [old_isr21+2], es mov dx, isr21 mov ax, 2521h int 21h ; Set interrupt vector %ifdef DEBUG call printLoadSegm %endif mov ax, cs mov es, ax xor ax, ax mov di, execBlock mov cx, cmd_buf - execBlock rep stosb ; erase the execBlock mov BYTE [shellCmdLine+1], 0dh mov bx, 80h ; length byte of command line mov al, [bx] inc al add bx, ax ; end of line mov BYTE [bx], 0dh ; even if length == 126, ; the first byte of program is unsed mov si, 81h ; command line fcom1: lodsb cmp al, 0dh ; end of line je err1 cmp al, ' '+1 ; whitespaces jc fcom1 cmp al, '/' ; KSSF /y COMMAND.COM if F8 during CONFIG.SYS jne noY cmp byte [si], 'Y' jne noY inc byte [haveY] inc si jmp short fcom1 noY: ;; Copy the command to an unused place, because between command and ;; argument list two bytes must be inserted. mov dx, cmd_buf ; where the command is temporarily stored to mov di, dx fcom_cpy: stosb lodsb cmp al, ' ' + 1 jnc fcom_cpy mov BYTE [di], 0 ; end of command name mov ax, bx ; BX == end of command line ; SI == begin of command line + 1 dec si ; correction for SI + 1 cmp byte [haveY], 0 je noAddY ;; preserve the /Y cmp byte [si], 0dh je ignEOS mov byte [si], ' ' ignEOS: dec si mov byte [si], 'Y' dec si mov byte [si], '/' noAddY: sub ax, si ; length of remaining command line dec si ; position to the length byte mov BYTE [si], al ; prefixed the command line tail with the length byte mov WORD [eb_cmdline], si ; DWORD eb_cmdline := DS:SI mov WORD [eb_cmdline+2], ds mov ax, cs ;; mov WORD [ds:16h], cs ; set our owner to ourselves <-> shell hack xchg WORD [ds:16h], ax ; set our owner to ourselves <-> shell hack mov WORD [origParent], ax ;; DS:DX == command name ;; execBlock is filled mov bx, (tsrend + STACK_SIZE + 15) / 16 ; := number of paragraphes ; required for TSR and stack mov sp, tsrend + STACK_SIZE ; new stack size jmp tsrstart err1: mov dx, useage errOut: mov ah, 9 int 21h mov ah, 7 int 21h mov ax, 4c03h int 21h int 20h useage DB 7, 'Useage: KSSF freecom [{ arguments }]', 13, 10 DB 9, 'freecom: absolute filename of FreeCOM', 13, 10 DB 9, 'arguments: any optionally arguments or options', 13, 10 DB 'Spawns FreeCOM and fakes the necessary kernel functions for', 13, 10 DB 'the Kernel Swap Support', 7, 13, 10, '$' errResize DB 7, 'Failed to resize KSSF memory block', 13, 10, '$' haveY DB 0 %ifdef DEBUG printLoadSegm: mov dx, dbgStr1 mov ah, 9 int 21h mov ax, cs call printWord mov dl, ':' mov ah, 2 int 21h mov ax, isr21 call printWord mov dx, dbgStr2 mov ah, 9 int 21h ret printWord: push ax mov al, ah call printByte pop ax printByte: push ax shr al, 4 call printNybble pop ax printNybble: and al, 0fh add al, '0' cmp al, '0' + 10 jc print1 add al, 'A' - '0' - 10 print1: mov dl, al mov ah, 2 int 21h ret dbgStr1 DB 'KSSF loaded at ', '$' dbgStr2 DB 10, 13, '$' %endif ;;END ================================================ FILE: tools/load_icd.c ================================================ /* $Id$ Load Installable Commands samples into memory */ #include #include #include #include #include "../config.h" #include "suppl.h" #include "portable.h" #if defined(_TC_EARLY_) # include "fmemory.h" #endif #define BUFFER_SIZE 10*1024 const char id[] = "INSTALLABLE COMMAND - ICD v1.0"; int main(int argc, char **argv) { unsigned char *buf, *h; size_t len, offName, offPtr; unsigned *p; FILE *f; char *q; IREGS r; unsigned char _seg *icmd; if(argc != 2) { puts("Load Installable Commands (FreeCOM shell extensions)"); fputs("\nUseage: ", stdout); fputs(argv[0], stdout); puts(" command"); return 127; } if((buf = malloc(BUFFER_SIZE)) == NULL) { puts("Cannot allocate transfer buffer - Out of memory"); return 33; } if((f = fopen(argv[1], "rb")) == NULL) { strcpy(stpcpy((char*)buf, argv[1]), ".icd"); if((f = fopen((char *)buf, "rb")) == NULL) { fputs("Cannot open file: ", stdout); puts(argv[1]); return 34; } } len = fread(buf, 1, BUFFER_SIZE, f); if(ferror(f) || len == (size_t)-1 || len < sizeof(id) + 4) { fputs("Error reading command: ", stdout); puts(argv[1]); return 35; } fclose(f); if(len == BUFFER_SIZE) { fputs("Command too large: ", stdout); puts(argv[1]); return 36; } h = &buf[len - (sizeof(id) - 1)]; if(memcmp(h, id, sizeof(id) - 1)) { puts("File does not contain a valid Installable Command"); return 37; } *h = 0; while(--h > buf && *h); if(h == buf) { puts("File does not contain a valid Installable Command"); return 39; } p = (unsigned*)h; offName = *--p; offPtr = *--p; if(*++h) { puts("Installable Command comment record:"); puts((char*)h); } if(offName > len - sizeof(id) + 1 || offPtr > len - sizeof(id) + 1) { puts("File does not contain a valid Installable Command"); return 38; } /* Add Installable Command name */ for(q = strchr(argv[1], 0); --q >= argv[1] && *q != ':' && *q != '\\'; ) if(*q == '.') *q = 0; ++q; if(!strlen(q) || strlen(q) > sizeof(id) - 2) { puts("Invalid filename syntax"); return 40; } strupr(q); buf[offName] = (unsigned char)strlen(q); strcpy((char*)&buf[offName + 1], q); len = offName + strlen(q) + 2; r.r_ax = 0x352f; intrpt(0x21, &r); *(void far**)&buf[offPtr] = MK_FP(r.r_es, r.r_bx); /* Add into memory */ r.r_ax = 0x4800; r.r_bx = (len + 15) / 16; intrpt(0x21, &r); if(r.r_flags & 1) { puts("Error allocating memory for resident portion of command"); return 41; } icmd = MK_SEG_PTR (unsigned char, r.r_ax - 1); *(unsigned far *)&icmd[1] = 8; /* make it system property */ _fmemcpy(&icmd[8], &buf[offName + 1], 8); _fmemcpy(&icmd[16], buf, len); r.r_ds = r.r_ax; r.r_dx = 0; r.r_ax = 0x252f; intrpt(0x21, &r); printf("Installable Command %s loaded to 0x%04x\n" , &buf[offName + 1], r.r_ds); return 0; } ================================================ FILE: tools/makefile ================================================ # $Id$ # # Makefile for tools of the FreeDOS kernel's command interpreter # # There is no default target!! # # Available main targets: # ptchldrv.exe - patch log drive # icmd - Installable Commands samples # # # $Log$ # Revision 1.9 2004/06/29 14:14:57 skaus # fix: help screen of internal commands causes "Unknown command error" {Bernd Blaauw} # # Revision 1.8 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.7 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # .IF $(NASM) == $(NULL) .INCLUDE : ../_config.mk .ENDIF INCDIR +=;$(FREEDOS)\SRC\INCLUDE;.. # LIBDIR +=;$(FREEDOS)\SRC\LIB\$(_COMPILER) LDLIBS = $(FREEDOS)\SRC\LIB\$(_COMPILER)\Suppl_$(_MODEL).lib LDFLAGS += /msl # Project specific C compiler flags MYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1) MYCFLAGS_NDBG = MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG)) # Project specific NASM compiler flags NASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s NASMFLAGS_NDBG = -s NASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG)) .SOURCE.h := . .. .SOURCE.lib := $(LIBDIR:s/;/ /:u) .IF $(FRREDOS) == $(NULL) .IMPORT : FREEDOS .ENDIF # Sources of this make target .IF $(MAKETARGETS:s/all//) == $(NULL) # Default target # Required only, if no targets were specified on command line .INCLUDE : default.mk ## all: ptchldrv.exe kssf.com icmd error: errlvl 127 .ENDIF dist : ; icmd : load_icd.exe icmd_{1 2 3}.icd %.icd : %.nas ; $(NASM) -f bin -o $@ $< icmd_1.icd : icmd_inc.inc icmd_1.nas icmd_2.icd : icmd_inc.inc icmd_2.nas icmd_3.icd : icmd_inc.inc icmd_3.nas icmd_4.icd : icmd_inc.inc icmd_4.nas .INIT : $(CFG) __errl __errl: @+-if exist errlist del errlist >nul -ctags *.c ptchldrv.obj : ptchldrv.c vspawn.com : vspawn.asm $(NASM) $(NASMFLAGS) -f bin -o $@ $(MYASMFLAGS) $< kssf.com : kssf.asm $(NASM) $(NASMFLAGS) -f bin -o $@ $(MYASMFLAGS) $< load_icd.obj : load_icd.c .INCLUDE : makefile.1 ================================================ FILE: tools/makefile.1 ================================================ # $Id$ # all : clobber : clean $(RM) $(RMFLAGS) *.exe *.com *.icd default.mk lastmake.mk *.cfg clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) *.dmp ================================================ FILE: tools/ptchldrv.c ================================================ /* $Id$ Patch log drive This little utitilty patches the drive letter COMMAND.COM creates its log file on. 2000/01/05 ska started as of implementation of the start logging feature */ #include #include #include /* Aquire LOG_FILE, the name of the logfile */ #include "../config.h" static char logFilename[] = LOG_FILE; static char hbuf[] = LOG_FILE; static char buf[sizeof(logFilename) - 1]; main(int argc, char **argv) { long stringpos; char *fnam; FILE *f; int fill, ch; char ibuf[1024]; if(argc > 2 || argc == 2 && (strlen(argv[1]) != 1 || !isalpha(argv[1][0]))) { puts("Patches the drive letter FreeCom.COM creates its logfile on\nUsage: PTCHLDRV [drive_letter]"); return 40; } if((f = fopen(fnam = "com.com", "r+b")) == NULL && (f = fopen(fnam = "com.exe", "r+b")) == NULL && (f = fopen(fnam = "command.com", "r+b")) == NULL) { puts("Cannot find COMMAND.COM"); return 41; } printf("File \"%s\" successfully opened.\n", fnam); /* Search for the position of the logFilename within the image */ stringpos = 0; fill = 0; do { /* fill the buffer */ if(fill != sizeof(buf) && fread(buf + fill, sizeof(buf) - fill, 1, f) != 1) break; if(memcmp(logFilename + 1, buf, sizeof(buf)) == 0) { if(stringpos) { puts("The opened file contains the logfilename multiple times.\nThis file cannot be patched."); return 42; } stringpos = ftell(f); if(stringpos == -1L) { puts("General access error.\n"); return 44; } stringpos -= sizeof(logFilename); } /* Read-in the next chunk */ if((fnam = memchr(buf + 1, logFilename[1], sizeof(buf) - 1)) == NULL) fill = 0; else { fill = sizeof(buf) - (fnam - buf); memmove(buf, fnam, fill); } } while(1); if(!stringpos) { puts("The logfilename could not be located within the opened file.\nThis can happen, if FEATURE_CALL_LOGGING was disabled,\nwhen FreeCom was compiled."); return 43; } if(fseek(f, stringpos, SEEK_SET)) { puts("Cannot seek to logfilename.\n"); return 45; } if(fread(hbuf, sizeof(hbuf), 1, f) != 1) { puts("Reading of logfilename failed.\n"); return 46; } if(memcmp(hbuf + 1, logFilename + 1, sizeof(hbuf) - 1) != 0) { puts("Unexpected change in file.\n"); return 47; } if(!isalpha(*hbuf)) { puts("Invalid drive letter within logfilename.\nFreeCom must be re-compiled."); return 50; } printf("Current drive letter the logfile is created on: %c\n", *hbuf); if(argc == 2) { printf("The drive letter shall be changed to: %c\n", ch = argv[1][0]); if(toupper(*hbuf) == toupper(ch)) { puts("No modification necessary."); return 0; } if(ferror(f)) { puts("General access error on file."); return 47; } 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: "); if(fgets(ibuf, sizeof(ibuf), stdin) == NULL || ibuf[4] != '\0' || strcmp(ibuf, "yes\n") != 0) { puts("The input does not match \"yes\" --> Abort.\nThe file has not been modified."); return 60; } puts("\n\nProceed patching..."); if(fseek(f, stringpos, SEEK_SET)) { puts("Cannot seek to logfilename.\n"); return 48; } *logFilename = ch; if(fwrite(logFilename, 1, 1, f) != 1 || ferror(f)) { puts("Patching failed!\nThis file cannot be used no longer!"); return 49; } fclose(f); puts("File patched successfully."); } return 0; } ================================================ FILE: tools/ptchsize.c ================================================ /* $Id$ Patch heap size into FreeCOM executable Useage: PTCHSIZE freecom [{ size }] Without any argument: Display the internal information Else: patch the executable if the sum of "size" arguments evaluates to zero, the estimated minimum heap size is used. */ #undef DEBUG #include #include #include #include #include #include "../include/res.h" #include "../include/infores.h" FILE *freecom = 0; unsigned char *info = 0; unsigned infoLen = 0; unsigned long minSize; struct { unsigned alias, hist, dirs, bufsize, extraSpace; #ifdef __LP64__ unsigned int heapPos; #else unsigned long heapPos; #endif } ival; #define PTCHSIZE #include "../lib/res_r.c" /* make a single file project */ int getInfo (res_majorid_t major, res_minorid_t minor, unsigned long length, int fd, void *const arg) { (void)arg; if(major == RES_ID_INFO && minor == 0) { if(length >= INT_MAX) { puts("Info resource is too large"); return 100; } if((info = malloc(infoLen = (unsigned)length)) == 0) { puts("Out of memory"); return 101; } if(read(fd, info, (unsigned)length) != (unsigned)length) { puts("Read error from file"); return 102; } return 1; /* Success */ } return 0; /* Proceed */ } #define err(num) err_(i, (num)) void err_(int i, int num) { printf("Info resource corrupted at offset %u\n", i); exit(num); } void getInfoValues(void) { int i; unsigned *pu; ival.alias = ival.hist = ival.dirs = ~0; ival.extraSpace = 2 * 1024 / 16; ival.bufsize = 256; ival.heapPos = ~0; assert(sizeof(ival.heapPos) == 4); for(i = 0; i < infoLen; i += 1 + info[i]) { if((unsigned long)i + 1 + info[i + 1] > infoLen) err(81); switch(info[i++]) { case INFO_END: return; case INFO_POS_HEAPLEN: if(info[i] != 4) err(82); memcpy(&ival.heapPos, &info[i + 1], 4); break; case INFO_ALIASES: pu = &ival.alias; valUnsigned: if(info[i] != 2) err(83); memcpy(pu, &info[i + 1], 2); break; case INFO_HISTORY: pu = &ival.hist; goto valUnsigned; case INFO_DIRSTACK: pu = &ival.dirs; goto valUnsigned; case INFO_BUFSIZE: pu = &ival.bufsize; goto valUnsigned; case INFO_EXTRA_SPACE: pu = &ival.extraSpace; goto valUnsigned; default: printf("Warning: Unknown info tag found: %u\n", info[i - 1]); } } } void prUns(unsigned val, char *name) { fputs(name, stdout); if(val == (unsigned)~0) puts(" not included or in separated segment"); else printf(" default buffer size: %u\n", val); } #define addUns(val) addUns_(&minSize, (val)) void addUns_(unsigned long *minVal, unsigned val) { if(val != (unsigned)~0) *minVal += val; } void addSize(unsigned short *size, char * const Xp) { unsigned long n; char *p = Xp; if(memcmp(p, "+", 2) == 0) n = minSize; else { n = 0; if(*p == '+') ++p; if(*p == '0' && toupper(p[1]) == 'X') { /* parse hexadecimal */ ++p; while(isxdigit(*++p)) if(isdigit(*p)) n = n * 16 + *p - '0'; else n = n * 16 + toupper(*p) - 'A' + 10; } else { /* parse decimal */ while(isdigit(*p)) n = n * 10 + *p++ - '0'; } if(toupper(*p) == 'K') { n *= 1024; ++p; if(toupper(*p) == 'B') ++p; } if(*p) { printf("Number parse error: %s\n", Xp); exit(103); } } if(n > USHRT_MAX || (n + *size) > USHRT_MAX) { puts("Sum of sizes exceed 64KB"); exit(104); } *size += (unsigned)n; } int main(int argc, char **argv) { struct EXE_header exe; unsigned short tosize; if(argc <= 1) { puts("Patch heap size into FreeCOM executable\n" "\nuseage: PTCHSIZE freecom [{ size }]\n" "\nSize may be given hexadecimal (0x###) or decimal.\n" "If 'KB' is appended to size, it's multiplied with 1024.\n" "A leading plus sign is ignored.\n" "A plus sign by its own is treated as estimated minimum size.\n" "More than one sizes are summed up.\n" "If size evaluates to 0 (zero), the restriction is disabled.\n" "\ne.g.: PTCHSIZE freecom + 5K\n" "means: reserve 5*1024 bytes in addition to minimum size." ); return 127; } if(enumFileResources(argv[1], RES_ID_INFO, getInfo, 0) != 1) { puts("Failed to locate FreeCOM's info resource\n" "Possible errors:\n" "\tAn error is issued above.\n" "\tThe file could not be opened.\n" "\tThe version of FreeCOM is too old.\n" "\tFile read error."); return 80; } if((freecom = fopen(argv[1], "r+b")) == 0) { printf("Cannot open FreeCOM: %s\n", argv[1]); return 30; } if(fread(&exe, sizeof(exe), 1, freecom) != 1) { printf("Read error from: %s\n", argv[1]); return 44; } /* exe.extraMin is not trustworthy as it might have been tweak in a previous run */ assert(info); /* Decompose the info resource */ getInfoValues(); minSize = 5 * (unsigned long)ival.bufsize /* command lines */ + 3 * (64 + 3 + 8 + 5) /* filenames */ + 256 /* env var buffer %PATH% etc */ ; addUns(ival.alias); addUns(ival.hist); addUns(ival.dirs); if(minSize > USHRT_MAX) { puts("Estimated minimum heap size exceeds 64KB.\n" "There is most probably a corrupted info resource."); return 71; } if(argc == 2 #ifndef GCC || ival.heapPos == ~0 #endif ) { prUns(ival.alias, "Aliases"); prUns(ival.hist, "Command line history"); prUns(ival.dirs, "Directory stack"); prUns(ival.bufsize, "Command line buffer"); if(ival.heapPos == ~0) puts("Missing heap position -> cannot change heap size"); else { if(fseek(freecom, ival.heapPos, SEEK_SET) != 0) { printf("Failed to seek to heap size offset in %s\n", argv[1]); return 43; } assert(sizeof(tosize) == 2); if(fread(&tosize, sizeof(tosize), 1, freecom) != 1) { puts("Failed to read heap size from FreeCOM executable."); return 76; } fclose(freecom); if(tosize) printf("Heap size restricted to %u bytes\n" , tosize); else puts("Heap size is currently not restricted"); } printf("Estimated minimum of heap: %u\n", (unsigned)minSize); return 0; } tosize = 0; argc = 1; while(argv[++argc]) addSize(&tosize, argv[argc]); if(tosize && tosize < minSize) { printf("size smaller than estimated minimum size: %u\n" , (unsigned)minSize); return 72; } printf("Patching '%s' to heap size of %u bytes\n" , argv[1], tosize); /* Watcom already has extraMin minimal and dynamically adjusts its MCB*/ if(tosize) { #ifdef GCC /* need to adjust SP */ unsigned startbss = 0x10000 - exe.extraMax * 16; exe.fSP = startbss + ival.extraSpace * 16 + tosize; #endif exe.extraMin = exe.extraMax = ival.extraSpace + tosize / 16; } else { exe.extraMax = 0xffff; exe.extraMin = ival.extraSpace; } rewind(freecom); if(fwrite(&exe, sizeof(exe), 1, freecom) != 1) { printf("Failed to patch heap size into FreeCOM executable.\n" "File most probably corrupted now: %s\n", argv[1]); return 77; } #ifndef GCC if(fseek(freecom, ival.heapPos, SEEK_SET) != 0) { printf("Failed to seek to heap size offset in %s\n", argv[1]); return 42; } assert(sizeof(tosize) == 2); if(fwrite(&tosize, sizeof(tosize), 1, freecom) != 1) { printf("Failed to patch heap size into FreeCOM executable.\n" "File most probably corrupted now: %s\n", argv[1]); return 75; } #endif fflush(freecom); if(ferror(freecom)) { printf("Failed to patch heap size into FreeCOM executable.\n" "File most probably corrupted now: %s\n", argv[1]); return 76; } fclose(freecom); return 0; } ================================================ FILE: tools/resource.h ================================================ #include "../resource.h" ================================================ FILE: tools/tools.m1 ================================================ CFG_DEPENDENCIES = tools.m1 ../utils/mktools.c tools.m2 TOP = .. !include "$(TOP)/config.mak" ================================================ FILE: tools/tools.m2 ================================================ error: errlvl 127 icmd : load_icd.exe icmd_1.icd icmd_2.icd icmd_3.icd # *Implicit Rules* .asm.com: $(NASM) $(NASMFLAGS) -f bin -o $*.com $< #.asm.obj: # $(NASM) $(NASMFLAGS) -f obj $< icmd_1.icd : icmd_inc.inc icmd_1.nas $(NASM) $(NASMFLAGS) -o icmd_1.icd icmd_1.nas icmd_2.icd : icmd_inc.inc icmd_2.nas $(NASM) $(NASMFLAGS) -o icmd_2.icd icmd_2.nas icmd_3.icd : icmd_inc.inc icmd_3.nas $(NASM) $(NASMFLAGS) -o icmd_3.icd icmd_3.nas load_icd.exe: load_icd.obj $(CL) $(CLO) load_icd.obj $(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib $(LIBC) ================================================ FILE: tools/vspawn.asm ================================================ ;; $Id$ ; Kernel Swap Support Faker #2 ; Useage: VSPAWN [{ arguments }] ; arguments are any arguments to passed to FreeCOM ; The FreeCOM executable wil be created by the name of VPSAWN ; itself, with the extenstion patched to .SWP ; This program fakes all interrupts and behaviour assumed by FreeCOM ; to use the kernel swap support. See DOS\K-SWAP.TXT for more details. %include "../criter/context.inc" STACK_SIZE EQU 64 %define tsrend (tsrend_ - start + 100h + ((tsrend_ - start) & 1)) ABSOLUTE 5ch ; where the temp variables do reside execBlock: eb_envseg RESW 1 eb_cmdline RESD 1 eb_fcb RESD 2 shellCmdLine RESB 2 context RESW 1 ctxt_owner RESW 1 origParent RESW 1 cmd_buf: SEGMENT .text ORG 100h ; this is an executable program, but as small as possible start: jmp goon %ifdef DEBUG strExiting DB 13, 10, 'Exiting VSpawn' strNL DB 13, 10, '$', 0 strNotMe DB 'The current PSP is not me!', 7, 13, 10, '$', 0 %endif errString DB 13, 10, 'Failed to execute shell - ' DB 'Exiting Kernel Swap Support Faker #2.', 7, 13, 10 DB 'Press any key to preceed ...', 13, 10 DB '$', 0 errExecShell: ; Failed to execute the shell mov dx, errString mov ah, 9 int 21h mov ah, 7 int 21h jmp exit err2: jmp err2_ tsrstart: mov ah, 4ah ; Resize memory int 21h jc err2 mainloop: xor ax, ax mov WORD [ES:ctxt_owner], ax ; let the shell brand this KSSF mov bx, execBlock mov ah, 4bh ; load & run shell int 21h mov sp, tsrend + STACK_SIZE ; standard stack position mov ax, cs mov ds, ax jc errExecShell ; failed to execute the shell ;; Run external program if one exists mov ax, [context] or ax, ax jz exit ; no context -> terminate kssf mov es, ax mov ax, [ES:?envSegm] mov WORD [eb_envseg], ax ; applies to shell & prg mov ax, [ES:?prg + 2] ; segment of program name or ax, ax jz execShell ;; execute external program mov dx, [ES:?prg] ; offset of program name les bx, [es:?cmdline] ; pointer to command line mov WORD [eb_cmdline], bx mov WORD [eb_cmdline+2], es mov bx, cs mov es, bx mov bx, execBlock mov ds, ax mov ax, 4b00h int 21h ; execute external program jc execPrg1 xor ax, ax ; no error execPrg1: mov sp, tsrend + STACK_SIZE ; standard stack position mov dx, cs mov ds, dx mov es, [context] mov [ES:?execErr], ax ; error code of DOS-4B API execShell: mov ax, shellCmdLine mov [eb_cmdline], ax mov ax, cs mov [eb_cmdline+2], ax lds dx, [ES:?shell] mov es, ax mov ax, ds ; probe if a name exists or ax, ax jne mainloop exit: ; exit kssf mov ax, cs mov ds, ax ; ensure DS == PSP %ifdef DEBUG mov dx, strExiting mov ah, 9 int 21h mov ah, 62h int 21h mov ax, cs cmp ax, bx je dbg_1 mov dx, strNotMe mov ah, 9 int 21h dbg_1: %endif mov ax, WORD [origParent] ; restore parentPSP to original value mov WORD [ds:16h], ax mov ax, [context] ; let context be deallocated, too or ax, ax jz exit_noCtxt dec ax mov es, ax ; MCB of context mov WORD [ES:1], ds ; owner of context := kssf mov ax, [ES:10h+?envSegm] ; environment segm or ax, ax jz exit_noCtxt dec ax mov es, ax ; MCB of env segm mov WORD [ES:1], ds ; owner of env segm := kssf exit_noCtxt: lds dx, [old_isr21] ; old INT-21 mov ax, 2521h int 21h ; install old handler mov ax, 4c00h int 21h int 20h isr21: ;; DOS interrupt chain cmp dx, 'FD' ;; magic number jne isr21_chain cmp ax, 4bfeh je isr21_do cmp ax, 4bfdh je isr21_do isr21_chain: jmp 0:0 old_isr21 EQU $-4 isr21_do: push ds push cs pop ds push bp mov bp, sp ;; BP+8 == flags push dx push ax mov dx, bx ;; new context mov ah,62h ; get current PSP int 21h mov ax, [ctxt_owner] or ax, ax jnz isr21_1 ;; first call --> brand the KSSF to this process mov WORD [ctxt_owner], bx isr21_1: xchg bx, dx pop ax cmp al, 0feh mov ax, [ctxt_owner] je isr21_getCtxt ;; set Ctxt cmp ax, dx jne isr21_noAcc isr21_setCtxt: xchg [context], bx jmp short isr21_ok isr21_getCtxt: mov bx, [context] cmp ax, dx jne isr21_noAcc isr21_ok: and BYTE [bp+8], 0feh ; clear Carry flag %ifdef DEBUG mov ax, cs ; our PSP / PID %endif isr21_iret: pop dx pop bp pop ds iret isr21_noAcc: or BYTE [bp+8], 1 ; set Carry flag mov ax, 5 jmp short isr21_iret tsrend_: err2_: mov dx, errResize jmp errOut err3: jmp err3_ goon: ;; Initialization a.s.o. ; Decode command line argument list mov ax, cs ; Get PSP mov ds, ax mov es, ax cld xor ax, ax mov di, execBlock mov cx, cmd_buf - execBlock rep stosb ; erase the execBlock mov BYTE [shellCmdLine+1], 0dh mov WORD [eb_cmdline], 80h mov WORD [eb_cmdline+2], ds mov ax, [2ch] ; environment segment or ax, ax jz err3 dec ax mov es, ax mov cx, [es:3] ; size of environment segment in paras inc ax mov es, ax test ch, 0f0h jz ???1 ; no overflow mov cx, 0ffffh ; longer environment jmp short searchCmdName ???1: shl cx, 4 searchCmdName: xor ax, ax mov di, ax ; environment starts at first byte ???2: repne scasb jcxz err4 cmp al, [es:di] ; end of var area reached? jnz ???2 mov ax, [es:di+1] ; number of strings or ax, ax je err4 add di, 3 mov dx, di ; start of command to spawn xor al, al sub cx, 3 jc err4 repne scasb jcxz err4 mov bx, cx mov cx, 5 ???5: dec di inc bx cmp BYTE [ES:di], '.' loopne ???5 je ???6 ; dot found ;; no dot found --> append add di, 5 sub bx, 5 ???6: cmp bx, 6 jc err4 mov cx, ((extensionEnd - extensionStart) + 1) / 2 mov si, extensionStart rep movsw mov di, dx ; save start of command name ;; Chain KSSF into the system mov ax, 3521h int 21h ; Get interrupt vector mov WORD [old_isr21], bx mov WORD [old_isr21+2], es mov dx, isr21 mov ax, 2521h int 21h ; Set interrupt vector %ifdef DEBUG call printLoadSegm %endif mov ax, cs mov es, ax xchg WORD [16h], ax ; set our owner to ourselves <-> shell hack mov WORD [origParent], ax mov ds, [ds:2ch] mov dx, di ;; DS:DX == command name ;; execBlock is filled mov bx, (tsrend + STACK_SIZE + 15) / 16 ; := number of paragraphes ; required for TSR and stack mov sp, tsrend + STACK_SIZE ; new stack size jmp tsrstart err3_: mov dx, ErrEnvSeg jmp short errOut err4: mov dx, ErrBadEnv jmp short errOut err1: mov dx, useage errOut: mov ah, 9 int 21h mov ah, 7 int 21h mov ax, 4c03h int 21h int 20h ErrBadEnv DB 7, 'Bad environment', 13, 10, '$' ErrEnvSeg DB 7, 'Cannot determine my own executable file name', 13, 10, '$' useage DB 7, 'Useage: VSpawn freecom [{ arguments }]', 13, 10 DB 9, 'freecom: absolute filename of FreeCOM', 13, 10 DB 9, 'arguments: any optionally arguments or options', 13, 10 DB 'Spawns FreeCOM and fakes the necessary kernel functions for', 13, 10 DB 'the Kernel Swap Support', 7, 13, 10, '$' errResize DB 7, 'Failed to resize VSpawn memory block', 13, 10, '$' align 2 ;;EVEN extensionStart DB '.SWP', 0 extensionEnd DB 0 %ifdef DEBUG printLoadSegm: mov dx, dbgStr1 mov ah, 9 int 21h mov ax, cs call printWord mov dl, ':' mov ah, 2 int 21h mov ax, isr21 call printWord mov dx, dbgStr2 mov ah, 9 int 21h ret printWord: push ax mov al, ah call printByte pop ax printByte: push ax shr al, 4 call printNybble pop ax printNybble: and al, 0fh add al, '0' cmp al, '0' + 10 jc print1 add al, 'A' - '0' - 10 print1: mov dl, al mov ah, 2 int 21h ret dbgStr1 DB 'VSpawn loaded at ', '$' dbgStr2 DB 10, 13, '$' %endif ;;END ================================================ FILE: utils/MAKECMD.BAT ================================================ @echo off rem This is part of the FreeCOM FreeDOS package to replace default command.com with language specific version del command.com if exist cmd-%lang%.com ren cmd-%lang%.com command.com del cmd-*.com ================================================ FILE: utils/chunk.c ================================================ /* $Id$ Chunk a large dependency list into portions with less than 128 entries each. They'll form a cascaded dependency list with "argv[1]" is the primary target. */ #include #include char buf[1024]; int main(int argc, char **argv) { int i; char *p; unsigned long lnr; int chunk; if(argc != 2) { fputs("Useage: CHUNK primary_target outfile\n", stderr); return 127; } fputs(argv[1], stdout); fputs(" : ", stdout); chunk = i = 0; lnr = 0; while(fgets(buf, sizeof(buf), stdin)) { ++lnr; p = strchr(buf, '\0'); if(*--p != '\n') { fprintf(stderr, "Line #%lu too long\n", lnr); return 40; } *p = 0; if(++i >= 127) { ++chunk; printf(" \\\n\tchunk%u\n\nchunk%u : ", chunk, chunk); i = 0; } fputs(" \\\n\t", stdout); fputs(buf, stdout); } puts("\n\n"); return 0; } ================================================ FILE: utils/debug.h ================================================ #include "../debug.h" ================================================ FILE: utils/depend.mk ================================================ utils .SETDIR=utils : @echo Entering $(PWD) $(RUNMAKE) all @echo Leaving $(PWD) CLEAN_DEPENDENCIES += utils_clean utils_clean .SETDIR=utils : @echo Entering $(PWD) $(RUNMAKE) clean @echo Leaving $(PWD) CLOBBER_DEPENDENCIES += utils_clobber utils_clobber .SETDIR=utils : @echo Entering $(PWD) $(RUNMAKE) clobber @echo Leaving $(PWD) DIST_DEPENDENCIES += utils_dist utils_dist .SETDIR=utils : @echo Entering $(PWD) $(RUNMAKE) dist @echo Leaving $(PWD) ================================================ FILE: utils/files.txt ================================================ Implementation of utilities required for the build process of FreeCOM MKCTXT Creates .DEF, .H_C, .INC files from .X (see MKCTXT.C) MKTOOLS Creates the default target for TOOLS\ subdir ================================================ FILE: utils/makefile ================================================ # $Id$ # # Makefile for tools of the FreeDOS kernel's command interpreter # # # $Log$ # Revision 1.5 2002/04/02 23:36:37 skaus # add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert) # # Revision 1.4 2001/04/12 00:09:06 skaus # chg: New structure # chg: If DEBUG enabled, no available commands are displayed on startup # fix: PTCHSIZE also patches min extra size to force to have this amount # of memory available on start # bugfix: CALL doesn't reset options # add: PTCHSIZE to patch heap size # add: VSPAWN, /SWAP switch, .SWP resource handling # bugfix: COMMAND.COM A:\ # bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed # add: command MEMORY # bugfix: runExtension(): destroys command[-2] # add: clean.bat # add: localized CRITER strings # chg: use LNG files for hard-coded strings (hangForEver(), init.c) # via STRINGS.LIB # add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts # add: fixstrs.c: prompts & symbolic keys # add: fixstrs.c: backslash escape sequences # add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C # chg: splitted code apart into LIB\*.c and CMD\*.c # bugfix: IF is now using error system & STRINGS to report errors # add: CALL: /N # # Revision 1.1.2.1 2001/02/18 17:59:37 skaus # bugfix: KSSF: restore parentPSP on exit # chg: Using STRINGS resource for all non-interactive messages # chg: moving all assembly files to NASM # INCDIR +=;$(FREEDOS)\SRC\INCLUDE;.. LIBDIR +=;$(FREEDOS)\SRC\LIB\$(_COMPILER) # LDLIBS = suppl_$(_MODEL).lib LDFLAGS += /msl # Project specific C compiler flags MYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1) MYCFLAGS_NDBG = MYASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s MYASMFLAGS_NDBG = -s MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG)) MYASMFLAGS = $(null,$(NDEBUG) $(MYASMFLAGS_DBG) $(MYASMFLAGS_NDBG)) .SOURCE.h := . .. .SOURCE.lib := $(LIBDIR:s/;/ /:u) .IMPORT : FREEDOS # Sources of this make target # Default target all: mkctxt.exe mktools.exe chunk.exe mkinfres.exe mkctxt.exe : mkctxt.c chunk.exe : chunk.c mktools.exe : mktools.c ..\config.h dist : ; .INIT : $(CFG) __errl __errl: @+-if exist errlist del errlist >nul -ctags *.c clobber : clean $(RM) $(RMFLAGS) *.exe *.com *.cfg clean : $(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) *.dmp ================================================ FILE: utils/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak UTILS_BUILD = 1 TOP = .. !include "$(TOP)/config.mak" all: $(CFG) mktools.exe mkctxt.exe chunk.exe mkinfres.exe ptchsize.exe mktools.exe : mktools.c ../config.h ptchsize.exe : ptchsize.c ../tools/ptchsize.c ================================================ FILE: utils/misc.h ================================================ #include "../misc.h" ================================================ FILE: utils/mkctxt.c ================================================ /* $Id$ Create the various file from the CONTEXT.X file (See there for syntax description) Useage: MKCTXT filename[.X] Produces: filename.h_c: contains the structure in C syntax filename.inc: contains the definition of the structure in assembly filename.def: contains the EQUs of the offsets of a value into the structure two definitions per offset: - offset from the very beginning of the context _ - offset of the value relative to the beginning of the specific package $Log$ Revision 1.3 2001/04/12 00:09:06 skaus chg: New structure chg: If DEBUG enabled, no available commands are displayed on startup fix: PTCHSIZE also patches min extra size to force to have this amount of memory available on start bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling bugfix: COMMAND.COM A:\ bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed add: command MEMORY bugfix: runExtension(): destroys command[-2] add: clean.bat add: localized CRITER strings chg: use LNG files for hard-coded strings (hangForEver(), init.c) via STRINGS.LIB add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts add: fixstrs.c: prompts & symbolic keys add: fixstrs.c: backslash escape sequences add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C chg: splitted code apart into LIB\*.c and CMD\*.c bugfix: IF is now using error system & STRINGS to report errors add: CALL: /N Revision 1.1.2.2 2001/02/18 21:08:24 skaus add: command WHICH fix: BUILD.BAT and accompanying makefiles for TC++ v1.01 Revision 1.1.2.1 2001/02/18 17:59:37 skaus bugfix: KSSF: restore parentPSP on exit chg: Using STRINGS resource for all non-interactive messages chg: moving all assembly files to NASM Revision 1.1.2.1 2000/12/17 21:57:37 skaus intermediate update 1 */ #include #include #include #include #ifdef __GNUC__ #define memicmp strncasecmp #endif static char *typename = NULL; /* Current typedef */ static char *pkg = NULL; /* Current package */ static char *stru = NULL; /* Current structure */ static unsigned pkgOffs = 0, offset = 0; /* package and overall offset */ static char *fnam = NULL; /* filename with spare room for extension */ static char *fext; /* pointer to extension of fnam */ static char buf[1024]; static unsigned lineNr = 0; static FILE *fincc, *finca, *fdefa, *fx; static char *skipws(char *p) { while(*p && isspace(*p)) ++p; return p; } static void incOffs(int size) { offset += size; pkgOffs += size; } static void dumpDefine(char *name, char *value) { long i; i = strtol(value, 0, 0); fprintf(fincc, "#define %s %ld\n", name, i); fprintf(finca, "%%define %s %ld\n", name, i); } static void dumpEQU(char *symbol) { fprintf(finca, "?%s EQU %u\n", symbol, offset); fprintf(fdefa, "??%s:\n", symbol); if(pkg && pkg != symbol) fprintf(finca, "?%s_%s EQU %u\n", pkg, symbol, pkgOffs); } static void indent(void) { if(typename) putc('\t', fincc); if(pkg) putc('\t', fincc); if(stru) putc('\t', fincc); } static void endStru(void) { if(stru) { fprintf(fincc, "\t\t} %s;\n", stru); free(stru); stru = NULL; } } static void endPkg(void) { if(pkg) { fprintf(fincc, "\t} %s;\n", pkg); free(pkg); pkg = NULL; } } static void endType(void) { if(typename) { fprintf(fincc, "} %s;\n\n#include \n", typename); free(typename); typename = NULL; } } static void dumpItem(char *name, char *value, char *Ctype, char asmType) { dumpEQU(name); indent(); fprintf(fincc, "%s %s;\n", Ctype, name); fprintf(fdefa, "\tD%c %s\n", asmType, value); } #define word word_(&p) static char *word_(char **Xp) { char *p, *q; q = p = skipws(*Xp); if(!*p || *p == '#') { printf("Syntax error in line %u: Missing argument\n", lineNr); exit(62); } while(*++q && !isspace(*q)); if(*q) { *q = '\0'; *Xp = skipws(q + 1); } else *Xp = q; return p; } #define match(w) match_(&p, (w)) static int match_(char **Xp, char *w) { char *p, *q; q = p = skipws(*Xp); if(!*p || *p == '#') { printf("Syntax error in line %u: Missing keyword\n", lineNr); exit(62); } while(*++q && !isspace(*q)); if(strlen(w) == q - p && memicmp(w, p, q - p) == 0) { /* equal */ if(*q) *Xp = skipws(q + 1); else *Xp = q; return 1; } return 0; } int main(int argc, char **argv) { char *p, *name, *value; int err; if(argc != 2) { puts("MKCTXT - Create definition file from *.X files\n\n" "Useage: MKCTXT filename[.X]\n"); return 127; } if((fnam = strdup(argv[1])) == NULL || (fnam = realloc(fnam, strlen(fnam) + 4)) == NULL) { puts("Out of memory"); return 120; } fext = strchr(fnam, '\0'); while(--fext >= fnam && *fext != '.' && *fext != '/' && *fext != '\\'); if(fext < fnam || *fext != '.') { fext = strchr(fnam, '\0'); strcpy(fext++, ".x"); } else ++fext; if((fx = fopen(fnam, "rt")) == NULL) { printf("Cannot open input file: %s\n", fnam); return 40; } strcpy(fext, "h_c"); if((fincc = fopen(fnam, "wt")) == NULL) { printf("Cannot create C include file: %s\n", fnam); return 41; } strcpy(fext, "inc"); if((finca = fopen(fnam, "wt")) == NULL) { printf("Cannot create assembly include file: %s\n", fnam); return 42; } strcpy(fext, "def"); if((fdefa = fopen(fnam, "wt")) == NULL) { printf("Cannot create assembly definition file: %s\n", fnam); return 43; } /* Dump the headers into the files */ /* C include file: autogenerated notice and one-byte alignment */ fputs("/* This is an autogenerated file.\n" "\tAny modifications are lost once MKCTXT runs the next time.\n" "\tModify the particular *.X source file instead. */\n\n", fincc); fputs(";; This is an autogenerated file.\n" ";;\tAny modifications are lost once MKCTXT runs the next time.\n" ";;\tModify the particular *.X source file instead. \n\n", finca); fputs(";; This is an autogenerated file.\n" ";;\tAny modifications are lost once MKCTXT runs the next time.\n" ";;\tModify the particular *.X source file instead. \n\n", fdefa); while(fgets(buf, sizeof(buf), fx)) { ++lineNr; p = skipws(buf); if(!*p) { endStru(); continue; } if(*p == '#') continue; if(match("typedef")) { endStru(); endPkg(); endType(); typename = strdup(word); if(!typename) { puts("Out of memory"); return 120; } fprintf(fincc, "\n#include \n\n" "typedef struct {\t/* type %s */\n", typename); } else if(match("package")) { pkgOffs = 0; endStru(); endPkg(); indent(); pkg = strdup(word); if(!pkg) { puts("Out of memory"); return 120; } fprintf(fincc, "struct {\t/* package %s */\n", pkg); dumpEQU(pkg); } else if(match("structure")) { endStru(); indent(); stru = strdup(word); if(!stru) { puts("Out of memory"); return 120; } fprintf(fincc, "struct {\t/* structure %s */\n", stru); dumpEQU(stru); } else if(match("byte")) { name = word; value = word; dumpItem(name, value, "byte", 'B'); incOffs(1); } else if(match("word")) { name = word; value = word; dumpItem(name, value, "word", 'W'); incOffs(2); } else if(match("pointer")) { name = word; value = word; dumpItem(name, value, "void far*", 'D'); incOffs(4); } else if(match("reference")) { name = word; dumpEQU(name); indent(); fprintf(fincc, "unsigned char %s[];\n", name); } else if(match("constant")) { name = word; value = word; dumpDefine(name, value); } else { printf("Syntax error in line %u: Invalid keyword\n", lineNr); return 60; } if(*p && *p != '#') { printf("Syntax error in line %u: Too many arguments\n", lineNr); return 61; } } endStru(); endPkg(); endType(); fflush(fincc); fflush(finca); fflush(fdefa); err = 0; if(ferror(fx)) { strcpy(fext, "x"); printf("Read error from: %s\n", fnam); err = 50; } if(ferror(fincc)) { strcpy(fext, "h_c"); printf("Write error to: %s\n", fnam); err = 51; } if(ferror(finca)) { strcpy(fext, "inc"); printf("Write error to: %s\n", fnam); err = 52; } if(ferror(fdefa)) { strcpy(fext, "def"); printf("Write error to: %s\n", fnam); err = 53; } fclose(fx); fclose(fincc); fclose(finca); fclose(fdefa); return err; } ================================================ FILE: utils/mkinfres.c ================================================ /* $Id$ Tool to create the _heaplen resource Useage: MKINFRES resfile mapfile */ #include #include #include #include #include #include "../config.h" #define MKINFRES #include "../include/command.h" #include "../include/res.h" #include "../include/infores.h" #define pch(ch) (isprint((unsigned)(ch) & 0xFF)? (unsigned)(ch) & 0xFF: '.') FILE *txt = 0; FILE *info = 0; char buf[3*1024]; #include "../lib/res_w.c" /* Make this a single file project */ int scanMapFile(const char * const fnam , unsigned long * const hpos , unsigned long * const spos , unsigned *extraSpace) { FILE *map; char *w1, *w2, *w3, *w5; unsigned long v; assert(hpos); assert(spos); assert(fnam); assert(extraSpace); *extraSpace = 0; *hpos = *spos = 0; if((map = fopen(fnam, "rt")) == 0) { printf("Failed to open file: %s\n", fnam); return 40; } while(fgets(buf, sizeof(buf), map)) { if((w1 = strtok(buf, " \t\r\n")) != 0 && (w2 = strtok(0, " \t\r\n")) != 0) { if((w3 = strtok(0, " \t\r\n")) == 0) { if(strcmp(w2, "__heaplen") == 0 || strcmp(w2, "__stklen") == 0) { unsigned long n1, n2; n1 = strtoul(w1, &w1, 16); if(w1 && *w1 == ':') { n2 = strtoul(w1 + 1, &w1, 16); if(w1 == 0 || *w1 == 0 || (*w1 == '+' && w1[1] == 0)) { v = (unsigned long)n1 * 16 + n2; if (w2[2] == 'h') *hpos = v; else *spos = v; } } } } else if((strtok(0, " \t\r\n")) != 0 && (w5 = strtok(0, " \t\r\n")) != 0) { if(strcmp(w5, "BSS") == 0 || strcmp(w1, ".bss") == 0) { unsigned long n; char *p = 0; n = strtoul(w3, &p, 16); if(p && (*p == 'H' || w1[0]=='.')) { if(n > USHRT_MAX || (n += *extraSpace) > USHRT_MAX) { puts("Extra space exceeds range"); return 56; } *extraSpace = (unsigned)n; } } } } } fclose(map); if (*hpos == 0) printf("No valid entry of _heaplen found in: %s\n", fnam); #ifdef __TURBOC__ if (*spos == 0) printf("No valid entry of _stklen found in: %s\n", fnam); #endif return 0; } int addImageDisplacement(const char * const fnam , unsigned long spos , unsigned long * const pos , unsigned *extraSpace) { FILE *f; struct EXE_header exe; unsigned stacksize; assert(fnam); assert(pos); if((f = fopen(fnam, "rb")) == 0) { printf("Failed to open file: %s\n", fnam); return 42; } if(fread(&exe, sizeof(exe), 1, f) != 1) { printf("Read error from: %s\n", fnam); return 52; } if (*pos) *pos += exe.header * 16; if (spos) { spos += exe.header * 16; if(fseek(f, spos, SEEK_SET) != 0) { printf("Failed to seek to stack size offset in %s\n", fnam); return 62; } if(fread(&stacksize, sizeof(stacksize), 1, f) != 1) { printf("Read error from: %s\n", fnam); return 72; } *extraSpace += (stacksize+15)/16; } fclose(f); #ifdef GCC stacksize = 4*1024; *extraSpace += stacksize / 16; #else if(exe.extraMin > *extraSpace) *extraSpace = exe.extraMin; #endif return 0; } void dumpTag(int ttype, int tlength, void *tvalue) { infotag tag; assert(sizeof(tag) == 2); assert(info); tag.type = ttype; tag.length = tlength; fwrite(&tag, sizeof(tag), 1, info); if(tlength) { assert(tvalue); fwrite(tvalue, tlength, 1, info); } if(txt) { switch(ttype) { case INFO_END: fputs("End ", txt); break; case INFO_EXTRA_SPACE: fputs("Extra space ", txt); break; case INFO_POS_HEAPLEN: fputs("Heaplen position", txt); break; case INFO_ALIASES: fputs("Alias size ", txt); break; case INFO_HISTORY: fputs("History size ", txt); break; case INFO_DIRSTACK: fputs("Dirstack size ", txt); break; case INFO_BUFSIZE: fputs("Bufsize ", txt); break; default: fputs("Unknown tag ", txt); break; } fprintf(txt, ": %u", tlength); switch(tlength) { case 0: break; case 1: { unsigned char ch; ch = *(unsigned char*)tvalue; fprintf(txt, ": %u 0x%02x (%c)", ch, ch, pch(ch)); } break; case 2: { unsigned w; w = *(unsigned*)tvalue; fprintf(txt, ": %5u 0x%04x", w, w); } break; case 4: { unsigned long l; l = *(unsigned long*)tvalue; fprintf(txt, ": %lu 0x%08lx", l, l); } break; default: break; } putc('\n', txt); } } void dumpTagU(int ttype, unsigned tvalue) { dumpTag(ttype, 2, &tvalue); } int main(int argc, char **argv) { char *txtFile = 0; unsigned long heapPos, stackPos; int rc; unsigned extraSpace; if(argc > 1 && (*argv[1] == '/' || *argv[1] == '-') && toupper(argv[1][1]) == 'T') { txtFile = &argv[1][2]; --argc; ++argv; } if(argc != 4) { puts("Useage: INFORES resfile mapfile exefile"); return 127; } if((rc = scanMapFile(argv[2], &heapPos, &stackPos, &extraSpace)) != 0) return rc; /* convert extraSpace to paragraphs */ extraSpace = (extraSpace + 15)/16; if((rc = addImageDisplacement(argv[3], stackPos, &heapPos, &extraSpace)) != 0) return rc; if(txtFile && (txt = fopen(txtFile, "wt")) == 0) { printf("Failed to create text file: %s\n", txtFile); return 43; } if((info = fopen(argv[1], "wb")) == 0) { printf("Failed to create file: %s\n", argv[1]); return 41; } startResource(info, RES_ID_INFO, 0); dumpTagU(INFO_EXTRA_SPACE, extraSpace); if(heapPos) dumpTag(INFO_POS_HEAPLEN, 4, &heapPos); #if 0 /* They are external now */ #ifdef FEATURE_ALIASES dumpTagU(INFO_ALIASES, 0); #endif #ifdef FEATURE_HISTORY dumpTagU(INFO_HISTORY, 256); #endif #ifdef INCLUDE_CMD_PUSHD dumpTagU(INFO_DIRSTACK, DIRSTACK_DEFAULT_SIZE); #endif #endif dumpTagU(INFO_BUFSIZE, MAX_INTERNAL_COMMAND_SIZE); dumpTag(INFO_END, 0, 0); endResource(info); fflush(info); if(ferror(info)) { printf("Error writing file: %s\n", argv[1]); return 60; } fclose(info); return 0; } ================================================ FILE: utils/mktools.c ================================================ /* $Id$ Implements an utility that creates the default target for the TOOLS sub-directory useage: MKTOOLS >makefile.mk $Log$ Revision 1.3 2001/04/01 21:05:44 skaus bugfix: CALL doesn't reset options add: PTCHSIZE to patch heap size add: VSPAWN, /SWAP switch, .SWP resource handling Revision 1.2 2001/03/07 19:49:01 skaus Merged in Swap Support changes Revision 1.1.2.2 2001/02/18 21:19:26 skaus fix: MKTOOLS must include $(CFG) into list Revision 1.1.2.1 2001/02/18 18:03:51 skaus intermediate update #3 */ #include #include "../config.h" int main(void) { fputs("all : $(CFG) ptchsize.exe", stdout); #ifdef FEATURE_KERNEL_SWAP_SHELL fputs(" kssf.com vspawn.com", stdout); #endif #ifdef FEATURE_CALL_LOGGING fputs(" ptchldrv.exe", stdout); #endif #ifdef FEATURE_INSTALLABLE_COMMANDS fputs(" icmd", stdout); #endif fputs(" 28.com 50.com", stdout); putchar('\n'); return 0; } ================================================ FILE: utils/ptchsize.c ================================================ /* Redirection file to enable native host build of ptchsize utility */ #include "../tools/ptchsize.c" ================================================ FILE: utils/resource.h ================================================ #include "../resource.h" ================================================ FILE: utilsc/critstrs.c ================================================ /* This program will read in the language file for Critical Error strings and create the file: strings.err - contains all the strings. will be appended on the end of the exe file. There are two input files: DEFAULT.err and the language file passed as argument to CRITSTRS. Any definition in the latter will override setting from the first one. 1) If an individual *.err file does not define a certain string, its contents is taken from the DEFAULT file. 2) The strings do not have any particular order within the *.ERR files, the order is implicitly applied by CRITSTRS. The area is constructed in memory and dumped into the file after all files have been read and the contents has passed all transformation and validation checks. Therefore it is recommended to build the program in the Compact memory model. 2000/07/11 ska started 26.03.2003 Dejan Strbac (strbac@phreaker.net) - hexadecimal bug */ #define MODULE_VERSION 0 #include #include #include #include #include /*ska: no resource in this project! #include "../resource.h"*/ #define fDAT "strings.err" #define fTXT "DEFAULT.err" #define fEXT ".err" #define MAXSTRINGS 256 typedef struct { char *name; /* name of string */ char *text; /* text of this string */ } strings; typedef unsigned short word; /* MUST BE EXACTLY unsigned 16bit */ typedef unsigned char byte; /* MUST BE EXACTLY unsigned 8bit */ #if USHRT_MAX != 65535U #error "word must be exactly an unsigned 16-bit value" #endif #if UCHAR_MAX != 255 #error "byte must be exactly an unsigned 8-bit value" #endif strings strg[MAXSTRINGS] = { { "READ", NULL } /* 0 */ ,{ "WRITE", NULL } /* 1 */ ,{ "BLOCK_DEVICE", NULL } /* 2 */ ,{ "CHAR_DEVICE", NULL } /* 3 */ ,{ "DOS", NULL } /* 4 */ ,{ "FAT", NULL } /* 5 */ ,{ "ROOT", NULL } /* 6 */ ,{ "DATA", NULL } /* 7 */ ,{ "IGNORE", NULL } /* 8 */ ,{ "RETRY", NULL } /* 9 */ ,{ "ABORT", NULL } /* 10 */ ,{ "FAIL", NULL } /* 11 */ ,{ "QUESTION", NULL } /* 12 */ ,{ "DELIMITER", NULL } /* 13 */ ,{ NULL, NULL } }; int maxNr = -1; #define STR_KEYS 14 /* combined keys */ #define STR_ERROR 15 /* first error string */ strings special[] = { { "KEYS_IGNORE", NULL } ,{ "KEYS_RETRY", NULL } ,{ "KEYS_ABORT", NULL } ,{ "KEYS_FAIL", NULL } ,{ "UNKNOWN", NULL } ,{ NULL, NULL } }; #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) #error "This program must be compiled with far data pointers" #endif char temp[256]; /* keep it a single-file project */ /*ska: no resource in this project! #include "../res_w.c"*/ #if defined(__GNUC__) && !defined(__MINGW32__) static void strupr(char *s) { for (; *s; s++) *s = toupper(*s); } #endif #ifdef __TURBOC__ #define join(s1,s2) strcpy(stpcpy(temp, s1), s2); #else #define join(s1,s2) strcat(strcpy(temp, s1), s2); #endif void pxerror(char *msg1, char *msg2) { join(msg1, msg2); perror(temp); } int tonum(int ch) { return isdigit(ch)? ch - '0' : toupper(ch) - 'A' + 10; } void savetext(strings s[], int i, const char * const line) { const char *p; char *q; if(i > maxNr) maxNr = i; free(s[i].text); if((q = s[i].text = malloc(strlen(p = line) + 1)) == NULL) { fputs("Out of memory\n", stderr); exit(85); } /* Check and compact the string */ while(isspace(*p)) ++p; while(*p) { if(*p == '%') { switch(*++p) { case '%': break; /* expands to single '%' */ case '\0': --p; break; /* dito */ case '.': /* ignore completely */ ++p; continue; case '&': /* hexa-decimal string */ if(isxdigit(p[1]) && isxdigit(p[2])) { *q++ = (tonum(p[1]) << 4) | tonum(p[2]); p += 3; continue; } /** fall though **/ case '1': case '2': case '3': case 'A': /* Leave both in the string */ *q++ = '%'; break; } } *q++ = *p++; } *q++ = '\0'; } int search(strings s[], const char * const k, const char * const line) { int i = 0; do if(strcmp(s[i].name, k) == 0) { savetext(s, i, line); return 1; } while(s[++i].name); return 0; } int loadFile(char *fnam) { unsigned long linenr; char *p; FILE *fin; join(fnam, fEXT); if((fin = fopen(fnam, "rt")) == NULL && (fin = fopen(temp, "rt")) == NULL) { pxerror("opening ", fnam); return 33; } printf("CRITSTRS: load file %s\n", fnam); linenr = 0; while (fgets(temp, sizeof(temp), fin)) { ++linenr; p = strchr(temp, '\0'); if(p[-1] != '\n') { fprintf(stderr, "Line %lu too long\n", linenr); return 41; } /* Cut trailing control characters */ while (--p >= temp && (iscntrl(*p) || isspace(*p))); p[1] = '\0'; switch (*temp) { case ';': case '#': case '\0': /* comment line */ break; case 'S': /* possible help line */ if(isdigit(temp[1])) /* help line */ break; default: /* line */ if((p = strchr(temp, ':')) == NULL) { fprintf(stderr, "Syntax error in line %lu\n", linenr); return 42; } *p = '\0'; if(isdigit(*temp)) { /* error string */ char *q = temp; int nr = 0; do nr = nr * 10 + *q - '0'; while(isdigit(*++q)); if(*q) { fprintf(stderr, "Invalid number in line %lu\n", linenr); return 44; } if(nr < 0 || nr > 255 - STR_ERROR) { fprintf(stderr, "String number too large in line %lu\n" , linenr); return 45; } savetext(strg, STR_ERROR + nr, p + 1); } else { strupr(temp); if(!search(strg, temp, p + 1) && !search(special, temp, p + 1)) { fprintf(stderr, "Unknown string name in line %lu\n" , linenr); return 43; } } } } if(ferror(fin)) { pxerror("reading ", fnam); return 34; } fclose(fin); return 0; } int main(int argc, char **argv) { FILE *dat; int rc, i, j; unsigned long size; /*word w;*/ byte *p; /*byte b, *p;*/ if(argc > 2) { puts("CRITSTRS - Generate Critical Error string for a language\n" "Useage: CRITSTRS [language]\n" "\tIf no language is specified, the default strings are read only.\n" "\tThere must be .ERR file in the current directory.\n" "Note: DEFAULT.err must be present in the current directory, too."); return 127; } if((rc = loadFile(fTXT)) != 0) return rc; if(argc > 1 && (rc = loadFile(argv[1])) != 0) return rc; /* Now all the strings are cached into memory */ puts("CRITSTRS: Running validation check"); i = rc = 0; do if(!strg[i].text) { fprintf(stderr, "Missing string \"%s\"\n", strg[i].name); rc = 46; } while(strg[++i].name); i = 0; do if(!special[i].text) { fprintf(stderr, "Missing string \"%s\"\n", special[i].name); rc = 47; } while(special[++i].name); if(rc) return rc; /* Create the compacted S14 (keys) format: LK..KA..A 'L': number of K's 'K': Keycode (== ASCII code) 'A': Action code The number of keycodes is equal to the number of action codes. The leftmost keycode is associated to the leftmost action code. */ /* first: count */ for(rc = i = 0; i < 4; ++i) rc += strlen(special[i].text); if((p = (byte*)(strg[STR_KEYS].text = malloc(1 + rc * 2))) == NULL) { fputs("Out of memory\n", stderr); return 89; } /* then insert the data */ *p = 0; for(i = 0; i < 4; ++i) { /* also the action code */ memcpy(p + 1 + *p, special[i].text, j = strlen(special[i].text)); memset(p + 1 + *p + rc, i, j); *p += (unsigned char)j; } /* check if the error strings are continueous */ for(rc = 0, i = STR_ERROR; i < maxNr; ++i) if(!strg[i].text) { fprintf(stderr, "Missing error string #%d\n", i - STR_ERROR); rc = 48; } if(rc) return rc; strg[++maxNr].text = special[4].text; puts("CRITSTRS: Dumping CRITER strings resource"); /* Dump the stuff into a file */ /*if((dat = fopen(fDAT, "wb")) == NULL) {*/ if((dat = fopen(fDAT, "wt")) == NULL) { perror("creating " fDAT); return 35; } /*ska: no resource in this project! startResource(dat, RES_ID_CRITER, 2, MODULE_VERSION);*/ /* Number of strings EXCEPT trailing "Unknown error" */ fprintf(dat, "??strings DB %u\n", maxNr); /*b = maxNr;*/ /*fwrite(&b, sizeof(b), 1, dat);*/ /* when loaded the pointer to the string, now offset within file */ size = 1l + maxNr * 2; for(i = 0; i <= maxNr; ++i) { fprintf(dat, "\tDW S%u\n", i); /*w = (word)size;*/ /*fwrite(&w, sizeof(w), 1, dat);*/ size += i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2 : strlen(strg[i].text) + 1; } if(size > 0xfffful) { fputs("Overall size of Critical Error string database exceeds 64KB\n" , stderr); return 37; } /* Now dump the strings themselves */ for(i = 0; i <= maxNr; ++i) { int l; fprintf(dat, "S%u\tDB ", i); l = i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2 : strlen(strg[i].text) + 1; p = (unsigned char*)strg[i].text; if(l) { while(--l) fprintf(dat, "%u,", *p++); fprintf(dat, "%u\n", *p); } /*fwrite(strg[i].text, 1 //, i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2 // : strlen(strg[i].text) + 1 //, dat);*/ } /*ska: no resource in this project! endResource(dat);*/ fflush(dat); if(ferror(dat)) { fputs("General write error into: " fDAT "\n", stderr); return 36; } fclose(dat); return 0; } ================================================ FILE: utilsc/fixstrs.c ================================================ /* Redirection file to enable native host build of fixstrs utility */ #include "../strings/fixstrs.c" ================================================ FILE: utilsc/makefile.mak ================================================ CFG_DEPENDENCIES = makefile.mak UTILS_BUILD = 1 COMPACT_MODEL = 1 TOP = .. !include "$(TOP)/config.mak" all : $(CFG) fixstrs.exe critstrs.exe fixstrs.exe: fixstrs.c ../strings/fixstrs.c critstrs.exe: critstrs.c ================================================ FILE: version.h ================================================ #define FREECOM_VERSION "0.87"