├── .github └── workflows │ └── build.yml ├── .gitignore ├── BUILD.readme ├── COPYING ├── COPYING.darkbox ├── COPYING.libmatheval ├── COPYING.linenoise ├── GUIDELINES.md ├── GUIDELINES.tea ├── Makefile ├── README.md ├── README.tpl ├── THANKS.md ├── THANKS.tea ├── WHATSNEW.md ├── WHATSNEW.tea ├── build-mingw.sh ├── config.c.in ├── config.h.in ├── config.mk ├── doc.ft ├── doc.hd ├── dump ├── Makefile ├── dump.c └── dump_h_gen.c ├── femto.mk ├── libcu8 ├── CHANGELOG ├── COPYING ├── DOC ├── Makefile ├── README ├── config.c.in ├── config.h.in ├── include │ └── libcu8.h ├── src │ ├── config.h │ ├── dir.c │ ├── dirent.c │ ├── dup.c │ ├── encoding.c │ ├── fdio.c │ ├── find.c │ ├── find_gen.c │ ├── iconv │ │ ├── iconv.c │ │ └── iconv.h │ ├── init.c │ ├── internals.h │ ├── read.c │ ├── spawn.c │ ├── stat.c │ ├── stat_gen.c │ └── write.c └── test │ ├── Makefile │ ├── ansi.c │ ├── check_850 │ ├── check_nl │ ├── check_u8 │ ├── convert.c │ ├── fgetc850.c │ ├── fgets_nl.c │ ├── fgets_oversize.c │ ├── invalid.c │ ├── log_msg.c │ ├── log_msg.h │ ├── read.c │ ├── read850.c │ ├── readconsole.c │ └── writeconsole.c ├── libfasteval ├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile ├── THANKS └── lib │ ├── fasteval.c │ ├── fasteval.h │ ├── parser.y │ ├── scanner.l │ ├── xmath.c │ └── xmath.h ├── libpbat ├── Makefile ├── cmdlib │ └── pBat_String.c ├── cmdlist │ └── pBat_CmdList.c ├── console │ ├── pBat_Console.c │ ├── pBat_ConsoleANSI.c │ ├── pBat_ConsoleDummy.c │ └── pBat_ConsoleWin.c ├── dir │ ├── pBat_Attr.c │ ├── pBat_Dir.c │ └── pBat_UnicodeDir.c ├── enc │ └── pBat_Enc.c ├── estr │ └── pBat_Estr.c ├── file │ ├── pBat_File.h │ ├── pBat_StdFile.c │ └── pBat_Win32File.c ├── init │ └── pBat_Init.c ├── libpBat-int.h ├── libpBat.h ├── sleep │ └── pBat_Sleep.c ├── stack │ └── pBat_Stack.c └── thread │ └── pBat_Thread.c ├── man ├── en_US │ ├── batbox.tea │ ├── break.tea │ ├── call.tea │ ├── cd.tea │ ├── cls.tea │ ├── color.tea │ ├── commands.tea │ ├── copy.tea │ ├── def.tea │ ├── del.tea │ ├── dir.tea │ ├── dump.tea │ ├── echo.tea │ ├── endlocal.tea │ ├── errorlevel.tea │ ├── exit.tea │ ├── find.tea │ ├── for.tea │ ├── goto.tea │ ├── help.tea │ ├── hlp.tea │ ├── if.tea │ ├── license.tea │ ├── locale.tea │ ├── md.tea │ ├── mod.tea │ ├── more.tea │ ├── move.tea │ ├── pause.tea │ ├── pbat.tea │ ├── pbatauto.tea │ ├── pbatstartscript.tea │ ├── pbatvar.tea │ ├── pecho.tea │ ├── popd.tea │ ├── prompt.tea │ ├── pushd.tea │ ├── random.tea │ ├── rd.tea │ ├── rem.tea │ ├── ren.tea │ ├── set.tea │ ├── seta.tea │ ├── setlocal.tea │ ├── shift.tea │ ├── spec │ │ ├── attr.tea │ │ ├── cmdline.tea │ │ ├── command.tea │ │ ├── condop.tea │ │ ├── dirstack.tea │ │ ├── exp.tea │ │ ├── index.tea │ │ ├── parse.tea │ │ ├── red.tea │ │ ├── regexp.tea │ │ ├── var.tea │ │ └── xvar.tea │ ├── start.tea │ ├── tea.tea │ ├── tea_syntax.tea │ ├── time.tea │ ├── timeout.tea │ ├── title.tea │ ├── type.tea │ ├── ver.tea │ ├── wc.tea │ └── xargs.tea ├── footer ├── fr_FR │ ├── alias.tea │ ├── break.tea │ ├── call.tea │ ├── cd.tea │ ├── cls.tea │ ├── color.tea │ ├── commands.tea │ ├── copy.tea │ ├── del.tea │ ├── dir.tea │ ├── dos9.tea │ ├── dos9auto.tea │ ├── dos9startscript.tea │ ├── dos9var.tea │ ├── dump.tea │ ├── echo.tea │ ├── endlocal.tea │ ├── errorlevel.tea │ ├── exit.tea │ ├── find.tea │ ├── for-tech.tea │ ├── for.tea │ ├── goto.tea │ ├── help.tea │ ├── hlp.tea │ ├── iconv.tea │ ├── if.tea │ ├── license.tea │ ├── md.tea │ ├── mod.tea │ ├── more.tea │ ├── move.tea │ ├── nano.tea │ ├── pause.tea │ ├── pbat.tea │ ├── pbatauto.tea │ ├── pbatstartscript.tea │ ├── pbatvar.tea │ ├── pecho.tea │ ├── popd.tea │ ├── prompt.tea │ ├── pushd.tea │ ├── random.tea │ ├── rd.tea │ ├── rem.tea │ ├── ren.tea │ ├── set.tea │ ├── setaf.tea │ ├── setai.tea │ ├── setlocal.tea │ ├── shift.tea │ ├── spec │ │ ├── attr.tea │ │ ├── cmdline.tea │ │ ├── command.tea │ │ ├── condop.tea │ │ ├── dirstack.tea │ │ ├── exp.tea │ │ ├── index.tea │ │ ├── parse.tea │ │ ├── red.tea │ │ ├── regexp.tea │ │ ├── var.tea │ │ └── xvar.tea │ ├── start.tea │ ├── tea.tea │ ├── tea_syntax.tea │ ├── time.tea │ ├── timeout.tea │ ├── title.tea │ ├── type.tea │ ├── ver.tea │ ├── wc.tea │ └── xargs.tea ├── header └── meta ├── microgettext ├── COPYING ├── Makefile ├── README.md ├── gettext.h └── microgettext.c ├── modules ├── Makefile ├── batbox │ ├── Makefile │ └── batbox.c ├── lib │ ├── Makefile │ ├── pBat_Module.c │ └── pBat_Module.h └── sample │ ├── Makefile │ └── Sample.c ├── pbat ├── Makefile ├── command │ ├── pBat_Ask.c │ ├── pBat_Ask.h │ ├── pBat_Block.c │ ├── pBat_Block.h │ ├── pBat_Break.c │ ├── pBat_Break.h │ ├── pBat_Call.c │ ├── pBat_Call.h │ ├── pBat_Cd.c │ ├── pBat_Cd.h │ ├── pBat_Chcp.c │ ├── pBat_Chcp.h │ ├── pBat_Cls.c │ ├── pBat_Cls.h │ ├── pBat_Color.c │ ├── pBat_Color.h │ ├── pBat_CommandInfo.c │ ├── pBat_CommandInfo.h │ ├── pBat_Commands.h │ ├── pBat_Copy.c │ ├── pBat_Copy.h │ ├── pBat_Def.c │ ├── pBat_Def.h │ ├── pBat_Del.c │ ├── pBat_Del.h │ ├── pBat_Dir.c │ ├── pBat_Dir.h │ ├── pBat_Echo.c │ ├── pBat_Echo.h │ ├── pBat_Exit.c │ ├── pBat_Exit.h │ ├── pBat_Find.c │ ├── pBat_Find.h │ ├── pBat_For.c │ ├── pBat_For.h │ ├── pBat_Goto.c │ ├── pBat_Goto.h │ ├── pBat_Help.c │ ├── pBat_Help.h │ ├── pBat_If.c │ ├── pBat_If.h │ ├── pBat_IfExp.c │ ├── pBat_IfExp.h │ ├── pBat_Locale.c │ ├── pBat_Locale.h │ ├── pBat_Mkdir.c │ ├── pBat_Mkdir.h │ ├── pBat_Mod.c │ ├── pBat_Mod.h │ ├── pBat_More.c │ ├── pBat_More.h │ ├── pBat_Pause.c │ ├── pBat_Pause.h │ ├── pBat_Pecho.c │ ├── pBat_Pecho.h │ ├── pBat_Pushd.c │ ├── pBat_Pushd.h │ ├── pBat_Rem.c │ ├── pBat_Rem.h │ ├── pBat_Ren.c │ ├── pBat_Ren.h │ ├── pBat_Rmdir.c │ ├── pBat_Rmdir.h │ ├── pBat_Set.c │ ├── pBat_Set.h │ ├── pBat_Setlocal.c │ ├── pBat_Setlocal.h │ ├── pBat_Shift.c │ ├── pBat_Shift.h │ ├── pBat_Start.c │ ├── pBat_Start.h │ ├── pBat_Timeout.c │ ├── pBat_Timeout.h │ ├── pBat_Title.c │ ├── pBat_Title.h │ ├── pBat_Type.c │ ├── pBat_Type.h │ ├── pBat_Ver.c │ ├── pBat_Ver.h │ ├── pBat_Wc.c │ ├── pBat_Wc.h │ ├── pBat_Xargs.c │ └── pBat_Xargs.h ├── core │ ├── pBat_Args.c │ ├── pBat_Args.h │ ├── pBat_Clone.c │ ├── pBat_Clone.h │ ├── pBat_Completion.c │ ├── pBat_Completion.h │ ├── pBat_Context.h │ ├── pBat_Core.h │ ├── pBat_Debug.c │ ├── pBat_Debug.h │ ├── pBat_DirStack.c │ ├── pBat_DirStack.h │ ├── pBat_Env.c │ ├── pBat_Env.h │ ├── pBat_EnvStack.c │ ├── pBat_EnvStack.h │ ├── pBat_EsCache.c │ ├── pBat_EsCache.h │ ├── pBat_Exec.c │ ├── pBat_Exec.h │ ├── pBat_ExitInt.c │ ├── pBat_ExitInt.h │ ├── pBat_Expand.c │ ├── pBat_Expand.h │ ├── pBat_ExpandDef.c │ ├── pBat_ExpandDef.h │ ├── pBat_FdInheritance.c │ ├── pBat_FdInheritance.h │ ├── pBat_FilePath.c │ ├── pBat_FilePath.h │ ├── pBat_Globals.c │ ├── pBat_Globals.h │ ├── pBat_Jump.c │ ├── pBat_Jump.h │ ├── pBat_OsStream.c │ ├── pBat_OsStream.h │ ├── pBat_Parse.c │ ├── pBat_Parse.h │ ├── pBat_ParseBlock.c │ ├── pBat_ParseBlock.h │ ├── pBat_Pipe.c │ ├── pBat_Pipe.h │ ├── pBat_Prompt.c │ ├── pBat_Prompt.h │ ├── pBat_Read.c │ ├── pBat_Read.h │ ├── pBat_ReadScript.c │ ├── pBat_ReadScript.h │ ├── pBat_Run.c │ ├── pBat_Run.h │ ├── pBat_ShowIntro.c │ ├── pBat_ShowIntro.h │ ├── pBat_SplitPath.c │ ├── pBat_SplitPath.h │ ├── pBat_Stream.c │ ├── pBat_Stream.h │ ├── pBat_Var.c │ ├── pBat_Var.h │ └── pBat_VersionInfo.h ├── errors │ ├── pBat_Errors.c │ └── pBat_Errors.h ├── init │ ├── pBat_Init.c │ └── pBat_Init.h ├── lang │ ├── pBat_Lang.c │ ├── pBat_Lang.h │ ├── pBat_ShowHelp.c │ └── pBat_ShowHelp.h ├── linenoise │ ├── linenoise.c │ ├── linenoise.h │ ├── pBat_LineNoise.c │ ├── pBat_LineNoise.h │ ├── utf8.c │ └── utf8.h ├── pBat.c └── rc │ ├── pbat.ico │ └── res.rc ├── pbatize ├── Makefile ├── pairs.c ├── pbatize.c └── pbatize.h ├── po ├── Makefile ├── ca │ └── pbat.po ├── domains.list ├── en │ └── pbat.po ├── es │ └── pbat.po ├── fr │ └── pbat.po ├── hi │ └── pbat.po └── locales.list ├── repo.ft ├── scripts ├── Makefile ├── hlp.bat ├── pBat_Auto.bat └── pBat_Auto.in ├── tea ├── Makefile └── src │ ├── Tea.h │ ├── Tea_Load.c │ ├── Tea_Node.c │ ├── Tea_Output.c │ ├── out │ ├── tea_ansi_out.c │ ├── tea_html_out.c │ ├── tea_md_out.c │ ├── tea_out.h │ └── tea_text_out.c │ ├── tea.c │ └── tea_strupr.c └── tests ├── Makefile ├── basics ├── block.bat ├── block.out.ok ├── expansion.bat ├── expansion.out.ok ├── hello_world.bat ├── hello_world.out.ok ├── noexpansion.bat ├── noexpansion.out.ok ├── pipe.bat ├── pipe.out.ok ├── pipeext.bat └── pipeext.out.ok └── run-test.cmd /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Realease 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | runs-on: windows-latest 7 | defaults: 8 | run: 9 | shell: msys2 {0} 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: msys2/setup-msys2@v2 13 | with: 14 | msystem: MINGW64 15 | update: true 16 | install: git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-dlfcn zip 17 | - name: CI-Build 18 | run: | 19 | make config use-libcu8 20 | LDFLAGS='-static -s' make dist 21 | 22 | - uses: "marvinpinto/action-automatic-releases@latest" 23 | with: 24 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 25 | automatic_release_tag: "latest" 26 | prerelease: true 27 | title: "Development Build" 28 | files: | 29 | ./picobat-*.zip 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.exe 4 | *~ 5 | *.pot 6 | *.mo 7 | *.txt 8 | bin/ 9 | femto-subst 10 | femto-config.mk 11 | femto-test\.out 12 | config.c 13 | config.h 14 | libcu8/config.h 15 | libcu8/config.c 16 | libcu8/test/log_msg 17 | libinteval/lexer.c 18 | libinteval/parser.c 19 | libinteval/parser.h 20 | libmatheval/config.c 21 | libmatheval/config.h 22 | libmatheval/lib/parser.c 23 | libmatheval/lib/parser.h 24 | libmatheval/lib/scanner.c 25 | dos9/dos9 26 | dos9ize/dos9ize 27 | dump/dump 28 | tea/tea 29 | build-dbg\.sh 30 | build-musl\.sh 31 | dump/dump_h_gen 32 | scripts/Dos9_Auto\.bat 33 | dump/dump.h 34 | libmatheval/femto-test\.out 35 | modules/batbox/batbox 36 | modules/sample/sample 37 | 38 | libfasteval/lib/parser.c 39 | libfasteval/lib/parser.h 40 | libfasteval/lib/scanner.c -------------------------------------------------------------------------------- /BUILD.readme: -------------------------------------------------------------------------------- 1 | BUILDING Picobat (Newer versions): 2 | =============================== 3 | 4 | Picobat switched from autotools to a more lightweight build system based 5 | on gmake called femto (https://gitlab.com/darkbatcher/femto) which 6 | eases greatly the compiling process. Of course, some libraries are 7 | alwayseeded : 8 | 9 | - gcc, gmake etc. 10 | - GNU gettext 11 | - GNU libiconv 12 | 13 | If you also want to enable START command support under non-windows platforms, 14 | either mimeopen or xdg-open are required, the early being the most 15 | recommended alternative. 16 | 17 | Building Picobat is quite rapid, first configure the build using : 18 | 19 | $ make config 20 | 21 | Then you can specify or discard some options using either `use-option` 22 | or `no-option` targets. 23 | 24 | $ make use-option 25 | 26 | Picobat currently provides 6 options : 27 | 28 | - libcu8 : Add native utf-8 support (disabled by default). Do not 29 | use under *nix. 30 | - nls : Add translations (enabled by default). 31 | - cmdlycorrect : Be the most compatible to cmd as possible (disabled 32 | by default). 33 | - w10-ansi : Use ansi escape sequences instead of native windows 34 | api 35 | - console : Add visual console features like colours (enabled by 36 | default). On some exotic systems (I'm thinking of NetBSD), the 37 | terminal does not support such features, so this must be disabled. 38 | - modules : Add support for Picobat modules (enabled by default). Disabling 39 | it might be required if your are building using all static files. 40 | - linenoise : (*Nix only) enables linenoise library that provide 41 | autocompletion and extended console input. 42 | 43 | Once you have configured your options, just compile using : 44 | 45 | $ make all bin 46 | 47 | This will compile Picobat and put the resulting installation inside bin/. 48 | -------------------------------------------------------------------------------- /COPYING.darkbox: -------------------------------------------------------------------------------- 1 | Darkbox - A Fast and Portable Console IO Server 2 | Copyright (C) 2016-2018 Teddy ASTIE 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted, provided that the above 6 | copyright notice and this permission notice appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /COPYING.linenoise: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2014, Salvatore Sanfilippo 2 | Copyright (c) 2010-2013, Pieter Noordhuis 3 | 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /THANKS.md: -------------------------------------------------------------------------------- 1 | # Thanks 2 | 3 | This is a list of people and contributors I would particularly like to thank 4 | for their help on the project. Without them, pBat would certainly not be so 5 | advanced today. 6 | 7 | * Teddy Astie \(aka TSnake41\) 8 | 9 | * Originated the new build system that we use to build pBat, which is way 10 | more easy to use than this awkward GNU autotools stuff. 11 | 12 | * Lots of new bugs of the interpretor submitted particularly using the well 13 | known command darkbox and the httpBat script he and Xenoxis designed. 14 | 15 | * Lots of interpretor testing 16 | 17 | * Contributions to the interpretor code. Designed the Pushd Popd sections of 18 | pBat. 19 | 20 | * Providing various programs intended to work with pBat. 21 | 22 | * IK\_DC - Xenoxis 23 | 24 | * Lots of bugs submitted 25 | 26 | * Created designs for the new html man pages and pBat website 27 | 28 | * Programmed the VER command. 29 | 30 | * Karanveer Chouhan \(aka KVC\) 31 | 32 | * Help reviewing of pBat 33 | 34 | * Provided the translations for Hindi. 35 | 36 | -------------------------------------------------------------------------------- /THANKS.tea: -------------------------------------------------------------------------------- 1 | {{Thanks}} 2 | 3 | This is a list of people and contributors I would particularly 4 | like to thank for their help on the project. Without them, pBat would 5 | certainly not be so advanced today. 6 | 7 | - Teddy Astie (aka TSnake41) 8 | 9 | -- Originated the new build system that we use to build pBat, 10 | which is way more easy to use than this awkward GNU 11 | autotools stuff. 12 | 13 | -- Lots of new bugs of the interpretor submitted particularly 14 | using the well known command darkbox and the httpBat 15 | script he and Xenoxis designed. 16 | 17 | -- Lots of interpretor testing 18 | 19 | -- Contributions to the interpretor code. Designed the Pushd 20 | Popd sections of pBat. 21 | 22 | -- Providing various programs intended to work with pBat. 23 | 24 | - IK_DC - Xenoxis 25 | 26 | -- Lots of bugs submitted 27 | 28 | -- Created designs for the new html man pages and pBat website 29 | 30 | -- Programmed the VER command. 31 | 32 | - Karanveer Chouhan (aka KVC) 33 | 34 | -- Help reviewing of pBat 35 | 36 | -- Provided the translations for Hindi. 37 | -------------------------------------------------------------------------------- /build-mingw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | CC=i686-w64-mingw32-gcc EXEC_SUFFIX=.exe CFLAGS="-O2 -s" LDFLAGS="-O2 -s" make $* 3 | -------------------------------------------------------------------------------- /config.c.in: -------------------------------------------------------------------------------- 1 | /* generate broken code if neither WIN32 or MINGW64-w64 is defined */ 2 | 3 | #define CHECK_WIN32 1 4 | #define CHECK_MINGW_W64 2 5 | 6 | #ifdef CHECK_@fnp@ 7 | #if CHECK_@fnp@ == CHECK_WIN32 8 | #ifndef WIN32 9 | break 10 | #endif /* WIN32 */ 11 | #elif CHECK_@fnp@ == CHECK_MINGW_W64 12 | #ifdef __MINGW32__ 13 | #include <_mingw.h> 14 | #ifndef __MINGW64_VERSION_MAJOR 15 | break 16 | #endif /* __MINGW64_VERSION_MAJOR */ 17 | #else /*__MINGW32__ */ 18 | break 19 | #endif /* __MINGW32__ */ 20 | #endif /* CHECKS */ 21 | #endif /* CHECK_@fnp@ */ 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /doc.ft: -------------------------------------------------------------------------------- 1 | # Footer for the repository version of the quick starting guide 2 | 3 | If you want to dig deepeer, do not hesitate to browse the documentation. 4 | {doc/commands|Command index} and {doc/spec/index|Specification index} are 5 | good places to start. Have fun ! -------------------------------------------------------------------------------- /doc.hd: -------------------------------------------------------------------------------- 1 | --- 2 | title: Doc 3 | description: Quick starting guide 4 | layout: default 5 | --- 6 | -------------------------------------------------------------------------------- /dump/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | include ../config.mk 21 | 22 | SRC_FILES=dump.c 23 | 24 | all: dump$(EXEC_SUFFIX) 25 | 26 | dump_h_gen$(EXEC_SUFFIX): dump_h_gen.c 27 | $(CC) -o dump_h_gen$(EXEC_SUFFIX) $(LDFLAGS) $(CFLAGS) dump_h_gen.c 28 | 29 | dump.h: dump_h_gen 30 | ./dump_h_gen$(EXEC_SUFFIX) > dump.h 31 | 32 | dump$(EXEC_SUFFIX): dump.h $(SRC_FILES) 33 | $(CC) -o dump$(EXEC_SUFFIX) $(LDFLAGS) $(CFLAGS) $(SRC_FILES) 34 | 35 | clean: 36 | rm -f dump$(EXEC_SUFFIX) dump_h_gen$(EXEC_SUFFIX) dump.h 37 | 38 | bin: dump 39 | cp dump$(EXEC_SUFFIX) $(BINDIR)/cmd/ 40 | 41 | .PHONY: all clean bin 42 | -------------------------------------------------------------------------------- /libcu8/CHANGELOG: -------------------------------------------------------------------------------- 1 | ,--. ,--. ,--. ,---. 2 | | | `--' | |-. ,---. ,--.,--. | o | 3 | | | ,--. | .-. ' | .--' | || | .' '. 4 | | '--. | | | `-' | \ `--. ' '' ' | o | 5 | `-----' `--' `---' `---' `----' `---' 6 | Changelog 7 | 8 | Version 1.0 9 | 10 | Initial release. -------------------------------------------------------------------------------- /libcu8/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, 2015, 2016, 2017 Romain GARBI 2 | 3 | All rights reserved. 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the name of Romain Garbi nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY ROMAIN GARBI AND CONTRIBUTORS ``AS IS'' AND ANY 17 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL ROMAIN GARBI AND CONTRIBUTORS BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES 22 | LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /libcu8/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | include $(ROOTDIR)/config.mk 21 | 22 | ifneq (,$(wildcard ./femto-config.mk)) 23 | include femto-config.mk 24 | endif 25 | 26 | CFLAGS += $(LIBCU8_INC) -I./include 27 | 28 | SRC_FILES = src/init.c src/encoding.c src/read.c src/write.c \ 29 | src/fdio.c src/spawn.c src/stat.c src/dup.c src/find.c src/dir.c \ 30 | src/dirent.c src/iconv/iconv.c 31 | 32 | OBJ_FILES = $(SRC_FILES:.c=.o) 33 | 34 | all: libcu8.a 35 | 36 | clean: 37 | rm -f $(OBJ_FILES) libcu8.a 38 | $(MAKE) -C test clean 39 | 40 | test: 41 | $(MAKE) -C test run-tests 42 | 43 | libcu8.a: $(OBJ_FILES) 44 | $(AR) r $@ $(OBJ_FILES) 45 | $(RANLIB) $@ 46 | 47 | bin: 48 | 49 | # stuff to check 50 | PROGRAMS = 51 | LIBS = iconv 52 | FUNCTIONS = _findfirst _findfirst32 _findfirst64 _findfirst32i64 \ 53 | _findfirst64i32 _stat _stat32 _stat64 _stat64i32 \ 54 | _stat32i64 55 | OPTIONS = 56 | DEFAULTOPTIONS = 57 | SUBCONFIG = 58 | ADDITIONALVARS = 59 | 60 | include ../femto.mk 61 | 62 | .PHONY: all bin clean $(SUBDIRS) $(SUBDIRS_CLEAN) po-merge test 63 | -------------------------------------------------------------------------------- /libcu8/config.c.in: -------------------------------------------------------------------------------- 1 | /* 2 | Dos9 Makefiles, The Dos9 project 3 | Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | int main(){ 24 | void* p = @fn@; 25 | return 0; 26 | } -------------------------------------------------------------------------------- /libcu8/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | Dos9 Makefiles, The Dos9 project 3 | Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #if @fn__findfirst@ 20 | #define HAVE__FINDFIRST 1 21 | #endif 22 | 23 | #if @fn__findfirst32@ 24 | #define HAVE__FINDFIRST32 1 25 | #endif 26 | 27 | #if @fn__findfirst32i64@ 28 | #define HAVE__FINDFIRST32I64 1 29 | #endif 30 | 31 | #if @fn__findfirst64@ 32 | #define HAVE__FINDFIRST64 1 33 | #endif 34 | 35 | #if @fn__findfirst64i32@ 36 | #define HAVE__FINDFIRST64I32 1 37 | #endif 38 | 39 | #if @fn__stat@ 40 | #define HAVE__STAT 1 41 | #endif 42 | 43 | #if @fn__stat32@ 44 | #define HAVE__STAT32 1 45 | #endif 46 | 47 | #if @fn__stat32i64@ 48 | #define HAVE__STAT32I64 49 | #endif 50 | 51 | #if @fn__stat64@ 52 | #define HAVE__STAT64 1 53 | #endif 54 | 55 | #if @fn__stat64i32@ 56 | #define HAVE__STAT64I32 1 57 | #endif 58 | 59 | #define PACKAGE "libcu8" 60 | #define PACKAGE_BUGREPORT "darkbatcher@dos9.org" 61 | #define PACKAGE_NAME "libcu8" 62 | #define PACKAGE_STRING "libcu8 1" 63 | #define PACKAGE_TARNAME "libcu8" 64 | #define PACKAGE_URL "http://www.dos9.org/" 65 | #define PACKAGE_VERSION "1" 66 | #define STDC_HEADERS 1 67 | #define VERSION "1" 68 | -------------------------------------------------------------------------------- /libcu8/src/config.h: -------------------------------------------------------------------------------- 1 | #include "../config.h" -------------------------------------------------------------------------------- /libcu8/src/iconv/iconv.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBICONV_H 2 | #define _LIBICONV_H 3 | #include 4 | #ifndef WINICONV_CONST 5 | # ifdef ICONV_CONST 6 | # define WINICONV_CONST ICONV_CONST 7 | # else 8 | # define WINICONV_CONST const 9 | # endif 10 | #endif 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | typedef void* iconv_t; 15 | iconv_t iconv_open(const char *tocode, const char *fromcode); 16 | int iconv_close(iconv_t cd); 17 | size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /libcu8/test/check_850: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbatcher/picobat/975e71d876b711c3de82692a981f88431206c2be/libcu8/test/check_850 -------------------------------------------------------------------------------- /libcu8/test/check_nl: -------------------------------------------------------------------------------- 1 | Proin famès 2 | vulputate conubié 3 | nûllam justo mauris 4 | condimentûm sènèktus 5 | du aenean elit. -------------------------------------------------------------------------------- /libcu8/test/check_u8: -------------------------------------------------------------------------------- 1 | Proin famès vulputate conubié nûllam justo mauris condimentûm sènèktus du aenean elit. -------------------------------------------------------------------------------- /libcu8/test/log_msg.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | libcu8 - A wrapper to fix msvcrt utf8 incompatibilities issues 4 | Copyright (c) 2014, 2015, 2016 Romain GARBI (Darkbatcher) 5 | 6 | All rights reserved. 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of the name of Romain Garbi (Darkbatcher) nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY ROMAIN GARBI AND CONTRIBUTORS ``AS IS'' AND ANY 20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL ROMAIN GARBI AND CONTRIBUTORS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES 25 | LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | */ 31 | #ifndef TEST_LOG_MSG_H 32 | #define TEST_LOG_MSG_H 33 | 34 | #define log_msg(msg) __log_msg(msg, sizeof(msg)-1) 35 | void __log_msg(const char* msg, size_t size); 36 | 37 | #include "log_msg.c" 38 | 39 | #endif /* TEST_LOG_MSG_H */ 40 | -------------------------------------------------------------------------------- /libfasteval/AUTHORS: -------------------------------------------------------------------------------- 1 | libmatheval authors: 2 | 3 | - Aleksandar Samardzic 4 | Department of Mathematics, University of Belgrade 5 | 6 | libfasteval authors: 7 | 8 | - Astie Teddy 9 | University of Tours -------------------------------------------------------------------------------- /libfasteval/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbatcher/picobat/975e71d876b711c3de82692a981f88431206c2be/libfasteval/ChangeLog -------------------------------------------------------------------------------- /libfasteval/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | ifneq (,$(wildcard ./femto-config.mk)) 21 | include femto-config.mk 22 | endif 23 | include ../config.mk 24 | 25 | ifdef lib_m 26 | LDFLAGS += -lm 27 | endif 28 | 29 | SRC_FILES = lib/fasteval.c lib/parser.c lib/scanner.c \ 30 | lib/xmath.c 31 | 32 | OBJ_FILES = $(SRC_FILES:.c=.o) 33 | 34 | all: libfasteval.a 35 | 36 | clean: 37 | rm -f $(OBJ_FILES) lib/scanner.c lib/parser.c lib/parser.h libfasteval.a 38 | 39 | bin: 40 | 41 | libfasteval.a: $(OBJ_FILES) 42 | $(AR) r $@ $(OBJ_FILES) 43 | $(RANLIB) $@ 44 | 45 | lib/scanner.c: lib/scanner.l lib/parser.c 46 | $(LEX) -Pevaluator_ -L -o$@ lib/scanner.l 47 | 48 | lib/parser.c: lib/parser.y 49 | $(YACC) -d -p evaluator_ -o $@ $^ 50 | 51 | # stuff to check 52 | PROGRAMS = 53 | FUNCTIONS = 54 | LIBS = m 55 | OPTIONS = 56 | DEFAULTOPTIONS = 57 | SUBCONFIG = 58 | ADDITIONALVARS = 59 | 60 | include ../femto.mk 61 | 62 | .PHONY: all clean bin 63 | -------------------------------------------------------------------------------- /libfasteval/THANKS: -------------------------------------------------------------------------------- 1 | This is list of people contributed to libmatheval by suggesting 2 | improvements and/or submitting actual code: 3 | 4 | Al Danial 5 | Giulio Bottazzi 6 | Steven G. Johnson 7 | -------------------------------------------------------------------------------- /libfasteval/lib/fasteval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 3 | * 2012, 2013, 2014 Free Software Foundation, Inc. 4 | * Copyright (C) 2022 Astie Teddy and pBat developers. 5 | * 6 | * This file is part of pBat libfasteval based on libmatheval 7 | * 8 | * pBat libfasteval is free software: you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * pBat libfasteval is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with pBat libfasteval. If not, see 20 | * . 21 | */ 22 | #ifndef FASTEVAL_H 23 | #define FASTEVAL_H 1 24 | 25 | struct fasteval_result_t { 26 | double result; 27 | int fmode; 28 | }; 29 | 30 | double fasteval_evaluate(char *expr, double (*get)(const char *), 31 | double (*set)(char *, double), int *fmode); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libpbat/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | include ../config.mk 21 | 22 | SRC_FILES := \ 23 | ./cmdlist/pBat_CmdList.c ./console/pBat_Console.c \ 24 | ./console/pBat_ConsoleANSI.c ./console/pBat_ConsoleWin.c \ 25 | ./console/pBat_ConsoleDummy.c ./dir/pBat_Attr.c ./dir/pBat_Dir.c \ 26 | ./dir/pBat_UnicodeDir.c ./enc/pBat_Enc.c ./estr/pBat_Estr.c \ 27 | ./stack/pBat_Stack.c ./thread/pBat_Thread.c ./file/pBat_StdFile.c \ 28 | ./file/pBat_Win32File.c ./init/pBat_Init.c ./cmdlib/pBat_String.c \ 29 | ./sleep/pBat_Sleep.c 30 | 31 | CFLAGS += $(LIBCU8_INC) $(LIBPBAT_INC) 32 | 33 | OBJ_FILES := $(SRC_FILES:.c=.o) 34 | 35 | all: libpBat.a 36 | 37 | libpBat.a: $(OBJ_FILES) 38 | $(AR) r $@ $(OBJ_FILES) 39 | $(RANLIB) $@ 40 | 41 | clean: 42 | rm -f $(OBJ_FILES) libpBat.a 43 | 44 | .PHONY: all tea clean 45 | -------------------------------------------------------------------------------- /libpbat/console/pBat_ConsoleDummy.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "../libpBat.h" 4 | #include "../../config.h" 5 | 6 | #ifdef LIBPBAT_NO_CONSOLE 7 | 8 | void pBat_ClearConsoleScreen(FILE *f) 9 | { 10 | } 11 | 12 | void pBat_SetConsoleColor(FILE *f, COLOR cColor) 13 | { 14 | } 15 | 16 | void pBat_SetConsoleTextColor(FILE* f, COLOR cColor) { 17 | } 18 | 19 | LIBPBAT void pBat_SetConsoleCursorPosition(FILE* f, CONSOLECOORD iCoord) 20 | { 21 | } 22 | 23 | LIBPBAT CONSOLECOORD pBat_GetConsoleCursorPosition(FILE* f) 24 | { 25 | return (CONSOLECOORD){0,0}; 26 | } 27 | 28 | LIBPBAT void pBat_SetConsoleCursorState(FILE* f, int bVisible, int iSize) 29 | { 30 | } 31 | 32 | void pBat_SetConsoleTitle(FILE* f, char* lpTitle) 33 | { 34 | } 35 | void pBat_ClearConsoleLine(FILE* f) 36 | { 37 | } 38 | 39 | void pBat_GetMousePos(FILE* f, char on_move, CONSOLECOORD* coords, int* type) 40 | { 41 | type = 0; 42 | coords->X = 0; 43 | coords->Y = 0; 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /libpbat/init/pBat_Init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * libpBat - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #include "../libpBat.h" 21 | #include "../libpBat-int.h" 22 | 23 | #include "../../config.h" 24 | 25 | #ifdef WIN32 26 | #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING 27 | #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x4 28 | #endif 29 | #endif 30 | 31 | LIBPBAT int pBat_LibInit(void) 32 | { 33 | #if defined(WIN32) && defined(LIBPBAT_W10_ANSI) 34 | /* Enable VT processing. */ 35 | HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); 36 | DWORD mode; 37 | 38 | GetConsoleMode(hOut, &mode); 39 | mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; 40 | SetConsoleMode(hOut, mode); 41 | #endif 42 | 43 | #if defined(WIN32) && defined(PBAT_USE_LIBCU8) 44 | if (libcu8_init(NULL) == -1) 45 | return -1; 46 | #endif // defined 47 | 48 | return 0; 49 | } 50 | 51 | LIBPBAT void pBat_LibClose(void) 52 | { 53 | } 54 | -------------------------------------------------------------------------------- /libpbat/sleep/pBat_Sleep.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * libpBat - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifndef WIN32 30 | void pBat_Sleep(unsigned int ms) 31 | { 32 | struct timespec ts; 33 | 34 | ts.tv_sec = ms / 1000; 35 | ts.tv_nsec = (ms % 1000) * 1000000; 36 | 37 | nanosleep(&ts, NULL); 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /man/en_US/break.tea: -------------------------------------------------------------------------------- 1 | {{BREAK Command}} 2 | 3 | The {break} command is a command inherited from {MS-DOS} systems. 4 | It was used to enable or discard the catch of the interruption 5 | signal (ie. the signal raised when CTRL-C is pressed). 6 | 7 | {{Synopsis}} 8 | 9 | ${BREAK [ON | OFF]} 10 | 11 | Does nothing. Interruption signal capture is always enabled with {pbat|pBat}. 12 | This command does also nothing since {Vista} on {cmd}. 13 | 14 | {{Compatibility}} 15 | 16 | 17 | Compatible with {cmd}. Available since {1.0b} 18 | 19 | {{See also}} 20 | 21 | {commands|Commands list} 22 | -------------------------------------------------------------------------------- /man/en_US/cls.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{CLS command}} 19 | 20 | The {CLS} command clears console's screen. 21 | 22 | {{Synopsis}} 23 | 24 | ${ CLS} 25 | 26 | Clear the console's screen. 27 | 28 | {{Compatibility}} 29 | 30 | Completly compatible with {cmd.exe} 31 | 32 | {{See also}} 33 | 34 | {echo|ECHO command}, {title|TITLE command}, 35 | {commands|Command list} 36 | -------------------------------------------------------------------------------- /man/en_US/del.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{DEL and ERASE commands}} 19 | 20 | Delete one or more files. 21 | 22 | {{Synopsis}} 23 | 24 | ${DEL [/P] [/F] [/S] [/Q] [/A[:]attributes] name ... 25 | ERASE [/P] [/F] [/S] [/Q] [/A[:]attributes] name ...} 26 | 27 | Delete one or more files. 28 | 29 | - {/P} : Ask confirmation before deleting file. 30 | 31 | - {/F} : Force read-only files deletion. 32 | 33 | - {/Q} : Do not ask confirmation when using {spec/regexp|regular 34 | expressions}. 35 | 36 | - {/A[:]attributes} : Delete only the files that match the specified 37 | attributes. Check {spec/regexp|regular expression} for more information. 38 | 39 | - {/S} : Recursive mode. Deletes files in folders and sub folders. 40 | 41 | - {name} : A list of files to be deleted. Paths can include 42 | {spec/regexp|regular expressions}. If any of the paths specified refer 43 | to a directory, every file inside that directory is deleted. 44 | 45 | {{Compatibility}} 46 | 47 | Available since revision {0.4}. 48 | 49 | Fully compatible with {cmd.exe}. 50 | 51 | {{See also}} 52 | 53 | {rd|RD and RMDIR commands}, {md|MD and MKDIR commands}, 54 | {move|MOVE command} 55 | -------------------------------------------------------------------------------- /man/en_US/echo.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{ECHO command}} 20 | 21 | The {ECHO} command has various uses : 22 | 23 | - Enable/disable current directory echoing. 24 | 25 | - Show text in console. 26 | 27 | {{Synopsis}} 28 | 29 | ${ ECHO [OFF|ON] 30 | ECHO text 31 | ECHO.text} 32 | 33 | Enables/disables current directory echoing (i.e. {``PBAT ...>''}). 34 | 35 | - {ON} : Enable 36 | 37 | - {OFF} : Disable 38 | 39 | Show text in console. 40 | 41 | - {text} : Text to be printed. If you use {ECHO.}, the {text} can be void, in this case, 42 | {pbat|pBat} will print an empty line. 43 | 44 | {{Compatibility}} 45 | 46 | Fully compatible with {cmd.exe}. 47 | 48 | {{See also}} 49 | 50 | {pause|PAUSE command},{set|SET command},{title|TITLE command},{cls|CLS command},{commands|Command list} 51 | -------------------------------------------------------------------------------- /man/en_US/exit.tea: -------------------------------------------------------------------------------- 1 | {{EXIT Command}} 2 | 3 | The {EXIT} command quit {pbat|pBat} current instance, optionally 4 | returning an exit code. Exit can also be used to exit the current 5 | subroutine. 6 | 7 | {{Synopsis}} 8 | 9 | ${EXIT [/b] [code]} 10 | 11 | Exit the command prompt. 12 | 13 | - {/b} : Exit only from the current execution level (the current subroutine), 14 | with a behaviour similar to {goto|GOTO:EOF}, except a return value can be 15 | specified. If employed outside a subroutine, {/b} has no impact on the command 16 | behaviour. 17 | 18 | - {code} : Specify an integer to be returned as exit code. This integer is 19 | usually bound to a 32-bit signed integer, that is between {2147483647} and 20 | {-2147483648}. The exit code can be accessed through the variables 21 | {errorlevel|%ERRORLEVEL% and %=EXITCODEASCII%}. 22 | 23 | If {code} is not specified, then the {%ERRORLEVEL%} value is unchanged. 24 | 25 | {{Compatibility}} 26 | 27 | Available since {0.4}. 28 | 29 | Compatible with {cmd.exe} 30 | 31 | {{See also}} 32 | 33 | {goto|GOTO command}, {commands|Command list} -------------------------------------------------------------------------------- /man/en_US/help.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{HELP command}} 20 | 21 | Print a list of {pBat} commands accompaigned by a short description 22 | of these commands. It is also possible to print manual pages. 23 | 24 | By default, the {HELP} command is a alias pointing to {hlp|HLP command} 25 | 26 | {{Synopsis}} 27 | 28 | ${HELP [command]} 29 | 30 | Prints either a list of commands or a manual page: 31 | 32 | - {command} : The command name associated to the manual page to 33 | print. 34 | 35 | By default, {HELP} is overriden by an {def|DEF} command in 36 | {pbat_auto|pBat_Auto.bat} that associate {HELP} with {hlp|HLP}. 37 | This alias can be removed by removing the following line from 38 | your {pBat_Auto.bat}: 39 | 40 | ${DEF /b HELP=hlp.bat $*} 41 | 42 | {{Compatibility}} 43 | 44 | Compatible with {cmd.exe}. 45 | 46 | Available since version {0.0.0.42}. 47 | 48 | {{See also}} 49 | 50 | {hlp|HLP command}, {echo|ECHO command}, {set|SET command}, 51 | {scripts|Command scripts} 52 | -------------------------------------------------------------------------------- /man/en_US/license.tea: -------------------------------------------------------------------------------- 1 | {{pBat license}} 2 | 3 | {pbat|Picobat} is a free software distributed under the {GNU GPLv3} terms. 4 | This license give you right to run, modify, distribute either modified 5 | or verbatim copies of the program, provided that these ones will be 6 | distributed under copyleft-compatible license. 7 | 8 | To read the whole agreement, see the {COPYING} file in your {pbat|pBat} 9 | directory. 10 | 11 | Picobat also include code from {libmatheval} (licensed under GPLv3) and 12 | {darkbox} (licensed under MIT license). To read the whole agreements, 13 | please see {COPYING.darkbox} and {COPYING.libmatheval} 14 | 15 | {{License notice}} 16 | 17 | pBat - Command prompt and interpreter for windows batch files 18 | Copyright (C) 2013 DarkBatcher (Romain Garbi) 19 | 20 | This program is free software; you can redistribute it and/or modify 21 | it under the terms of the GNU General Public License as published by 22 | the Free Software Foundation; either version 2 of the License, or 23 | (at your option) any later version. 24 | 25 | This program is distributed in the hope that it will be useful, 26 | but {WITHOUT ANY WARRANTY}; without even the implied warranty of 27 | {MERCHANTABILITY} or {FITNESS FOR A PARTICULAR PURPOSE}. See the 28 | GNU General Public License for more details. 29 | 30 | You should have received a copy of the GNU General Public License 31 | along with this program; if not, write to the Free Software 32 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 33 | 02110-1301 USA 34 | 35 | {{See also}} 36 | 37 | {commands|Index} 38 | -------------------------------------------------------------------------------- /man/en_US/locale.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{LOCALE command}} 20 | 21 | The {LOCALE} command tells {pbat|pBat} the path to load translation 22 | files. {pBat} uses {.mo} files, generated using GNU gettext though 23 | it uses its own internals to read translation files. 24 | 25 | {{Synopsis}} 26 | 27 | ${LOCALE path} 28 | 29 | Tries to load translation messages from {path} using the current 30 | language of the OS. At startup, {pBat} searches for translation 31 | files in {%PBAT_PATH%/share/locale/}, but the {LOCALE} enables 32 | translations files to be loaded from anywhere on the disk. 33 | 34 | If custom paths for translation files are used, this command can 35 | be used to set up the proper configuration in {pbatauto|pBat_Auto.bat} 36 | which is executed every time a {pBat} process is started. 37 | 38 | {{Compatibility}} 39 | 40 | Specific to pBat. 41 | 42 | {{See also}} 43 | 44 | {commands|Commands list} 45 | -------------------------------------------------------------------------------- /man/en_US/md.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{MD and MKDIR commands}} 19 | 20 | Creates a new directory. 21 | 22 | {{Synopsis}} 23 | 24 | ${MD directory 25 | MKDIR directory} 26 | 27 | Creates a new folder. 28 | 29 | - {directory} : Path of the directory to be created. If {directory} 30 | contain several folder names that do not already exist, these are 31 | created either. For example, if neither {a}, {b} nor {c} are existing, 32 | then: 33 | 34 | ${MD a/b/c} 35 | @- Is the same as : 36 | 37 | ${MD a 38 | MD a/b 39 | MD a/b/c} 40 | 41 | {{Compatibility}} 42 | 43 | Available since version {0.4}. 44 | 45 | Fully compatible with {cmd.exe}. 46 | 47 | {{See also}} 48 | 49 | {rd|RD and RMDIR command}, {del|DEL and ERASE command}, 50 | {move|MOVE command}, {copy|COPY command} 51 | -------------------------------------------------------------------------------- /man/en_US/pause.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{PAUSE command}} 20 | 21 | Pause batch file execution. 22 | 23 | {{Synopsis}} 24 | 25 | ${PAUSE} 26 | 27 | Show the message: {"Hit a key to continue"} and wait for a keystroke. 28 | 29 | {{Compatibility}} 30 | 31 | Fully compatible with {cmd.exe} 32 | 33 | {{See also}} 34 | 35 | {echo|ECHO command}, {set|SET command}, {commands|Command List} 36 | -------------------------------------------------------------------------------- /man/en_US/pecho.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{PECHO command}} 19 | 20 | The {PECHO} command outputs message formatted following rules 21 | defined by {prompt|PROMPT}. This enables for example to change temporarily 22 | the text colour. 23 | 24 | {{Synopsis}} 25 | 26 | ${PECHO format 27 | PECHO.format} 28 | 29 | Output {format} according to rules defined by {prompt|PROMPT}. 30 | 31 | {{Compatibility}} 32 | 33 | {PECHO} is a {pbat|pBat} extension. 34 | Available since {218.2}. 35 | 36 | {{See also}} 37 | 38 | {commands|Commands list} -------------------------------------------------------------------------------- /man/en_US/popd.tea: -------------------------------------------------------------------------------- 1 | # pBat Manual pages, The pBat project 2 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 3 | # Copyright (C) 2016-2017 Teddy Astie (TSnake41) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{POPD command}} 20 | 21 | The {POPD} command permit to pull a directory from {the directory stack} 22 | to define the current directory. 23 | 24 | {{Synopsis}} 25 | 26 | ${POPD} 27 | 28 | Define the {current directory} directory pulled from the stack. 29 | 30 | The command fail if no directories are present in the stack. 31 | 32 | {{Compatibility}} 33 | 34 | Fully compatible with {cmd.exe}. 35 | 36 | {{See also}} 37 | 38 | {pushd|PUSHD command}, 39 | {spec/dirstack|The directory stack}, 40 | {commands|Command list} 41 | -------------------------------------------------------------------------------- /man/en_US/pushd.tea: -------------------------------------------------------------------------------- 1 | # pBat Manual pages, The pBat project 2 | # Copyright (C) 2016-2017 Teddy Astie (TSnake41) 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | 18 | {{PUSHD command}} 19 | 20 | The {PUSHD} command permit to display which directory is at the 21 | top of {the directory stack} and change current directory by 22 | pushing the previous into {the directory stack}. 23 | 24 | {{Synopsis}} 25 | 26 | ${ PUSHD [path1] [path2] [path3] [pathX] } 27 | 28 | For each specified directories : change the {current directory} then 29 | pushd the previous to {the directory stack}. 30 | 31 | If no path is specified, show which {directory} is at the top of the 32 | {the directory stack}. 33 | 34 | In case of error, the {error code} match with the failed {path}. 35 | 36 | {{Compatibility}} 37 | 38 | Mostly compatible with {cmd.exe}. The paths containing spaces must be 39 | delimited by double quotes to use multiples directories without confusion. 40 | 41 | Multiples directories are an {pBat} extension. 42 | 43 | {{See also}} 44 | 45 | {cd|CD command}, {popd|POPD command}, 46 | {spec/dirstack|Directory stack}, 47 | {commands|Command list} 48 | -------------------------------------------------------------------------------- /man/en_US/random.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{%RANDOM% Variable}} 19 | 20 | The {%RANDOM%} variable generates a random number. 21 | 22 | {{Synopsis}} 23 | 24 | ${%RANDOM%} 25 | 26 | Gets expanded into a random generated number ranging from {0} to {32767} on 27 | Windows (On Unix-like, the upper bound depends on the implementation). 28 | The number changes every time a variable is expanded even during 29 | {spec/exp|delayed expansion}. 30 | 31 | {{Compatibility}} 32 | 33 | Compatible with {cmd.exe} 34 | 35 | Available since {0.7}. 36 | 37 | {{A voir aussi}} 38 | 39 | {spec/var|Variables d'environement}, {spec/index|Index des spécifications} 40 | -------------------------------------------------------------------------------- /man/en_US/rd.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{RD and RMDIR commands}} 19 | 20 | Removes a directory. 21 | 22 | {{Synopsis}} 23 | 24 | ${RMDIR [/S] [/Q] directory 25 | RD [/S] [/Q] directory} 26 | 27 | Removes a directory. 28 | 29 | - {directory} : The folder to be suppressed. 30 | 31 | - {/Q} : Enable silenced mode; do not prompt the user for 32 | confirmation. 33 | 34 | - {/S} : Deletes files and subfolders contained by {directory}. 35 | Use this switch to delete an entire tree. 36 | 37 | {{Notes}} 38 | 39 | By default, {RD} and {RMDIR} do not delete non empty folder. To force 40 | folder deletion, use the {/S} switch. 41 | 42 | {{Compatibility}} 43 | 44 | Available since {0.4} revision. 45 | 46 | Fully compatible with {cmd.exe}. 47 | 48 | {{See also}} 49 | 50 | {md|MD and MKDIR commands}, {del|DEL and ERASE commands}, 51 | {move|MOVE command} 52 | -------------------------------------------------------------------------------- /man/en_US/rem.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande REM}} 20 | 21 | The {REM} Command introduces a comment inside a batch script. 22 | 23 | {{Synopsis}} 24 | 25 | ${REM comment} 26 | 27 | Introduces a comment inside a batch script 28 | 29 | - {comment} : The comment to be included. This parameter can not 30 | contain any special characters that could be interpreted by pBat such as 31 | {|} or {&}. 32 | 33 | {{Notes}} 34 | 35 | This commande is somehow useless, either inside a script or on the command 36 | prompt. It is highly recommended to use the newer style of comment as 37 | described in {spec/comments|comments} page. 38 | 39 | {{See also}} 40 | 41 | {commands|Command list}, {echo|ECHO Command} -------------------------------------------------------------------------------- /man/en_US/ren.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{REN and RENAME Commands}} 19 | 20 | {REN} and {RENAME} commands are used to rename files. Theses commands 21 | can only rename files, they can not move them. 22 | 23 | {{Synopsis}} 24 | 25 | ${REN file name.ext 26 | RENAME file name.ext} 27 | 28 | Renames {file}: 29 | 30 | - {file} : A path referring to the file to be renamed. It can not 31 | be a {spec/regexp|regular expression}. 32 | 33 | - {nom.ext} : The new name and extension of the file. The extension can 34 | be omitted 35 | 36 | {{Compatibility}} 37 | 38 | Available since {0.4}. 39 | 40 | Fully compatible with {cmd.exe} 41 | 42 | {{See Also}} 43 | 44 | {copy|COPY Command}, {move|MOVE Command}, {type|TYPE and MORE Commands} 45 | {del|DEL and ERASE Commands} 46 | -------------------------------------------------------------------------------- /man/en_US/spec/index.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{Specifications}} 19 | 20 | - {cmdline|Command line} specification. 21 | 22 | - {parse|pBat parsing} specifications. 23 | 24 | - {red|Stream Redirections} specifications. 25 | 26 | - {condop|Conditional operators} specifications. 27 | 28 | - {exp|Variable expansion} specifications. 29 | 30 | - {var|Environment variables} specifications. 31 | 32 | - {xvar|Special variables} specifications. 33 | 34 | - {regexp|Regular expressions} specifications. 35 | 36 | - {attr|File attributes} specifications. 37 | 38 | - {dirstack|Directories stack} specifications. 39 | 40 | {{See Also}} 41 | 42 | {../commands|List of Commands} 43 | -------------------------------------------------------------------------------- /man/en_US/tea_syntax.tea: -------------------------------------------------------------------------------- 1 | {{TEA language specification}} 2 | 3 | The {TEA language} is the language used for formatting {tea|TEA} source files. 4 | It is a really simple markup language intended to be used with {pbat|pBat}. 5 | 6 | {{Block delimiters}} 7 | 8 | ${{{...}} 9 | 10 | ${...} 11 | 12 | - ... 13 | 14 | ...} 15 | 16 | {Block delimiters} are used to change paragraph type. A paragraph is formed 17 | by a group lines of text following each other without a blank line. There is 18 | 4 types of block delimiters. 19 | 20 | - {\{\{...\}\}} : Denotes a title. 21 | 22 | - {$\{...\}} : Denotes a block of code. 23 | 24 | - {- ...} : Denotes a list. Several list can be nested by using two or 25 | more minus signs. It is possible to hide the {-} by using a {@} before them. 26 | 27 | - {...} : Denotes a normal paragraph. 28 | 29 | {{Inline delimiters}} 30 | 31 | ${{foo} 32 | {target|text}} 33 | 34 | {Inline delimiters} are used to add features to a paragraph. They can not 35 | be used in a {code block} though. There is two of them: 36 | 37 | - {\{foo\}} : Denotes an emphasis on {foo} 38 | 39 | - {\{target\|text\}} : Denotes a link. The parameter {text} is used as the 40 | text representing the link while {target} is the path to the target of the 41 | line. If {target} specifies no file extension, {TEA} will automatically add 42 | an appropriate extension unless the link begins with {http://}, {https://} or 43 | {mail://}. 44 | 45 | {{Comments}} 46 | 47 | Comments can be introduced using the {#} character 48 | 49 | ${# comment} 50 | 51 | It is important that the dash {#} is at the first column of the source file 52 | for {tea|TEA} to interpret it as a comment. 53 | 54 | {{Escaping}} 55 | 56 | Any character can be escaped using {\\}. 57 | 58 | {{See Also}} 59 | 60 | {tea|TEA Command} 61 | -------------------------------------------------------------------------------- /man/en_US/time.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2021 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{%DATE% and %TIME% variables}} 20 | 21 | The {%DATE%} and {%TIME%} environment variable expand to current date 22 | and time. 23 | 24 | {{Synopsis}} 25 | 26 | ${%TIME%} 27 | 28 | Expands to the current hour, using appropriate locale format. 29 | (usually {HH:MM:SS,cc}). The support of centiseconds depends on the 30 | platform. Since version {218.2} centiseconds are supported using 31 | windows, though this is still not the case for *nixes. Note that the {%TIME%} 32 | variable includes leading {0} for hours also. 33 | 34 | ${%DATE%} 35 | 36 | Expands to current date, using appropriate locale format. Leading zeros are 37 | also added between fields. 38 | 39 | {{Note}} 40 | 41 | {%TIME%} and {%DATE%} are dynamic variables, meaning that they are generated 42 | during the {spec/exp|variable expansion}. Thus these variables can not be 43 | modified using {set|SET}. 44 | 45 | {{Compatiblity}} 46 | 47 | Compatible with {cmd.exe}. 48 | 49 | Available since {0.7} 50 | 51 | {{See also}} 52 | 53 | {spec/var|Environment variable}, {spec/index|Specification index} 54 | 55 | -------------------------------------------------------------------------------- /man/en_US/title.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{TITLE Command}} 19 | 20 | Change console title. 21 | 22 | {{Synopsis}} 23 | 24 | ${ TITLE title} 25 | 26 | Change title to {title}. 27 | 28 | {{Compatibility}} 29 | 30 | Fully compatible with {cmd.exe} 31 | 32 | {{See Also}} 33 | 34 | {echo|ECHO Command}, {cls|CLS command}, {commands|Command list} -------------------------------------------------------------------------------- /man/en_US/ver.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{VER Command}} 19 | 20 | Prints operating system's version informations. 21 | 22 | {{Synopsis}} 23 | 24 | ${VER} 25 | 26 | Prints operating version infos. Depending on the platform, and/or the 27 | Linux distribution you use, the message displayed might vary. However, 28 | the message displayed on Windows platforms is designed to be 29 | compatible. 30 | 31 | If you need less specific information about the operating system on 32 | which {pbat|pBat} is being executed, consider using the 33 | {pbatvar|%PBAT_OS_TYPE% or %PBAT_OS%} instead. 34 | 35 | {{Thanks}} 36 | 37 | The code for this command has been contributed by Xenoxis. 38 | 39 | {{Compatibility}} 40 | 41 | Compatible with {cmd.exe}. Available since version {218.3}. 42 | 43 | {{See Also}} 44 | 45 | {pbatvar|pBat default variables} -------------------------------------------------------------------------------- /man/en_US/xargs.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2017 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{XARGS Command}} 19 | 20 | The {XARGS} command allow to run a command with arguments from the standard 21 | input. 22 | 23 | {{Synopsis}} 24 | 25 | ${XARGS [command ...]} 26 | 27 | Run a command with arguments from the standard input. 28 | 29 | - {command ...}: A command, either internal or external. Any special charactersUne 30 | encountered in command or in the command input (| et &) will have no effect. 31 | 32 | As {pBat} reads through the standard input, only newlines will be removed from 33 | final parameters. If a line read from the standard contains spaces or delimiters 34 | (ie. tabs, comma, semicolon) then the whole line will automatically be quoted by 35 | {xargs} to create a single parameter. 36 | 37 | {{Compatibility}} 38 | 39 | Unavailable on {cmd.exe}. Available since {217.1}. 40 | 41 | {{See Also}} 42 | 43 | {commands|Command list}, {wc|WC command} 44 | 45 | -------------------------------------------------------------------------------- /man/footer: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Picobat manual pages - The Picobat project © 2010-2021 Romain Garbi, Teddy Astie &c.

5 |

This is free software, fell free to modify and distribute under the terms 6 | of GPLv3

7 |

Theme based on Picocms main theme

8 |
9 |
10 | 12 | 14 | 15 | 19 | -------------------------------------------------------------------------------- /man/fr_FR/break.tea: -------------------------------------------------------------------------------- 1 | {{Commande BREAK}} 2 | 3 | La commande break est une commande héritée des systèmes MS-DOS. Elle 4 | permettait d'activer la capture du signal d'interuption (ie. Quand l'utilisateur 5 | appuie sur CTRL-C). 6 | 7 | {{Synopsis}} 8 | 9 | ${BREAK [ON | OFF]} 10 | 11 | Ne fait rien; La capture du signal d'interuption est effective constament 12 | sur {pbat|pBat}. Cette commande n'est plus opérante sur les systèmes {Windows} 13 | depuis {Vista}. 14 | 15 | {{Compatibilité}} 16 | 17 | Compatible avec {cmd.exe}. Disponible depuis la version {1.0b}. 18 | 19 | {{À voir aussi}} 20 | 21 | {commands|Liste des commandes} 22 | -------------------------------------------------------------------------------- /man/fr_FR/cls.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande CLS}} 20 | 21 | La commande {CLS} permet de vider le contenu de la console 22 | 23 | {{Synopsis}} 24 | 25 | ${ CLS} 26 | 27 | Efface le contenu de la console et place le curseur en haut à gauche 28 | 29 | {{Compatibilite}} 30 | 31 | Parfaitement compatible avec {cmd.exe} 32 | 33 | {{A voir aussi}} 34 | 35 | {echo|Commande ECHO}, {title|Commande TITLE}, 36 | {commands|Liste des commandes} 37 | -------------------------------------------------------------------------------- /man/fr_FR/echo.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande ECHO}} 20 | 21 | La commande {ECHO} a de multiples usages : 22 | 23 | - Activer ou desactiver l'affichage du chemin courrant 24 | 25 | - Afficher du texte dans la console 26 | 27 | {{Synopsis}} 28 | 29 | ${ ECHO [OFF|ON] 30 | ECHO texte 31 | ECHO.texte} 32 | 33 | Active ou desactive l'affichage du chemin courrant ({PBAT C:\...>}) 34 | 35 | - {ON} : Active l'affichage 36 | 37 | - {OFF} : Desactive l'affichage 38 | 39 | Affiche du texte dans la console 40 | 41 | - {texte} : texte a afficher dans la console. Si vous utilisez 42 | {ECHO.} le texte {texte} peut être vide. Depuis la version {2014.0.8}, il est 43 | possible d'utiliser d'autre caractères que {.} pour forcer l'affichage. Les 44 | caractères autorisés sont donc {!"#$%&'()*+,-./[\\]^_ \{\|\}~}, l'usage d'une 45 | grande partie de ces caractères est déconseillée a cause de problèmes de 46 | syntaxe évidents. 47 | 48 | {{Compatibilite}} 49 | 50 | Cette commande est {parfaitement compatible} avec {cmd.exe} 51 | 52 | {{A voir aussi}} 53 | 54 | {pause|Commande PAUSE}, {set|Commande SET}, {title|Commande TITLE}, {cls|Commande CLS}, {commands|Liste des commandes} 55 | -------------------------------------------------------------------------------- /man/fr_FR/errorlevel.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Variable %ERRORLEVEL%}} 20 | 21 | {%ERRORLEVEL%} est une variable d'environnement définie automatiquement par {pbat|pBat} lors de l'exécution d'une commande. 22 | Elle permet de détecter si une erreur a eu lieu et si oui de quel type s'agit t'il. 23 | De manière générale, si {%ERRORLEVEL%} est nulle, alors aucune erreur ne s'est produite. 24 | 25 | {{Synopsis}} 26 | 27 | ${ %ERRORLEVEL%} 28 | 29 | De manière générale, il ne faut pas accorder de sens spécial aux valeurs de {%ERRORLEVEL%} si elles sont différentes de 30 | 0, car les codes de retour sont spécifiques à chaque commande. 31 | 32 | Il faut plutôt considérer qu'une valeur non nulle de {%ERRORLEVEL%} est une erreur quelquonque, qui sera affichée à l'invité. 33 | 34 | {{A voir aussi}} 35 | 36 | {spec/var|Variables}, {home|Accueil} -------------------------------------------------------------------------------- /man/fr_FR/exit.tea: -------------------------------------------------------------------------------- 1 | {{Commande EXIT}} 2 | 3 | La commande de quitter l'interpréteur de commande {pBat}, en retournant 4 | (éventuellement) un code particulier. 5 | 6 | {{Synopsis}} 7 | 8 | ${EXIT [/b code]} 9 | 10 | Quitte l'interpréteur de commande. 11 | 12 | - {/b code} : spécifie le code à retourner lors de la fin de l'exécution 13 | de {pBat}. Ce code est traditionnellement compris entre {2 147 483 647} 14 | et {-2 147 483 648}, même si cette valeur peut varier en fonction du 15 | système d'exploitation. 16 | 17 | {{Notes}} 18 | 19 | Bien que l'effet de {EXIT} semble similaire à l'effet de {goto|GOTO:EOF}, il n'en 20 | est rien, leurs comportements sont biens différents : 21 | 22 | - {EXIT} quitte purement et simplement le programme de commande, même si 23 | l'exécution d'une fonction ou d'un script par {call|CALL} est en cours. 24 | 25 | - {GOTO:EOF} quitte seulement le script de plus haut niveaux, et cela sans 26 | retourner de code. Si la partie de code exécutée n'est pas une fonction, il 27 | n'y a pas de différence, mais si on est bel et bien dans une fonction, alors 28 | le script retourne au point qui a appellé le script ou la fonction. 29 | 30 | {{Compatibilité}} 31 | 32 | Disponible depuis la version {0.4}. 33 | 34 | Entièrement compatible avec {cmd.exe} 35 | 36 | {{À voir aussi}} 37 | 38 | {goto|Commande GOTO}, {commands|Liste des commandes} -------------------------------------------------------------------------------- /man/fr_FR/help.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande HELP}} 20 | 21 | Affiche une {liste} de commandes externes et internes ainsi qu'une 22 | description sommaire de chaque commande. Il est aussi possible 23 | d'afficher des pages de manuels. 24 | 25 | Il s'agit en réalité d'un alias donnant sur la commande {hlp|HLP}. 26 | 27 | {{Synopsis}} 28 | 29 | ${HELP [commande]} 30 | 31 | Affiche une liste de commande externes et internes, ou une page de 32 | manual: 33 | 34 | - {commande} : le nom de la commande dont l'aide est à obtenir. 35 | 36 | {{Compatibilité}} 37 | 38 | Compatible avec {cmd.exe}. On peut néanmoins lui fournir bien plus 39 | d'arguments que pour la commande {help} de {cmd.exe}, car il sagit 40 | d'un alias de {hlp|HLP} 41 | 42 | {{À voir Aussi}} 43 | 44 | {hlp|Commande HLP}, {echo|Commande ECHO}, {set|Commande SET}, 45 | {scripts|Les scripts de commande} 46 | -------------------------------------------------------------------------------- /man/fr_FR/md.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commandes MD et MKDIR}} 20 | 21 | Les commandes {MD} et {MKDIR} permettent de créer un dossier. 22 | 23 | {{Synopsis}} 24 | 25 | ${MD dossier 26 | MKDIR dossier} 27 | 28 | Crée un dossier. 29 | 30 | - {dossier} : chemin du dossier à créer. Si {dossier} est une 31 | est un chemin comprenant plusieurs dossier n'existant pas, alors 32 | tous les dossiers n'existant pas sont crées. Par exemple, si ni 33 | {a} ni {b} ni {c} n'existent, alors: 34 | 35 | ${MD a/b/c} 36 | @- est équivalent à : 37 | 38 | ${MD a 39 | MD a/b 40 | MD a/b/c} 41 | 42 | {{Compatibilité}} 43 | 44 | Disponible depuis la version {0.4}. 45 | 46 | Complètement compatible avec {cmd.exe} depuis la version {215.1b}. 47 | 48 | 49 | {{A voir aussi}} 50 | 51 | {rd|Commandes RD et RMDIR}, {del|Commandes DEL et ERASE}, 52 | {move|Commande MOVE}, {copy|Commande COPY} 53 | -------------------------------------------------------------------------------- /man/fr_FR/pause.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande Pause}} 20 | 21 | La commande {PAUSE} permet d'interrompre l'exécution d'un script jusqu'a ce que l'utilisateur appuie sur une 22 | touche pour continuer le script. 23 | 24 | {{Synopsis}} 25 | 26 | ${PAUSE} 27 | 28 | Affiche le message {Appuyez sur une touche pour continuer}, puis attend que l'utilisateur appuie sur une touche. 29 | 30 | {{Compatibilite}} 31 | 32 | Complètement compatible avec {cmd.exe}. 33 | 34 | {{A voir aussi}} 35 | 36 | {echo|Commande ECHO}, {set|Commande SET}, {commands|Liste des commandes} 37 | -------------------------------------------------------------------------------- /man/fr_FR/pecho.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{Commande PECHO}} 19 | 20 | La commande {PECHO} affiche un message formaté suivant les règles définies 21 | par {prompt|PROMPT}. Ceci permet par exemple de temporairement changer la 22 | couleur du texte. 23 | 24 | {{Synopsis}} 25 | 26 | ${PECHO format 27 | PECHO.format} 28 | 29 | Affiche {format} suivant les règles définies par {prompt|PROMPT}. 30 | 31 | {{Compatibilité}} 32 | 33 | {PECHO} est une extension de {pbat|pBat}. 34 | Disponible depuis la version {218.2}. 35 | 36 | {{Voir aussi}} 37 | 38 | {commands|Liste de commandes} 39 | -------------------------------------------------------------------------------- /man/fr_FR/popd.tea: -------------------------------------------------------------------------------- 1 | # pBat Manual pages, The pBat project 2 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 3 | # Copyright (C) 2016-2017 Teddy Astie (TSnake41) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande POPD}} 20 | 21 | La commande {POPD} permet de tirer un répertoire de {la pile de répertoire} 22 | pour définir le dossier courant. 23 | 24 | {{Synopsis}} 25 | 26 | ${POPD} 27 | 28 | Défini le {dossier courant} par le répertoire tiré de la pile. 29 | 30 | La commande échoue si il n'y a aucun répertoire sur la pile. 31 | 32 | {{Compatibilité}} 33 | 34 | Parfaitement compatible avec {cmd.exe}. 35 | 36 | {{A voir aussi}} 37 | 38 | {pushd|Commande PUSHD}, 39 | {spec/dirstack|La pile de répertoire}, 40 | {commands|Liste des commandes} 41 | -------------------------------------------------------------------------------- /man/fr_FR/pushd.tea: -------------------------------------------------------------------------------- 1 | # pBat Manual pages, The pBat project 2 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 3 | # Copyright (C) 2016 Teddy Astie (TSnake41) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande PUSHD}} 20 | 21 | La commande {PUSHD} permet de d'afficher le répertoire présent en 22 | haut de {la pile de répertoire} et changer le dossier courant 23 | en poussant le précédent dans {la pile de répertoire}. 24 | 25 | {{Synopsis}} 26 | 27 | ${ PUSHD [chemin1] [chemin2] [chemin3] [cheminN] } 28 | 29 | Pour chaque chemin spécifié : change le {répertoire actuel} puis stocke 30 | l'ancien sur {la pile de répertoire}. 31 | 32 | Si aucun chemin n'est spécifié, affiche le {répertoire} qui est présent en 33 | haut de {la pile de repertoire}. 34 | 35 | En cas d'érreur, le {code de sortie} correspond au {chemin} qui a échoué. 36 | 37 | {{Compatibilité}} 38 | 39 | Majoritairement compatible avec {cmd.exe}. Les chemins à espaces doivent 40 | être délimités par des guillements afin de pouvoir utiliser de multiples 41 | chemins sans confusion. 42 | 43 | Les chemins multiples sont une extension de {pBat}. 44 | 45 | {{A voir aussi}} 46 | 47 | {cd|Commande CD}, {popd|Commande POPD}, 48 | {spec/dirstack|La pile de répertoire}, 49 | {commands|Liste des commandes} 50 | -------------------------------------------------------------------------------- /man/fr_FR/random.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Variable %RANDOM%}} 20 | 21 | La variable {%RANDOM%} permet de générer un nombre aléatoire. 22 | 23 | {{Synopsis}} 24 | 25 | ${%RANDOM%} 26 | 27 | Se dévellope en un nombre aléatoire compris entre {0} et {32767} 28 | pour WINDOWS (sur linux la borne supérieure dépend de 29 | l'implémentation). Ce nombre aléatoire change à chaque remplacement 30 | de variables durant {spec/exp|L'expansion retardée de variable}. 31 | 32 | {{Compatibilité}} 33 | 34 | Compatible avec {cmd.exe} 35 | 36 | Disponible depuis la version {0.7} 37 | 38 | {{A voir aussi}} 39 | 40 | {spec/var|Variables d'environement}, {spec/index|Index des spécifications} 41 | -------------------------------------------------------------------------------- /man/fr_FR/rd.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commandes RD, RMDIR}} 20 | 21 | Permet de supprimer un répertoire. 22 | 23 | {{Synopsis}} 24 | 25 | ${RMDIR [/S] [/Q] dossier 26 | RD [/S] [/Q] dossier} 27 | 28 | 29 | Supprime un répertoire. 30 | 31 | - {dossier} : Chemin du répertoire à supprimer. 32 | 33 | - {/Q} : Active le mode silencieux. Ne demandande pas de 34 | confimartion pour supprimer l'arboressence avec {/S}. N'a 35 | aucun effet si le commutateur {/S} n'est pas activé. 36 | 37 | - {/S} : Supprime tous les dossiers et les sous dossiers 38 | contenus dans le dossier {dossier}. 39 | 40 | {{Notes}} 41 | 42 | Par défaut, les commandes {RD} et {RMDIR} ne suppriment pas les 43 | dossiers non-vides. Pour forcer la suppression du dossier, il faut 44 | utiliser le commutateur {/S} 45 | 46 | {{Compatibilité}} 47 | 48 | Disponible depuis la version {0.4}. 49 | 50 | Parfaitement compatible avec {cmd.exe}. 51 | 52 | {{A voir aussi}} 53 | 54 | {md|Commandes MD, MKDIR}, {del|Commanndes DEL, ERASE}, 55 | {move|Commande MOVE} 56 | -------------------------------------------------------------------------------- /man/fr_FR/rem.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande REM}} 20 | 21 | La commande {REM} permet d'introduire un commentaire ou une annotation 22 | dans un script batch. 23 | 24 | {{Synopsis}} 25 | 26 | ${REM commentaire} 27 | 28 | Introduit un commentaire ou une annotation. 29 | 30 | - {commentaire} : Le commentaire ou l'annotation. Ce paramètre ne 31 | peut pas contenir de caractères interprétés par {pbat|pBat}, comme le 32 | pipe {|} ou l'esperluette {&}. 33 | 34 | {{Notes}} 35 | 36 | Cette commande est relativement inopérante, tant dans un script {batch} qu'a 37 | l'invité de commande. Il est préférables d'utiliser le nouveau style de commentaires, 38 | décrit à la page {spec/comments|commentaires}. 39 | 40 | {{A voir aussi}} 41 | 42 | {commands|Liste des commandes}, {echo|Commande ECHO} -------------------------------------------------------------------------------- /man/fr_FR/ren.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2015 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commandes REN et RENAME}} 20 | 21 | Les commandes {REN} et {RENAME} permettent de renommer des fichiers 22 | via {pbat|pBat}. Cette commande permet uniquement de changer le nom d' 23 | un fichier, elle ne peut pas le déplacer. 24 | 25 | {{Synopsis}} 26 | 27 | ${REN fichier nom.ext 28 | RENAME fichier nom.ext} 29 | 30 | Renomme le fichier {fichier}. 31 | 32 | - {fichier} : Le chemin du fichier à renommer. Il ne peut pas 33 | contenir de {spec/regexp|caractères génériques}. 34 | 35 | - {nom.ext} : Le nom et l'extension du fichier à renommer. Il 36 | ne peut pas contenir de cactères spéciaux, mais l'extension 37 | peut être ômise. 38 | 39 | {{Compatibilité}} 40 | 41 | Disponible depuis la version {0.4}. 42 | 43 | Parfaitement compatible avec {cmd.exe} 44 | 45 | {{A voir aussi}} 46 | 47 | {copy|Commande COPY}, {move|Commande MOVE}, {type|Commande TYPE}, 48 | {del|Commandes DEL et ERASE}, {more|Commande MORE} 49 | -------------------------------------------------------------------------------- /man/fr_FR/start.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2017 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{Commande START}} 19 | 20 | La fonction principale de la commande {START} est d'exécuter un programme 21 | dans une autre console. {START} permet aussi d'ouvrir un fichier 22 | avec le programme approprié, c'est donc une commande très pratique en 23 | batch. 24 | 25 | {{Synopsis}} 26 | 27 | ${START [/d dir] [/b] [/min] [/max] [/wait] commande parametres} 28 | 29 | Lance {commande} dans une nouvelle fenêtre. 30 | 31 | - {commande} : Chemin de l'exécutable à lancer, ou du fichier à ouvrir. 32 | 33 | - {parametres} : Une liste de paramètres à passer à {commande}. 34 | 35 | - {/d dir} : Chemin du dossier dans lequel {commande} doit être exécutée. 36 | 37 | - {/max} : Maximise la nouvelle fenêtre. 38 | 39 | - {/min} : Minimise la nouvelle fenêtre. 40 | 41 | - {/wait} : Attend la fin de l'exécution de {commande}. 42 | 43 | - {/b} : Dissimule la nouvelle fenêtre. 44 | 45 | {{Compatibilité}} 46 | 47 | Partiellement compatible avec {cmd.exe}. 48 | 49 | Supporté depuis la version 2014.0.9b. Le support entre différents systèmes 50 | d'exploitation peut différer grandement. 51 | 52 | {{À voir aussi}} 53 | 54 | {call|Commande Call}, {commands|Liste des commandes} -------------------------------------------------------------------------------- /man/fr_FR/time.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Variables %TIME% et %DATE% et Commande TIME}} 20 | 21 | Les variables {%TIME%} et {%DATE%} contienent respectivement l'heure 22 | et la date courrante. 23 | 24 | {{Synopsis}} 25 | 26 | ${%TIME%} 27 | 28 | Se dévellope en heure courrante, au format {HH:MM:SS,00}. Les 29 | millisecondes sont fixées à 0 pour des raisons de compatibilité 30 | avec {cmd.exe}. Si un des nombre de l'heure n'est constitué que d'un 31 | seul chiffre, alors un zéro est apposé devant. 32 | 33 | ${TIME} 34 | 35 | Équivalent à la commande : 36 | 37 | @- 38 | ${ECHO %TIME%} 39 | 40 | ${%DATE%} 41 | 42 | Se dévellope en date courrante, au format {JJ/MM/AAAA}. Si l'un des 43 | nombres n'est constitué que d'un seul caractère, le reste sera 44 | comblé avec des 0. 45 | 46 | {{Note}} 47 | 48 | Les variables {%TIME%} et {%DATE%} sont des variables dynamiques, qui sont 49 | générées lors de l'éxécution du programme. Il n'est donc pas possible de 50 | les modifier via la commande {set|SET}. 51 | 52 | {{Compatiblité}} 53 | 54 | Compatible avec {cmd.exe}. 55 | 56 | Disponible depuis la version {0.7} 57 | 58 | {{A voir aussi}} 59 | 60 | {spec/var|Les variables d'environement}, {spec/index|Index des spécifications} 61 | -------------------------------------------------------------------------------- /man/fr_FR/timeout.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande Timeout}} 20 | 21 | La commande {TIMEOUT} patiente un délai spécifié en secondes ou jusqu'a 22 | l'appui une touche pas l'utilisateur. 23 | 24 | {{Synopsis}} 25 | 26 | ${TIMEOUT [/T] [/NOBREAK] secondes[.milisecondes]} 27 | 28 | Attends pour {secondes.milisecondes} ou pour l'appui d'une touche pour 29 | reprendre l'exécution. 30 | 31 | - {/T} : N'a pas d'effet, préservé pour compatibilité seulement. 32 | 33 | - {/NOBREAK} : Ignore l'appui de touches. 34 | 35 | - {seconds} : Le temps à attendre spécifié en secondes. 36 | 37 | - {.milliseconds} : Un supplément optionnel aux {secondes} spécifiant les 38 | milisecondes supplémentaires d'attente. Cette fonctonnalité est une 39 | extension {pbat|pBat}. 40 | 41 | {{Compatibilité}} 42 | 43 | Compatible avec {cmd.exe}. 44 | 45 | Disponible depuis la version {218.2}. 46 | 47 | {{Voir aussi}} 48 | 49 | {commands|Liste des commandes} 50 | -------------------------------------------------------------------------------- /man/fr_FR/title.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2014 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | {{Commande TITLE}} 20 | 21 | Modifie le titre de la console 22 | 23 | {{Synopsis}} 24 | 25 | ${ TITLE titre} 26 | 27 | Change le titre de la console en {titre} 28 | 29 | {{Compatibilite}} 30 | 31 | Parfaitement compatible avec {cmd.exe}. 32 | 33 | {{A voir aussi}} 34 | 35 | {echo|Commande ECHO}, {cls|Commande CLS}, {commands|Liste de commandes} 36 | -------------------------------------------------------------------------------- /man/fr_FR/ver.tea: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Manual pages, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi (DarkBatcher) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | {{Commande VER}} 19 | 20 | Affiche les informations de version du système d'exploitation. 21 | 22 | {{Synopsis}} 23 | 24 | ${VER} 25 | 26 | Affiche les informations du système d'exploitation. En fonction de la plateforme 27 | et/ou de la distribution Linux que vous utilisez, le message affiché peut varier. 28 | Cependant, le message affiché sur Windows est prévu pour être compatible. 29 | 30 | Si vous avez besoin de moins d'informations spécifiques à propos du 31 | système d'exploitation sur lequel {pbat|pBat} est actuellement exécuté, 32 | considérez plutôt {pbatvar|%PBAT_OS_TYPE% ou %PBAT_OS%}. 33 | 34 | {{Remerciments}} 35 | 36 | Le code source de cette commande a été contribué par Xenoxis. 37 | 38 | {{Compatibilité}} 39 | 40 | Compatible avec {cmd.exe}. Disponible depuis la version {218.3}. 41 | 42 | {{Voir aussi}} 43 | 44 | {pbatvar|Variables par défaut de pBat} 45 | -------------------------------------------------------------------------------- /man/fr_FR/xargs.tea: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbatcher/picobat/975e71d876b711c3de82692a981f88431206c2be/man/fr_FR/xargs.tea -------------------------------------------------------------------------------- /man/header: -------------------------------------------------------------------------------- 1 | 6 |
7 |
8 | -------------------------------------------------------------------------------- /microgettext/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2021 Romain GARBI 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /microgettext/Makefile: -------------------------------------------------------------------------------- 1 | # microgettext - A stupidly minimalist implementation of GNU libintl 2 | # Copyright (C) 2021 Romain GARBI 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is furnished 9 | # to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all 12 | # copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | # THE SOFTWARE. 21 | # 22 | CFLAGS := -O2 -ggdb 23 | SRC_FILES = microgettext.c 24 | 25 | OBJ_FILES = $(SRC_FILES:.c=.o) 26 | 27 | AR ?= ar 28 | RANLIB ?= ranlib 29 | 30 | all: libmicrogettext.a 31 | 32 | %.o: %.c 33 | $(CC) $(CFLAGS) -c -o $@ $< 34 | 35 | clean: 36 | rm -f $(OBJ_FILES) libmicrogettext.a 37 | 38 | libmicrogettext.a: $(OBJ_FILES) 39 | $(AR) r $@ $(OBJ_FILES) 40 | $(RANLIB) $@ 41 | 42 | 43 | .PHONY: all bin clean 44 | -------------------------------------------------------------------------------- /modules/Makefile: -------------------------------------------------------------------------------- 1 | MODULES = sample batbox 2 | MODULES_BIN = $(addsuffix .bin,$(MODULES)) 3 | MODULES_CLEAN = $(addsuffix .clean,$(MODULES)) 4 | 5 | all: $(MODULES) 6 | bin: $(MODULES_BIN) 7 | clean: $(MODULES_CLEAN) 8 | 9 | $(MODULES): 10 | $(MAKE) -C $@ all 11 | 12 | $(MODULES_BIN): 13 | $(MAKE) -C $(basename $@) bin 14 | 15 | $(MODULES_CLEAN): 16 | $(MAKE) -C $(basename $@) clean -------------------------------------------------------------------------------- /modules/batbox/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | MODULE = batbox 5 | SOURCES = batbox.c 6 | 7 | OBJ_FILES = $(SOURCES:.c=.o) ../lib/pBat_Module.o 8 | 9 | LDFLAGS += $(LIBPBAT_LD) 10 | CFLAGS += $(LIBPBAT_INC) -I../lib/ 11 | 12 | all: $(MODULE) 13 | 14 | bin: $(MODULE) 15 | mkdir -p $(BINDIR)/modules 16 | cp $(MODULE)$(EXEEXT) $(BINDIR)/modules/ 17 | 18 | clean: 19 | rm -rf $(OBJ_FILES) 20 | 21 | $(MODULE)$(EXEEXT): $(OBJ_FILES) 22 | $(CC) -shared -fvisibility=hidden -o $(MODULE)$(EXEEXT) $(OBJ_FILES) $(LDFLAGS) 23 | 24 | .PHONY: all clean bin -------------------------------------------------------------------------------- /modules/lib/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | OBJS = pBat_Module.o 5 | 6 | LDFLAGS += $(LIBPBAT_LD) 7 | CFLAGS += $(LIBPBAT_INC) 8 | 9 | all: $(OBJS) -------------------------------------------------------------------------------- /modules/sample/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | SOURCES = Sample.c 5 | 6 | OBJ_FILES = $(SOURCES:.c=.o) ../lib/pBat_Module.o 7 | 8 | LDFLAGS += $(LIBPBAT_LD) 9 | CFLAGS += $(LIBPBAT_INC) -I../lib/ 10 | 11 | all: sample 12 | bin: sample 13 | mkdir -p $(BINDIR)/modules 14 | cp sample$(EXEEXT) $(BINDIR)/modules/ 15 | 16 | clean: 17 | rm -rf $(OBJ_FILES) 18 | 19 | sample: $(OBJ_FILES) 20 | $(CC) -shared -fvisibility=hidden -o sample $(OBJ_FILES) $(LDFLAGS) 21 | -------------------------------------------------------------------------------- /modules/sample/Sample.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int my_foo(char* line) 7 | { 8 | line += 3; 9 | 10 | fprintf(fOutput, "%s CRY NOOOOPS" PBAT_NL, line); 11 | return 0; 12 | } 13 | 14 | void pBat_ModuleAttach(void) 15 | { 16 | fprintf(fOutput, "Registering FOO command !" PBAT_NL); 17 | pBat_RegisterCommand("FOO", my_foo); 18 | } 19 | -------------------------------------------------------------------------------- /pbat/command/pBat_Ask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_ASK_H 22 | #define PBAT_ASK_H 23 | 24 | #include 25 | #include 26 | 27 | #define PBAT_ASK_YN (0x00) 28 | /* The use can choose either YES or NO */ 29 | 30 | #define PBAT_ASK_YNA (0x08) 31 | /* the user can choose either YES, NO or ALL */ 32 | 33 | #define PBAT_ASK_DEFAULT_Y (0x01) 34 | /* if the user input invalid value, the function will 35 | return PBAT_ASK_YES */ 36 | 37 | #define PBAT_ASK_DEFAULT_N (0x02) 38 | /* if the user input invalid value, the function will 39 | return PBAT_ASK_NO */ 40 | 41 | #define PBAT_ASK_DEFAULT_A (0x04) 42 | /* if the user input invalid value, the function will 43 | return PBAT_ASK_ALL */ 44 | 45 | #define PBAT_ASK_INVALID_REASK (0x10) 46 | /* re-ask if the input turn out to be invalid */ 47 | 48 | #define PBAT_ASK_YES (1) 49 | #define PBAT_ASK_NO (2) 50 | #define PBAT_ASK_ALL (4) 51 | #define PBAT_ASK_INVALID (-1) 52 | 53 | int pBat_AskConfirmation(int iFlags, void(*lpFn)(char*,size_t), const char* lpMsg, ...); 54 | 55 | #endif // PBAT_ASK_H 56 | -------------------------------------------------------------------------------- /pbat/command/pBat_Block.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_BLOCK_H 22 | #define PBAT_CMD_BLOCK_H 23 | 24 | int pBat_CmdBlock(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Break.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include "../core/pBat_Core.h" 31 | 32 | #include "pBat_Commands.h" 33 | 34 | #include "../lang/pBat_Lang.h" 35 | #include "../lang/pBat_ShowHelp.h" 36 | 37 | // #define PBAT_DBG_MODE 38 | #include "../core/pBat_Debug.h" 39 | 40 | #include "../errors/pBat_Errors.h" 41 | 42 | #include "pBat_Break.h" 43 | 44 | #include "pBat_Ask.h" 45 | 46 | /* BREAK [ON | OFF] 47 | 48 | Does nothing */ 49 | 50 | int pBat_CmdBreak(char* line) 51 | { 52 | char param[4]; 53 | 54 | if (pBat_GetNextParameter(line+5, param, sizeof(param)) 55 | && !strcmp(param, "/?")) { 56 | 57 | pBat_ShowInternalHelp(PBAT_HELP_BREAK); 58 | 59 | } 60 | 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /pbat/command/pBat_Break.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_BREAK 22 | #define PBAT_CMD_BREAK 23 | 24 | int pBat_CmdBreak(char* line); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Call.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CALL_H 22 | #define PBAT_CALL_H 23 | 24 | int pBat_CmdCall(char* lpCh); 25 | 26 | /* this is used to call other batch files */ 27 | int pBat_CmdCallFile(char* lpFile, char* lpFull, char* lpLabel, char* lpCmdLine); 28 | 29 | /* this is used to call external programs 30 | or even internals */ 31 | int pBat_CmdCallExternal(char* lpFile, char* lpCh); 32 | 33 | #endif // PBAT_CALL_H 34 | -------------------------------------------------------------------------------- /pbat/command/pBat_Cd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_CD_H 22 | #define PBAT_CMD_CD_H 23 | 24 | #if defined(WIN32) 25 | #define pBat_CmdCd pBat_CmdCd_win 26 | #else 27 | #define pBat_CmdCd pBat_CmdCd_nix 28 | #endif 29 | 30 | int pBat_Canonicalize(char* path); 31 | int pBat_SetCurrentDir(char* lpLine); 32 | int pBat_CmdCd_nix(char* lpLine); 33 | int pBat_CmdCd_win(char* lpLine); 34 | 35 | #endif // PBAT_CMD_ECHO_H 36 | -------------------------------------------------------------------------------- /pbat/command/pBat_Chcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_CHCP_H 22 | #define PBAT_CMD_CHCP_H 23 | 24 | int pBat_CmdChcp(char* line); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Cls.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "../core/pBat_Core.h" 32 | 33 | #include "pBat_Cls.h" 34 | 35 | #include "../lang/pBat_Lang.h" 36 | #include "../lang/pBat_ShowHelp.h" 37 | 38 | // #define PBAT_DBG_MODE 39 | #include "../core/pBat_Debug.h" 40 | 41 | #include "../errors/pBat_Errors.h" 42 | 43 | int pBat_CmdCls(char* lpLine) 44 | { 45 | char lpArg[4]; 46 | 47 | if (pBat_GetNextParameter(lpLine+3, lpArg, 4)) { 48 | 49 | if (!strcmp(lpArg, "/?")) { 50 | 51 | pBat_ShowInternalHelp(PBAT_HELP_CLS); 52 | return PBAT_NO_ERROR; 53 | 54 | } else { 55 | 56 | pBat_ShowErrorMessage(PBAT_UNEXPECTED_ELEMENT, lpArg, FALSE); 57 | return PBAT_UNEXPECTED_ELEMENT; 58 | 59 | } 60 | 61 | } 62 | 63 | pBat_ClearConsoleScreen(fOutput); 64 | 65 | return PBAT_NO_ERROR; 66 | } 67 | -------------------------------------------------------------------------------- /pbat/command/pBat_Cls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_CLS_H 22 | #define PBAT_CMD_CLS_H 23 | 24 | int pBat_CmdCls(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_COLOR_H 22 | #define PBAT_CMD_COLOR_H 23 | 24 | int pBat_CmdColor(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_CommandInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_COMMANDINFO_H 22 | #define PBAT_COMMANDINFO_H 23 | 24 | #include "../core/pBat_Core.h" 25 | 26 | extern COMMANDINFO lpCmdInfo[]; 27 | 28 | extern const int iCmdInfoNb; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /pbat/command/pBat_Copy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_COPY_H 22 | #define PBAT_CMD_COPY_H 23 | 24 | int pBat_CmdCopy(char* lpLine); 25 | int pBat_CmdCopyFile(char* file, const char* dest, int* flags); 26 | int pBat_CmdCopyRecursive(char* file, const char* dest, short attr, int* flags); 27 | 28 | int pBat_CopyFile(const char* file, const char* dest); 29 | int pBat_MoveFile(const char* file, const char* dest); 30 | int pBat_CatFile(const char* file, const char* dest, int* flags); 31 | #define PBAT_COPY_SILENCE 0x01 32 | #define PBAT_COPY_MULTIPLE 0x02 33 | #define PBAT_COPY_MOVE 0x04 34 | #define PBAT_COPY_RECURSIVE 0x08 35 | #define PBAT_COPY_CAT 0x10 36 | #define PBAT_COPY_CAT_2ND 0x20 37 | 38 | #endif // PBAT_CMD_ECHO_H 39 | -------------------------------------------------------------------------------- /pbat/command/pBat_Def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_DEF_H 22 | #define PBAT_CMD_DEF_H 23 | 24 | #include "../core/pBat_Core.h" 25 | 26 | int pBat_CmdDef(char* lpLine, PARSED_LINE** lpplLine); 27 | void pBat_ListDefs(char *name, size_t len, COMMANDLIST* commands); 28 | 29 | #endif // PBAT_CMD_ALIAS_H 30 | -------------------------------------------------------------------------------- /pbat/command/pBat_Del.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_DEL_H 22 | #define PBAT_CMD_DEL_H 23 | 24 | #define PBAT_ASK_CONFIRMATION 0x01 25 | #define PBAT_DELETE_READONLY 0x02 26 | #define PBAT_DONT_ASK_GENERIC 0x04 27 | #define PBAT_USE_JOKER 0x08 28 | 29 | int pBat_CmdDel(char* lpLine); 30 | int pBat_CmdDelFile(char* file, int fmode, int param, int* choice); 31 | int pBat_DelFile(const char* file); 32 | 33 | #endif // PBAT_CMD_ECHO_H 34 | -------------------------------------------------------------------------------- /pbat/command/pBat_Dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_DIR_H 22 | #define PBAT_CMD_DIR_H 23 | 24 | int pBat_CmdDir(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Echo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_ECHO_H 22 | #define PBAT_CMD_ECHO_H 23 | 24 | int pBat_CmdEcho(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Exit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_EXIT_H 22 | #define PBAT_CMD_EXIT_H 23 | 24 | int pBat_CmdExit(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Find.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_FIND_H 22 | #define PBAT_FIND_H 23 | 24 | #define PBAT_FIND_CASE_UNSENSITIVE 1 25 | #define PBAT_FIND_CASE_SENSITIVE 0 26 | #define PBAT_FIND_TRADITIONAL 0 27 | #define PBAT_FIND_REGEXP 0x02 28 | 29 | int pBat_CmdFind(char* lpLine); 30 | 31 | #endif /* PBAT_FIND_H */ 32 | -------------------------------------------------------------------------------- /pbat/command/pBat_Goto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_GOTO_H 22 | #define PBAT_CMD_GOTO_H 23 | 24 | int pBat_CmdGoto(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Help.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_HELP_H 22 | #define PBAT_CMD_HELP_H 23 | 24 | int pBat_CmdHelp(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_LOCALE_H 22 | #define PBAT_CMD_LOCALE_H 23 | 24 | void pBat_LoadLocaleMessages(char* loc); 25 | int pBat_CmdLocale(char* lpLine); 26 | 27 | #endif // PBAT_CMD_ECHO_H 28 | -------------------------------------------------------------------------------- /pbat/command/pBat_Mkdir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_MKDIR_H 22 | #define PBAT_CMD_MKDIR_H 23 | 24 | int pBat_CmdMkdir(char* lpLine); 25 | int pBat_CmdMakeDirs(char* str); 26 | 27 | #endif // PBAT_CMD_ECHO_H 28 | -------------------------------------------------------------------------------- /pbat/command/pBat_Mod.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_MOD_H 21 | #define PBAT_MOD_H 22 | 23 | int pBat_CmdMod(char* line); 24 | 25 | #define PBAT_MOD_SETENV 0 26 | #define PBAT_MOD_GETENV 1 27 | #define PBAT_MOD_GETCURRENTDIR 2 28 | #define PBAT_MOD_SETCURRENTDIR 3 29 | #define PBAT_MOD_GETFINPUT 4 30 | #define PBAT_MOD_GETFOUTPUT 5 31 | #define PBAT_MOD_GETFERROR 6 32 | #define PBAT_MOD_GETBISSCRIPT 7 33 | #define PBAT_MOD_GETNEXTPARAMETERES 8 34 | #define PBAT_MOD_ESTOFULLPATH 9 35 | #define PBAT_MOD_REGISTERCOMMAND 10 36 | #define PBAT_MOD_SHOWERRORMESSAGE 11 37 | #define PBAT_MOD_RUNLINE 12 38 | #define PBAT_MOD_API_VERSION 0 39 | 40 | #endif // PBAT_MOD_H 41 | -------------------------------------------------------------------------------- /pbat/command/pBat_More.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_MORE_H 22 | #define PBAT_MORE_H 23 | 24 | int pBat_CmdMore(char* lpLine); 25 | 26 | #define PBAT_MORE_CLEAR (0x01) /* Clear the screen at every new page */ 27 | #define PBAT_MORE_SQUEEZE (0x02) /* Squeeze blank lines */ 28 | #define PBAT_MORE_FORMFEED (0x04) /* Don't know the actual effect on microsoft 29 | windows, so does nothing */ 30 | #define PBAT_MORE_USEU8 (0x08) /* Enable internal utf-8 support */ 31 | #define PBAT_MORE_ANSICODES (0x10) /* Enable ansi-codes clever handling */ 32 | #define PBAT_MORE_INTERACTIVE (0x20) /* interractive interactive */ 33 | 34 | int pBat_MoreFile(FILE* in, int flags, int tabsize, int begin, char* filename); 35 | 36 | #endif /* PBAT_MORE_H */ 37 | -------------------------------------------------------------------------------- /pbat/command/pBat_Pause.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "../core/pBat_Core.h" 32 | 33 | #include "pBat_Pause.h" 34 | 35 | #include "../lang/pBat_Lang.h" 36 | #include "../lang/pBat_ShowHelp.h" 37 | 38 | // #define PBAT_DBG_MODE 39 | #include "../core/pBat_Debug.h" 40 | 41 | #include "../errors/pBat_Errors.h" 42 | 43 | int pBat_CmdPause(char* lpLine) 44 | { 45 | lpLine = pBat_SkipBlanks(lpLine); 46 | 47 | if (!strncmp(lpLine+6, "/?", 2)) { 48 | 49 | pBat_ShowInternalHelp(PBAT_HELP_PAUSE); 50 | return 0; 51 | } 52 | 53 | fputs(lpMsgPause, fOutput); 54 | fputs(PBAT_NL, fOutput); 55 | pBat_Getch(fInput); 56 | 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /pbat/command/pBat_Pause.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_PAUSE_H 22 | #define PBAT_CMD_PAUSE_H 23 | 24 | int pBat_CmdPause(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Pecho.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_PECHO_H 22 | #define PBAT_CMD_PECHO_H 23 | 24 | int pBat_CmdPecho(char* lpLine); 25 | int pBat_CmdPrompt(char* lpLine); 26 | 27 | #endif // PBAT_CMD_ECHO_H 28 | -------------------------------------------------------------------------------- /pbat/command/pBat_Pushd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * Copyright (C) 2016 Teddy ASTIE 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | * 20 | */ 21 | 22 | #ifndef PBAT_CMD_PUSHD_H 23 | #define PBAT_CMD_PUSHD_H 24 | 25 | int pBat_CmdPushd(char *lpLine); 26 | int pBat_CmdPopd (char *lpLine); 27 | 28 | #endif // PBAT_CMD_PUSHD_H 29 | -------------------------------------------------------------------------------- /pbat/command/pBat_Rem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "../core/pBat_Core.h" 32 | 33 | #include "pBat_Rem.h" 34 | 35 | #include "../lang/pBat_Lang.h" 36 | #include "../lang/pBat_ShowHelp.h" 37 | 38 | // #define PBAT_DBG_MODE 39 | #include "../core/pBat_Debug.h" 40 | 41 | #include "../errors/pBat_Errors.h" 42 | 43 | int pBat_CmdRem(char* lpLine) 44 | { 45 | /* Well, a help message for this function is included, however, is it 46 | really useful, because, logically, 47 | 48 | REM /? 49 | 50 | should not be interpreted because /? is indeed a comment. 51 | 52 | However, the 'REM /?' displays some help in cmd.exe, but this is not 53 | strictly a compatibility issue. */ 54 | 55 | return 0; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /pbat/command/pBat_Rem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2014 DarkBatcher 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_REM_H 22 | #define PBAT_CMD_REM_H 23 | 24 | int pBat_CmdRem(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Ren.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2014 DarkBatcher 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_REN_H 22 | #define PBAT_CMD_REN_H 23 | 24 | int pBat_CmdRen(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Rmdir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2014 DarkBatcher 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_RMDIR_H 22 | #define PBAT_CMD_RMDIR_H 23 | 24 | int pBat_CmdRmdir(char* lpLine); 25 | int pBat_Rmdir(const char* dir); 26 | 27 | int pBat_CmdRmdirFile(char* dir, int param, int* choice); 28 | 29 | #endif // PBAT_CMD_ECHO_H 30 | -------------------------------------------------------------------------------- /pbat/command/pBat_Set.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_SET_H 22 | #define PBAT_CMD_SET_H 23 | 24 | #include 25 | 26 | int pBat_CmdSet(char *lpLine); 27 | int pBat_CmdSetS(char* lpLine, int inherit); 28 | int pBat_CmdSetP(char* lpLine); 29 | int pBat_CmdSetA(char* lpLine); 30 | int pBat_CmdSetEval(ESTR* lpExpression); 31 | #endif // PBAT_CMD_ECHO_H 32 | -------------------------------------------------------------------------------- /pbat/command/pBat_Setlocal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_SETLOCAL_H 22 | #define PBAT_CMD_SETLOCAL_H 23 | 24 | int pBat_CmdSetLocal(char* lpLine); 25 | int pBat_CmdEndLocal(char* lpLine); 26 | 27 | #endif // PBAT_CMD_ECHO_H 28 | -------------------------------------------------------------------------------- /pbat/command/pBat_Shift.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_SHIFT_H 22 | #define PBAT_CMD_SHIFT_H 23 | 24 | int pBat_CmdShift(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_START 22 | #define PBAT_CMD_START 23 | 24 | #include "../../config.h" 25 | 26 | #define START_MODE_MAX 3 27 | #define START_MODE_MIN 2 28 | #define START_MODE_NONE 5 29 | #define START_MODE_BACKGROUND 0x8 30 | 31 | int pBat_CmdStart(char* line); 32 | 33 | #endif // PBAT_CMD_START 34 | -------------------------------------------------------------------------------- /pbat/command/pBat_Timeout.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_TIMEOUT_H 22 | #define PBAT_TIMEOUT_H 23 | 24 | int pBat_CmdTimeout(char* lpLine); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Title.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "../core/pBat_Core.h" 32 | 33 | #include "pBat_Title.h" 34 | 35 | #include "../lang/pBat_Lang.h" 36 | #include "../lang/pBat_ShowHelp.h" 37 | 38 | // #define PBAT_DBG_MODE 39 | #include "../core/pBat_Debug.h" 40 | 41 | #include "../errors/pBat_Errors.h" 42 | 43 | /* TITLE title 44 | 45 | Change console title to 'title' */ 46 | 47 | int pBat_CmdTitle(char* lpLine) 48 | { 49 | char lpArg[3]; 50 | ESTR* lpEsTitle=pBat_EsInit_Cached(); 51 | 52 | lpLine+=5; 53 | 54 | if (pBat_GetNextParameter(lpLine, lpArg, 3)) { 55 | 56 | if (!strcmp(lpArg, "/?")) { 57 | 58 | pBat_ShowInternalHelp(PBAT_HELP_TITLE); 59 | 60 | } else { 61 | 62 | pBat_GetEndOfLine(lpLine, lpEsTitle); 63 | pBat_SetConsoleTitle(fOutput, lpEsTitle->str); 64 | 65 | } 66 | 67 | } 68 | 69 | pBat_EsFree_Cached(lpEsTitle); 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /pbat/command/pBat_Title.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_TITLE_H 22 | #define PBAT_CMD_TITLE_H 23 | 24 | int pBat_CmdTitle(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CMD_TYPE_H 22 | #define PBAT_CMD_TYPE_H 23 | 24 | int pBat_CmdType(char* lpLine); 25 | 26 | #endif // PBAT_CMD_ECHO_H 27 | -------------------------------------------------------------------------------- /pbat/command/pBat_Ver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_CMD_VER_H 21 | #define PBAT_CMD_VER_H 22 | 23 | 24 | int pBat_CmdVer(char* lpArg); 25 | void pBat_CmdVerCheckWinVer(char **ptr, int MajorVersion, int MinorVersion); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /pbat/command/pBat_Wc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2017 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_WC_H 21 | #define PBAT_WC_H 22 | 23 | #include 24 | 25 | struct wc_count_t { 26 | size_t lines; 27 | size_t words; 28 | size_t bytes; 29 | size_t chars; 30 | }; 31 | 32 | int pBat_CmdWc(char* line); 33 | 34 | #define PBAT_WC_LINES 1 35 | #define PBAT_WC_CHARS 2 36 | #define PBAT_WC_BYTES 4 37 | #define PBAT_WC_WORDS 8 38 | 39 | #endif // PBAT_WC_H 40 | -------------------------------------------------------------------------------- /pbat/command/pBat_Xargs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2017 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_XARGS_H 21 | #define PBAT_XARGS_H 22 | 23 | int pBat_CmdXargs(char* line); 24 | 25 | #endif /* PBAT_XARGS_H */ 26 | -------------------------------------------------------------------------------- /pbat/core/pBat_Clone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef PBAT_CLONE_H 21 | #define PBAT_CLONE_H 22 | 23 | #include 24 | #include "pBat_Core.h" 25 | 26 | struct clone_data_t { 27 | int bDelayedExpansion; 28 | int bEchoOn; 29 | int iErrorLevel; 30 | int bIsScript; 31 | int bCmdlyCorrect; 32 | int bAbortCommand; 33 | LPCOMMANDLIST lpclCommands; 34 | LOCAL_VAR_BLOCK* lpvLocalVars; 35 | LOCAL_VAR_BLOCK* lpvArguments; 36 | LPSTREAMSTACK lppsStreamStack; 37 | struct dirstack_t dsDirStack; 38 | COLOR colColor; 39 | FILE* fInput; /* current thread input stream */ 40 | FILE* fOutput; /* current thread output stream */ 41 | FILE* fError; /* current thread error stream */ 42 | ENVBUF* lpeEnv; 43 | INPUT_FILE ifIn; 44 | char lpCurrentDir[FILENAME_MAX]; 45 | void(*fn)(void*); 46 | void* arg; 47 | }; 48 | 49 | /* Clone this instance ! */ 50 | THREAD pBat_CloneInstance(void(*func)(void*), void* data); 51 | int pBat_DuplicateData(struct clone_data_t* data); 52 | 53 | void* pBat_CloneTrampoline(void* data); 54 | #endif 55 | -------------------------------------------------------------------------------- /pbat/core/pBat_Completion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_COMPLETION_H 21 | #define PBAT_COMPLETION_H 22 | 23 | void pBat_InitCompletion(void); 24 | 25 | void pBat_CompletionHandler(const char* in, const char** subst); 26 | void pBat_CompletionHandlerFree(char* p); 27 | 28 | #endif /* PBAT_COMPLETION_H */ 29 | -------------------------------------------------------------------------------- /pbat/core/pBat_Context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CONTEXT_H 22 | #define PBAT_CONTEXT_H 23 | 24 | #include 25 | #include "pBat_Core.h" 26 | 27 | //typedef struct PBAT_CONTEXT { 28 | // INPUT_FILE* pInputFile; /* informations about the input file */ 29 | // STREAMSTACK* lpssStreamStack; /* informations about stream redirections */ 30 | // COMMANDLIST* lpclList; /* informations about the commands enabled */ 31 | //} PBAT_CONTEXT; 32 | 33 | //int pBat_InitContext(PBAT_CONTEXT* lpdcContext); 34 | //int pBat_CloseContext(PBAT_CONTEXT* lpdcContext); 35 | 36 | #endif // PBAT_CONTEXT_H 37 | -------------------------------------------------------------------------------- /pbat/core/pBat_Core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_CORE_H_INCLUDED 22 | #define PBAT_CORE_H_INCLUDED 23 | 24 | #include 25 | #include "../errors/pBat_Errors.h" 26 | 27 | #include "pBat_Env.h" 28 | 29 | #include "pBat_Var.h" 30 | #include "pBat_Expand.h" 31 | 32 | #include "pBat_Args.h" 33 | #include "pBat_DirStack.h" 34 | #include "pBat_Jump.h" 35 | #include "pBat_VersionInfo.h" 36 | #include "pBat_ShowIntro.h" 37 | #include "pBat_FilePath.h" 38 | #include "pBat_Parse.h" 39 | #include "pBat_Read.h" 40 | #include "pBat_Stream.h" 41 | #include "pBat_Run.h" 42 | #include "pBat_Expand.h" 43 | #include "pBat_SplitPath.h" 44 | #include "pBat_ParseBlock.h" 45 | #include "pBat_ExpandDef.h" 46 | #include "pBat_OsStream.h" 47 | #include "pBat_FdInheritance.h" 48 | #include "pBat_ReadScript.h" 49 | #include "pBat_Clone.h" 50 | #include "pBat_EnvStack.h" 51 | #include "pBat_EsCache.h" 52 | #include "pBat_Globals.h" 53 | #include "pBat_ExitInt.h" 54 | #include "pBat_Exec.h" 55 | #include "pBat_Prompt.h" 56 | #include "pBat_Completion.h" 57 | #include "pBat_Pipe.h" 58 | 59 | #if defined(WIN32) && defined(PBAT_USE_LIBCU8) 60 | #include 61 | #endif 62 | 63 | #endif // PBAT_CORE_H_INCLUDED 64 | -------------------------------------------------------------------------------- /pbat/core/pBat_Debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #include 21 | #include 22 | #include 23 | 24 | #include "pBat_Debug.h" 25 | 26 | void pBat_ShowDebug(const char* format,...) 27 | { 28 | va_list vaArgs; 29 | 30 | va_start(vaArgs, format); 31 | vfprintf(stderr, format, vaArgs); 32 | 33 | va_end(vaArgs); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /pbat/core/pBat_Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_DEBUG_H 22 | 23 | #ifdef PBAT_DBG_MODE 24 | 25 | #define PBAT_DBG(format, ...) pBat_ShowDebug(format, ##__VA_ARGS__ ) 26 | 27 | #else 28 | 29 | #define PBAT_DBG(format, ...) 30 | 31 | #endif 32 | 33 | void pBat_ShowDebug(const char* format,...); 34 | 35 | #endif // PBAT_DEBUG_H 36 | -------------------------------------------------------------------------------- /pbat/core/pBat_DirStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2018 Astie Teddy 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_DIRSTACK_H 22 | #define PBAT_DIRSTACK_H 23 | 24 | #include 25 | #include 26 | 27 | struct dirstack_t { 28 | char **paths; 29 | size_t count; 30 | }; 31 | 32 | bool pBat_DirStackInit(void); 33 | void pBat_DirStackFree(void); 34 | 35 | bool pBat_PushDir(const char *dir); 36 | char *pBat_PopDir(void); /* You need to free() the output directory path. */ 37 | 38 | bool pBat_DirStackCopy(struct dirstack_t *dest); 39 | 40 | #endif /* PBAT_DIRSTACK_H */ 41 | -------------------------------------------------------------------------------- /pbat/core/pBat_EnvStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_ENV_STACK_H 21 | #define PBAT_ENV_STACK_H 22 | 23 | #include "pBat_Core.h" 24 | 25 | typedef struct ENVSTACK { 26 | struct ENVBUF* lpeEnv; 27 | struct ENVSTACK* previous; 28 | int bDelayedExpansion; 29 | int bCmdlyCorrect; 30 | } ENVSTACK; 31 | 32 | void pBat_PushEnvStack(void); 33 | void pBat_PopEnvStack(void); 34 | void pBat_FreeEnvStack(void); 35 | 36 | #endif /* PBAT_ENV_STACK_H */ 37 | -------------------------------------------------------------------------------- /pbat/core/pBat_EsCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2022 Astie Teddy 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_ES_CACHE_H 22 | #define PBAT_ES_CACHE_H 23 | 24 | #include 25 | 26 | #include "pBat_Core.h" 27 | 28 | #define ESTR_CACHE_SIZE 128 29 | 30 | typedef struct ESTRCACHE { 31 | ESTR lpesPool[ESTR_CACHE_SIZE]; /* ESTR buffers */ 32 | uint32_t lpbStatus[ESTR_CACHE_SIZE / 32]; /* ESTR buffers status bitmap (1 if used) */ 33 | } ESTRCACHE; 34 | 35 | int pBat_EsCacheBuild(ESTRCACHE *lpecCache); 36 | void pBat_EsCacheDrop(ESTRCACHE *lpecCache); 37 | ESTR *pBat_EsCacheInit(ESTRCACHE *lpecCache); 38 | void pBat_EsCacheFree(ESTRCACHE *lpecCache, ESTR *lpEstr); 39 | 40 | /* Cached variants of pBat_EsInit() with a corresponding pBat_EsFree 41 | Faster than regular pBat_EsInit() with less likely out of memory errors, 42 | but must not be transferred between picobat instances. 43 | */ 44 | #define pBat_EsInit_Cached() pBat_EsCacheInit(&ecEstrCache) 45 | #define pBat_EsFree_Cached(estr) pBat_EsCacheFree(&ecEstrCache, estr) 46 | 47 | #endif /* PBAT_ES_CACHE_H */ -------------------------------------------------------------------------------- /pbat/core/pBat_ExitInt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include "pBat_Core.h" 25 | #include "../../config.h" 26 | 27 | 28 | void pBat_Exit(void) 29 | { 30 | pBat_FreeCommandList(lpclCommands); 31 | pBat_FreeStreamStack(lppsStreamStack); 32 | pBat_FreeLocalBlock(lpvLocalVars); 33 | pBat_FreeLocalBlock(lpvArguments); 34 | pBat_FreeEnvStack(); 35 | pBat_EnvFree(lpeEnv); 36 | pBat_DirStackFree(); 37 | 38 | pBat_EsCacheDrop(&ecEstrCache); 39 | } 40 | -------------------------------------------------------------------------------- /pbat/core/pBat_ExitInt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_EXIT_H 22 | #define PBAT_EXIT_H 23 | 24 | void pBat_Exit(void); 25 | 26 | #endif // PBAT_EXIT_H 27 | -------------------------------------------------------------------------------- /pbat/core/pBat_Expand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_EXPAND_H 21 | #define PBAT_EXPAND_H 22 | 23 | 24 | void pBat_ReplaceVars(ESTR* lpEsStr); 25 | void pBat_ExpandSpecialVar(ESTR* ptrCommandLine, ESTR** buf); 26 | void pBat_ExpandVar(ESTR* ptrCommandLine, char cDelimiter, ESTR** buf); 27 | void pBat_DelayedExpand(ESTR* ptrCommandLine); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /pbat/core/pBat_ExpandDef.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "pBat_Core.h" 26 | 27 | void pBat_ExpandDef(ESTR* lpRet, char* lpCh, char* lpExp) 28 | { 29 | int i; 30 | char var[]="$1"; 31 | ESTR *restrict ret=pBat_EsInit_Cached(), 32 | *restrict param=pBat_EsInit_Cached(); 33 | 34 | pBat_EsCpy(ret, lpExp); 35 | 36 | lpCh = pBat_SkipBlanks(lpCh); 37 | pBat_EsReplace(ret, "$*", lpCh); 38 | 39 | for (i = 1; i <= 10; i++) { 40 | 41 | var[1] = '0' + i; 42 | 43 | if (lpCh 44 | && (lpCh = pBat_GetNextParameterEs(lpCh, param))) 45 | pBat_EsReplace(ret, var, param->str); 46 | else 47 | pBat_EsReplace(ret, var, ""); 48 | } 49 | 50 | pBat_EsCpyE(lpRet, ret); 51 | 52 | pBat_EsFree_Cached(ret); 53 | pBat_EsFree_Cached(param); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /pbat/core/pBat_ExpandDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_DEF_H 22 | #define PBAT_DEF_H 23 | 24 | #include 25 | 26 | /* expand an alias to its value */ 27 | void pBat_ExpandDef(ESTR* lpRet, char* lpCh, char* lpExp); 28 | 29 | #endif // PBAT_DEF_H 30 | -------------------------------------------------------------------------------- /pbat/core/pBat_FdInheritance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2017 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | #ifndef PBAT_FDINHERITANCE_H 20 | #define PBAT_FDINHERITANCE_H 21 | 22 | #include 23 | 24 | void pBat_SetFdInheritance(int fd, int mode); 25 | void pBat_SetStdInheritance(FILE *file, int mode); 26 | 27 | #ifdef WIN32 28 | void pBat_SetAllFdInheritance(int mode); 29 | #endif /* WIN32 */ 30 | 31 | #endif // PBAT_FDINHERITANCE_H 32 | -------------------------------------------------------------------------------- /pbat/core/pBat_FilePath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_FILEPATH_H 22 | #define PBAT_FILEPATH_H 23 | 24 | #ifndef WIN32 25 | #define PBAT_PATH_DELIMITER ':' 26 | #else 27 | #define PBAT_PATH_DELIMITER ';' 28 | #endif 29 | 30 | char* pBat_EsToFullPath(ESTR* full); 31 | int pBat_GetFileFullPath(char* full, const char* partial, size_t size); 32 | void pBat_MakeFullPath(char* full, const char* partial, size_t size); 33 | void pBat_MakeFullPathEs(ESTR* full, const char* partial); 34 | char* pBat_FullPathDup(const char* path); 35 | int pBat_GetFilePath(char* lpFullPath, const char* lpPartial, size_t iBufSize); 36 | char* pBat_GetPathNextPart(char* lpPath, ESTR* lpReturn); 37 | int pBat_MakePath(ESTR* lpReturn, int nOps, ...); 38 | char* pBat_GetLastChar(ESTR* lpReturn); 39 | 40 | #endif // PBAT_FILEPATH_H 41 | -------------------------------------------------------------------------------- /pbat/core/pBat_Jump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_JUMP_H_INCLUDED 22 | #define PBAT_JUMP_H_INCLUDED 23 | 24 | 25 | /* automaticly jump to a label 26 | - lpLabelName : the label name include ':' 27 | - lpFileName : (Optional) the file to search into */ 28 | int pBat_JumpToLabel(char* lpLabelName, char* lpFileName); 29 | int pBat_JumpToLabel_Cmdly(char* lpLabelName, char* lpFileName); 30 | 31 | 32 | #endif // PBAT_JUMP_H_INCLUDED 33 | -------------------------------------------------------------------------------- /pbat/core/pBat_OsStream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_OSSTREAM_H 21 | #define PBAT_OSSTREAM_H 22 | 23 | /* a macro to change names of the OS defined stream on a per OS 24 | basis */ 25 | 26 | #if defined(WIN32) 27 | #define TRANS(str) str 28 | #elif !defined(WIN32) 29 | #define TRANS(str) _pBat_GetOsStreamName(str) 30 | const char* _pBat_GetOsStreamName(const char* str); 31 | #endif 32 | 33 | #if defined(WIN32) 34 | #define NUL "NUL" 35 | #define CON "CON" 36 | #define PRN "PRN" 37 | #define LPT "LPT" 38 | #define COM "COM" 39 | #elif !defined(WIN32) 40 | #define NUL "/dev/null" 41 | #define CON "/dev/tty" 42 | #define PRN "/dev/lpt0" 43 | #define LPT "/dev/lpt" 44 | #define COM "/dev/ttyS" 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /pbat/core/pBat_ParseBlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_BLOCK_H 22 | #define PBAT_BLOCK_H 23 | 24 | /* Note that both following functions are inter-dependent. 25 | It's basically a binary recursion, ie : 26 | 27 | pBat_GetNextBlockEnd -> pBat_GetBlockLineEnd 28 | -> pBat_GetNextBlockEnd ... 29 | 30 | and so on and so forth. 31 | */ 32 | 33 | 34 | /* Gets the end of block 35 | if lpCh does not point to a '(' character, the return value is NULL 36 | if not end can be found the return value is NULL 37 | */ 38 | char* pBat_GetNextBlockEnd(char* lpCh); 39 | 40 | /* Get the end of a line, taking account of multiples 41 | blocks on a single line */ 42 | #define pBat_GetBlockLineEnd(pch) pBat_GetBlockLineEndEx(pch, 0) 43 | char* pBat_GetBlockLineEndEx(char* lpCh, int par_end); 44 | 45 | /* get the begining of the very first next block*/ 46 | #define pBat_GetNextBlockBegin(lpCh) pBat_GetNextBlockBeginEx(lpCh, 0) 47 | char* pBat_GetNextBlockBeginEx(char* lpCh, int bIsBlockCmd); 48 | 49 | #endif // PBAT_BLOCK_H 50 | -------------------------------------------------------------------------------- /pbat/core/pBat_Pipe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_CORE_PIPE_H 21 | #define PBAT_CORE_PIPE_H 22 | 23 | #include 24 | 25 | int pBat_Pipe(FILE** pipef); 26 | #endif // PBAT_CORE_PIPE_H 27 | -------------------------------------------------------------------------------- /pbat/core/pBat_Prompt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI, Teddy ASTIE 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_PROMPT_H 21 | #define PBAT_PROMPT_H 1 22 | 23 | void pBat_OutputPrompt(void); 24 | void pBat_OutputPromptString(const char* prompt); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /pbat/core/pBat_Read.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_MODULE_READ_H 22 | #define PBAT_MODULE_READ_H 23 | 24 | #include 25 | 26 | #include "pBat_ReadScript.h" 27 | 28 | typedef struct INPUT_FILE { 29 | char lpFileName[FILENAME_MAX]; 30 | int iPos; 31 | int bEof; 32 | struct batch_script_t batch; 33 | } INPUT_FILE; 34 | 35 | int pBat_GetLine(ESTR* lpesLine, INPUT_FILE* pIn); 36 | int pBat_GetLine_Cmdly(ESTR* lpesLine, INPUT_FILE* pIn); 37 | int pBat_CheckBlocks(ESTR* lpesLine); 38 | void pBat_RmTrailingNl(char* lpLine); 39 | 40 | int pBat_UpdateScript(INPUT_FILE* pIn); 41 | #endif 42 | -------------------------------------------------------------------------------- /pbat/core/pBat_ShowIntro.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include "pBat_Core.h" 28 | #include "pBat_ShowIntro.h" 29 | #include "../lang/pBat_Lang.h" 30 | 31 | #if defined(WIN32) && !defined(LIBPBAT_W10_ANSI) 32 | #include 33 | 34 | void pBat_InitConsole(void) 35 | { 36 | HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); 37 | CONSOLE_CURSOR_INFO cciCursorInfo; 38 | 39 | GetConsoleCursorInfo(hOut, &cciCursorInfo); 40 | cciCursorInfo.bVisible=TRUE; 41 | 42 | SetConsoleCursorInfo(hOut, &cciCursorInfo); 43 | } 44 | 45 | #else 46 | 47 | void pBat_InitConsole(void) {} 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /pbat/core/pBat_ShowIntro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBAT_SHOWINTRO_H_INCLUDED 21 | #define PBAT_SHOWINTRO_H_INCLUDED 22 | 23 | void pBat_InitConsole(void); 24 | 25 | #endif // PBAT_SHOWINTRO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /pbat/core/pBat_SplitPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_SPLITPATH_H 22 | 23 | #ifndef WIN32 24 | 25 | #define _MAX_DRIVE FILENAME_MAX 26 | #define _MAX_DIR FILENAME_MAX 27 | #define _MAX_FNAME FILENAME_MAX 28 | #define _MAX_EXT FILENAME_MAX 29 | 30 | #endif 31 | 32 | void pBat_SplitPath(char* lpPath, char* lpDisk, char* lpDir, char* lpName, char* lpExt); 33 | 34 | #endif // PBAT_SPLITPATH_H 35 | -------------------------------------------------------------------------------- /pbat/init/pBat_Init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2014 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef PBAT_INIT_INCLUDED_H 22 | #define PBAT_INIT_INCLUDED_H 23 | 24 | void pBat_AssignCommandLine(int c, char** argv); 25 | void pBat_Init(); 26 | char* pBat_GetParameters(char** argv, char** lpFileName, int* bExitAfterCmd, int* 27 | bQuiet); 28 | void pBat_InitConsoleTitles(char *lpFileName, int bQuiet); 29 | void pBat_RunAutoBat(void); 30 | void pBat_DuplicateStdStreams(void); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /pbat/linenoise/pBat_LineNoise.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2018 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include "../core/pBat_Core.h" 25 | 26 | #ifndef WIN32 27 | 28 | #include "linenoise.h" 29 | #include "utf8.h" 30 | 31 | /* something similar to pBat_EsGet() (ie. return 1 at eof) */ 32 | int pBat_LineNoise(ESTR* estr, FILE* pFile) 33 | { 34 | char* line; 35 | if (pBat_LockMutex(&mLineNoise)) 36 | pBat_ShowErrorMessage(PBAT_LOCK_MUTEX_ERROR, 37 | __FILE__ "/pBat_LineNoise()" , -1); 38 | 39 | 40 | linenoiseSetEncodingFunctions( 41 | linenoiseUtf8PrevCharLen, 42 | linenoiseUtf8NextCharLen, 43 | linenoiseUtf8ReadCode); 44 | linenoiseSetMultiLine(1); 45 | 46 | line = linenoise(NULL); 47 | if (line) 48 | linenoiseHistoryAdd(line); 49 | 50 | 51 | if (pBat_ReleaseMutex(&mLineNoise)) 52 | pBat_ShowErrorMessage(PBAT_RELEASE_MUTEX_ERROR, 53 | __FILE__ "/pBat_LineNoise()" , -1); 54 | 55 | if (line == NULL) 56 | return 1; 57 | 58 | 59 | pBat_EsCpy(estr, line); 60 | 61 | return 0; 62 | } 63 | 64 | #endif /* !WIN32 */ 65 | -------------------------------------------------------------------------------- /pbat/linenoise/pBat_LineNoise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pBat - A Free, Cross-platform command prompt - The pBat project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | #ifndef PBAT_LINENOISE_H 20 | #define PBAT_LINENOISE_H 21 | 22 | #include 23 | 24 | /* something similar to pBat_EsGet() (ie. return 1 at eof) */ 25 | int pBat_LineNoise(ESTR* estr, FILE* pFile); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /pbat/rc/pbat.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbatcher/picobat/975e71d876b711c3de82692a981f88431206c2be/pbat/rc/pbat.ico -------------------------------------------------------------------------------- /pbat/rc/res.rc: -------------------------------------------------------------------------------- 1 | 0 ICON "pbat.ico" 2 | 1 VERSIONINFO 3 | FILEVERSION 10,11,10,1 4 | PRODUCTVERSION 10,11,10,1 5 | FILEOS 0x4 6 | FILETYPE 0x1 7 | { 8 | BLOCK "StringFileInfo" 9 | { 10 | BLOCK "040904E4" 11 | { 12 | VALUE "CompanyName", "PicoBAT Team" 13 | VALUE "Developer", "darkbatcher & TSnake41" 14 | VALUE "OriginalFilename", "PBAT.exe" 15 | VALUE "Comments", "PBAT" 16 | VALUE "FileDescription", "PBAT" 17 | VALUE "InternalName", "PBAT" 18 | VALUE "ProductName", "PBAT" 19 | VALUE "LegalCopyright", "\xA9 2022 PicoBAT Team" 20 | VALUE "Build", "2022" 21 | VALUE "FileVersion", "10.11.10.01" 22 | VALUE "ProductVersion", "10.11.10.01" 23 | VALUE "LegalTrademarks", "\xA9 2022 PicoBAT Team" 24 | VALUE "Debugger", "0" 25 | } 26 | } 27 | 28 | BLOCK "VarFileInfo" 29 | { 30 | VALUE "Translation", 0x041F, 0x04E4 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pbatize/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | include ../config.mk 21 | 22 | CFLAGS += $(LIBPBAT_INC) 23 | LDFLAGS += $(LIBPBAT_LD) 24 | SRC_FILES = pbatize.c pairs.c 25 | 26 | all: pbatize 27 | 28 | pbatize: 29 | $(CC) -o pbatize$(EXEC_SUFFIX) $(SRC_FILES) $(LDFLAGS) $(CFLAGS) 30 | 31 | clean: 32 | rm -f pbatize$(EXEC_SUFFIX) 33 | 34 | bin: pbatize 35 | cp pbatize$(EXEC_SUFFIX) $(BINDIR)/cmd/ 36 | 37 | .PHONY: all clean bin 38 | -------------------------------------------------------------------------------- /pbatize/pbatize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * pbatize, a free pBat batch adapter, The pBat Project 4 | * Copyright (C) 2010-2016 Romain GARBI 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | #ifndef PBATISE_H 21 | #define PBATISE_H 22 | 23 | #define SWITCHES_SIZE 32 24 | 25 | #include 26 | 27 | typedef struct command { 28 | const char* const cmd; 29 | const char* const switches; 30 | } command; 31 | 32 | typedef struct pair { 33 | command* cmd; 34 | int i; 35 | int j; 36 | } pair; /*a pair of either command and switches or a pair of switches */ 37 | 38 | void pair_start(pair* p, command* cmd); 39 | int pair_next(pair* p); 40 | void pair_regexp(pair* p, ESTR* regexp); 41 | void pair_replace_exps(pair* p, ESTR* toreplace, ESTR* replaceby); 42 | 43 | #endif // PBATISE_H 44 | -------------------------------------------------------------------------------- /po/Makefile: -------------------------------------------------------------------------------- 1 | # Overall pBat suite Makefile, The pBat Project (c) Darkbatcher 2 | # 2010-2016 3 | # 4 | # This is free software: you can redistribute it and/or modify it under the 5 | # terms of the GNU General Public License as published by the Free Software 6 | # Foundation, either version 3 of the License, or (at your option) any later 7 | # version. 8 | # 9 | # 10 | # This files generates translations while compiling 11 | # 12 | 13 | ROOTDIR=.. 14 | BINDIR ?= bin 15 | 16 | MSGFMT = msgfmt 17 | XGETTEXT = xgettext 18 | MSGMERGE = msgmerge 19 | MSGCAT = msgcat 20 | MSGINIT = msginit 21 | 22 | LOCALES = $(shell cat locales.list) 23 | DOMAINS = $(shell awk '{print $$1}' < domains.list) 24 | SOURCES = $(shell awk '{$$1 = ""; print $$0}' < domains.list) 25 | POTS = $(SOURCES:.c=.pot) 26 | POS = $(shell for i in $(LOCALES); do for j in $(DOMAINS); do echo $$i/$$j.po; done; done) 27 | MOS = $(POS:.po=.mo) 28 | DOMAIN_POTS = $(POS:.po=.pot) 29 | BIN_LOCALES = $(addsuffix .bin,$(LOCALES)) 30 | LOCALE_DIR = $(ROOTDIR)/$(BINDIR)/share/locale 31 | 32 | 33 | all: $(LOCALES) $(MOS) 34 | 35 | bin: all $(BIN_LOCALES) 36 | 37 | $(BIN_LOCALES): 38 | [ -f $(LOCALE_DIR)/$(basename $@)/LC_MESSAGES ] || mkdir -p $(LOCALE_DIR)/$(basename $@)/LC_MESSAGES 39 | cp $(addprefix $(basename $@)/,$(addsuffix .mo,$(DOMAINS))) $(LOCALE_DIR)/$(basename $@)/LC_MESSAGES 40 | 41 | clean: 42 | rm -rf $(DOMAIN_POTS) 43 | rm -rf $(POTS) 44 | 45 | $(LOCALES): 46 | mkdir $@ 47 | 48 | $(DOMAIN_POTS): $(POTS) 49 | $(MSGCAT) -t UTF-8 $(shell grep -e "^$(shell basename $(basename $@))" < domains.list | awk '{$$1 = ""; print $$0}' | sed -e s,\.c,\.pot,g ) > $@ || true 50 | 51 | .c.pot: 52 | $(XGETTEXT) -o $@ $< 53 | 54 | .pot.po: 55 | [ -f $@ ] && $(MSGMERGE) -U $@ $< || $(MSGINIT) -o $@ -i $< 56 | touch $@ 57 | 58 | .po.mo: 59 | $(MSGFMT) -c -v -o $@ $< 60 | 61 | .PHONY: all clean bin $(BIN_LOCALES) 62 | .SUFFIXES: .c .pot .mo .po .pot 63 | .SECONDARY: $(POS) 64 | -------------------------------------------------------------------------------- /po/domains.list: -------------------------------------------------------------------------------- 1 | pbat ../pbat/errors/pBat_Errors.c ../pbat/lang/pBat_Lang.c ../pbat/lang/pBat_ShowHelp.c 2 | -------------------------------------------------------------------------------- /po/es/pbat.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkbatcher/picobat/975e71d876b711c3de82692a981f88431206c2be/po/es/pbat.po -------------------------------------------------------------------------------- /po/locales.list: -------------------------------------------------------------------------------- 1 | fr 2 | en 3 | hi 4 | es 5 | ca -------------------------------------------------------------------------------- /repo.ft: -------------------------------------------------------------------------------- 1 | # Footer for the repository version of the quick starting guide 2 | 3 | For more documentations and updates, please see the 4 | {http://picobat.org|official Picobat website}. 5 | 6 | 7 | {{What's in this folder ?}} 8 | 9 | There is a few interesting things in this directory that you might need: 10 | 11 | - {BUILD.readme|BUILD.readme} : A text file describing how to build {Picobat} 12 | 13 | - {WHATSNEW.md|WHATSNEW} : A log of the changes made to Picobat 14 | 15 | - {THANKS.md|THANKS} : A list of all the contributors to the project. 16 | 17 | - {GUIDELINES.md|GUIDELINES} : A text files giving guidelines on how to 18 | modify Picobat. 19 | 20 | - {COPYING.*} : The license of the project and of projects used by Picobat. -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | ROOTDIR = .. 19 | include ../config.mk 20 | 21 | cmds = hlp.bat 22 | root_cmds = pBat_Auto.bat 23 | 24 | ifeq ($(fn_WIN32),0) 25 | cmds += pbat_start 26 | endif 27 | 28 | all: pBat_Auto.bat 29 | 30 | clean: 31 | 32 | bin: hlp_man 33 | mkdir -p $(BINDIR)/cmd 34 | cp -f $(root_cmds) $(BINDIR) 35 | cp -f $(cmds) $(BINDIR)/cmd 36 | 37 | hlp_man: 38 | mkdir -p $(BINDIR)/share/pbat/hlp 39 | cp -rL $(ROOTDIR)/man/* $(BINDIR)/share/pbat/hlp 40 | 41 | .in.bat: 42 | ../femto-subst < $< > $@ 43 | 44 | .PHONY: all clean bin hlp_man 45 | .SUFFIXES: .in .bat 46 | -------------------------------------------------------------------------------- /tea/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR = .. 20 | include $(ROOTDIR)/config.mk 21 | 22 | CFLAGS += $(LIBPBAT_INC) 23 | LDFLAGS += $(LIBPBAT_LD) $(LIBCU8_LD) 24 | 25 | LDFLAGS += $(LIBPBAT_LD) $(LPTHREAD_LD) 26 | 27 | SRC_FILES := \ 28 | src/Tea_Load.c src/Tea_Node.c src/Tea_Output.c \ 29 | src/out/tea_ansi_out.c src/out/tea_html_out.c src/out/tea_text_out.c \ 30 | src/out/tea_md_out.c src/tea.c src/tea_strupr.c 31 | 32 | OBJ_FILES = $(SRC_FILES:.c=.o) 33 | 34 | all: tea 35 | 36 | tea: $(OBJ_FILES) 37 | $(CC) -o tea$(EXEC_SUFFIX) $(OBJ_FILES) $(LDFLAGS) 38 | 39 | clean: 40 | rm -f $(OBJ_FILES) 41 | rm -f tea$(EXEC_SUFFIX) 42 | 43 | bin: tea 44 | cp tea$(EXEC_SUFFIX) $(BINDIR)/cmd/ 45 | 46 | .PHONY: all clean bin 47 | -------------------------------------------------------------------------------- /tea/src/tea_strupr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * TEA - A quick and simple text preprocessor 4 | * Copyright (C) 2010-2016 DarkBatcher 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | */ 20 | 21 | #ifndef WIN32 22 | 23 | /* this is a wrapper on the Win32 strupr */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | char* strupr(char* lpChar) 32 | { 33 | char* const lpCharBegin=lpChar; 34 | 35 | while (*lpChar) { 36 | 37 | if (isalpha(*lpChar)) *lpChar=toupper(*lpChar); 38 | 39 | lpChar=pBat_GetNextChar(lpChar); 40 | 41 | } 42 | 43 | return lpCharBegin; 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # pBat Makefiles, The pBat project 3 | # Copyright (C) 2012-2018 Romain Garbi, Teddy Astie 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | ROOTDIR=.. 20 | BINDIR?=$(ROOTDIR)/bin 21 | PBAT=$(BINDIR)/pbat 22 | TESTS=$(shell find . -name "*.bat") 23 | TESTS.OUT=$(TESTS:.bat=.out) 24 | 25 | 26 | # do nothing 27 | all: 28 | 29 | test: test-clean $(TESTS.OUT) 30 | 31 | test-clean: 32 | rm -Rf $(TESTS.OUT) 33 | 34 | .bat.out: 35 | @echo Running test : $< 36 | @$(PBAT) run-test.cmd $< $@ 37 | @cmp $@ $@.ok; \ 38 | case $$? in \ 39 | 0) echo " OK";true;; \ 40 | *) echo " ERROR";false;; \ 41 | esac; 42 | .PHONY: test test-clean 43 | .SUFFIXES: .bat .out -------------------------------------------------------------------------------- /tests/basics/block.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | (echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. 3 | echo Curabitur eget justo convallis, sollicitudin massa ut, 4 | echo condimentum lacus. Etiam sagittis suscipit nisl vitae 5 | echo condimentum. Phasellus mollis, velit nec eleifend mattis, 6 | echo tortor turpis interdum sem, malesuada lacinia enim purus 7 | echo nec nisl. Ut semper a tortor finibus aliquet. Interdum ) > block 8 | type block -------------------------------------------------------------------------------- /tests/basics/block.out.ok: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 2 | Curabitur eget justo convallis, sollicitudin massa ut, 3 | condimentum lacus. Etiam sagittis suscipit nisl vitae 4 | condimentum. Phasellus mollis, velit nec eleifend mattis, 5 | tortor turpis interdum sem, malesuada lacinia enim purus 6 | nec nisl. Ut semper a tortor finibus aliquet. Interdum 7 | -------------------------------------------------------------------------------- /tests/basics/expansion.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | set index=1 4 | set tbl[1]=test 5 | echo %index% !tbl[%index%]! -------------------------------------------------------------------------------- /tests/basics/expansion.out.ok: -------------------------------------------------------------------------------- 1 | 1 test 2 | -------------------------------------------------------------------------------- /tests/basics/hello_world.bat: -------------------------------------------------------------------------------- 1 | @ECHO off 2 | echo Hello World ^! -------------------------------------------------------------------------------- /tests/basics/hello_world.out.ok: -------------------------------------------------------------------------------- 1 | Hello World ! 2 | -------------------------------------------------------------------------------- /tests/basics/noexpansion.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal disabledelayedexpansion 3 | set index=1 4 | set tbl[1]=test 5 | echo %index% !tbl[%index%]! -------------------------------------------------------------------------------- /tests/basics/noexpansion.out.ok: -------------------------------------------------------------------------------- 1 | 1 !tbl[1]! 2 | -------------------------------------------------------------------------------- /tests/basics/pipe.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | (echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. 3 | echo Curabitur eget justo convallis, sollicitudin massa ut, 4 | echo condimentum lacus. Etiam sagittis suscipit nisl vitae 5 | echo condimentum. Phasellus mollis, velit nec eleifend mattis, 6 | echo tortor turpis interdum sem, malesuada lacinia enim purus 7 | echo nec nisl. Ut semper a tortor finibus aliquet. Interdum ) | find condimentum -------------------------------------------------------------------------------- /tests/basics/pipe.out.ok: -------------------------------------------------------------------------------- 1 | condimentum lacus. Etiam sagittis suscipit nisl vitae 2 | condimentum. Phasellus mollis, velit nec eleifend mattis, 3 | -------------------------------------------------------------------------------- /tests/basics/pipeext.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | (echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. 3 | echo Curabitur eget justo convallis, sollicitudin massa ut, 4 | echo condimentum lacus. Etiam sagittis suscipit nisl vitae 5 | echo condimentum. Phasellus mollis, velit nec eleifend mattis, 6 | echo tortor turpis interdum sem, malesuada lacinia enim purus 7 | echo nec nisl. Ut semper a tortor finibus aliquet. Interdum ) | dump /h /t:c /b -------------------------------------------------------------------------------- /tests/basics/pipeext.out.ok: -------------------------------------------------------------------------------- 1 | 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 2 | 2c 20 63 6f 6e 73 65 63 74 65 74 75 72 20 61 64 69 70 69 73 63 69 6e 67 20 65 3 | 6c 69 74 2e 0d 0a 43 75 72 61 62 69 74 75 72 20 65 67 65 74 20 6a 75 73 74 6f 4 | 20 63 6f 6e 76 61 6c 6c 69 73 2c 20 73 6f 6c 6c 69 63 69 74 75 64 69 6e 20 6d 5 | 61 73 73 61 20 75 74 2c 20 0d 0a 63 6f 6e 64 69 6d 65 6e 74 75 6d 20 6c 61 63 6 | 75 73 2e 20 45 74 69 61 6d 20 73 61 67 69 74 74 69 73 20 73 75 73 63 69 70 69 7 | 74 20 6e 69 73 6c 20 76 69 74 61 65 20 0d 0a 63 6f 6e 64 69 6d 65 6e 74 75 6d 8 | 2e 20 50 68 61 73 65 6c 6c 75 73 20 6d 6f 6c 6c 69 73 2c 20 76 65 6c 69 74 20 9 | 6e 65 63 20 65 6c 65 69 66 65 6e 64 20 6d 61 74 74 69 73 2c 0d 0a 74 6f 72 74 10 | 6f 72 20 74 75 72 70 69 73 20 69 6e 74 65 72 64 75 6d 20 73 65 6d 2c 20 6d 61 11 | 6c 65 73 75 61 64 61 20 6c 61 63 69 6e 69 61 20 65 6e 69 6d 20 70 75 72 75 73 12 | 0d 0a 6e 65 63 20 6e 69 73 6c 2e 20 55 74 20 73 65 6d 70 65 72 20 61 20 74 6f 13 | 72 74 6f 72 20 66 69 6e 69 62 75 73 20 61 6c 69 71 75 65 74 2e 20 49 6e 74 65 14 | 72 64 75 6d 20 0d 0a 15 | -------------------------------------------------------------------------------- /tests/run-test.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | %1 > %2 --------------------------------------------------------------------------------