set to eol-style native ;)
Modified: trunk/reactos/subsys/system/cmd/readme2.txt
_____
Modified: trunk/reactos/subsys/system/cmd/readme2.txt
--- trunk/reactos/subsys/system/cmd/readme2.txt 2005-10-10 18:57:56 UTC
(rev 18401)
+++ trunk/reactos/subsys/system/cmd/readme2.txt 2005-10-10 19:08:57 UTC
(rev 18402)
@@ -1,19 +1,19 @@
-General Overview of How THings Work
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-First it comes into _main in cmd.c(1811). The command line params are
taking in and if it is unicode it uses CommandLineToArgvW. This can
cause a problem on older machines and that is why we have our own custom
_CommandLineToArgvW to help this along. We pull in the launch directory
as the inital dir and set that in _tchdir. We make a handle to the
default console out using CreateFile.
-
-Then we call Initialize(). Here we need to load ntdll.dll if it isnt
loaded(windows 9x machines). We also setup some gloabl vars like
default io handles and nErrorLevel and set %prompt% to $P$G. This is
where all command lines switches given to cmd on startup are done.
-
-From here main calls ProcessInput(). This is where cmd loops for
getting input and doing the commands. First it checks to see if there
is a batch file(note: there is agolbal struct "bc" which is NULL when
not processing a batch file) and if there is it will pull a new line
from that file. If not, thne it will wait for input. Currently there
is some stuff for set /a in there, which might stay there or see if we
can find a better spot.
-
-Once there is input taken in from the command line it is sent into
ParseCommandLine(). In here we fist check for aliases and convert if
need be. THen we look for redirections using GetRedirection() which
will remove any redirection symbols. and pass back info about where to
redirect. from this info it will do some switching around with the
handles for where things go and send them as need be. personally i dont
like this code and i tried to chnage it before but failed. it is
confusing to me and i dont understand why a lot of it is there but
apparently it is needed.
-
-It sends the new string without any redirection info into DoCommand().
In this function we just look to see what should be done. There is one
of 2 things that could happen. 1) we fnd the matching command and send
it off to that commands little section. 2) we dont find it so we send it
to Execute() and see if it is a file that we can do something.
-
-Execute will try to launch the file using createprocess and falls back
on shellexecute. It calls a function called SearchForExecuteable() to
find the full path name and looks in all the correct locations like
PATH, curreent folder, windows folder. If it cant find it, just fails
and prints out a message.
-
-Some useful functions that are used a lot:
-split() - splits a string into an array of string on spaces that arent
inside quotes. which you need to call freep() on later t clean up.
-IsValidPathName(), IsExistingFile(), IsExistingDirectory() - all do
what you would expect.
-PagePrompt() - ask them to hit a key to continue
-FilePromptYN[A]() - ask them a yes or no question
+General Overview of How THings Work
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+First it comes into _main in cmd.c(1811). The command line params are
taking in and if it is unicode it uses CommandLineToArgvW. This can
cause a problem on older machines and that is why we have our own custom
_CommandLineToArgvW to help this along. We pull in the launch directory
as the inital dir and set that in _tchdir. We make a handle to the
default console out using CreateFile.
+
+Then we call Initialize(). Here we need to load ntdll.dll if it isnt
loaded(windows 9x machines). We also setup some gloabl vars like
default io handles and nErrorLevel and set %prompt% to $P$G. This is
where all command lines switches given to cmd on startup are done.
+
+From here main calls ProcessInput(). This is where cmd loops for
getting input and doing the commands. First it checks to see if there
is a batch file(note: there is agolbal struct "bc" which is NULL when
not processing a batch file) and if there is it will pull a new line
from that file. If not, thne it will wait for input. Currently there
is some stuff for set /a in there, which might stay there or see if we
can find a better spot.
+
+Once there is input taken in from the command line it is sent into
ParseCommandLine(). In here we fist check for aliases and convert if
need be. THen we look for redirections using GetRedirection() which
will remove any redirection symbols. and pass back info about where to
redirect. from this info it will do some switching around with the
handles for where things go and send them as need be. personally i dont
like this code and i tried to chnage it before but failed. it is
confusing to me and i dont understand why a lot of it is there but
apparently it is needed.
+
+It sends the new string without any redirection info into DoCommand().
In this function we just look to see what should be done. There is one
of 2 things that could happen. 1) we fnd the matching command and send
it off to that commands little section. 2) we dont find it so we send it
to Execute() and see if it is a file that we can do something.
+
+Execute will try to launch the file using createprocess and falls back
on shellexecute. It calls a function called SearchForExecuteable() to
find the full path name and looks in all the correct locations like
PATH, curreent folder, windows folder. If it cant find it, just fails
and prints out a message.
+
+Some useful functions that are used a lot:
+split() - splits a string into an array of string on spaces that arent
inside quotes. which you need to call freep() on later t clean up.
+IsValidPathName(), IsExistingFile(), IsExistingDirectory() - all do
what you would expect.
+PagePrompt() - ask them to hit a key to continue
+FilePromptYN[A]() - ask them a yes or no question
Property changes on: trunk/reactos/subsys/system/cmd/readme2.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added a more technical readme for people that want to understand cmd.
Modified: trunk/reactos/subsys/system/cmd/readme2.txt
Modified: trunk/reactos/subsys/system/cmd/todo.txt
_____
Modified: trunk/reactos/subsys/system/cmd/readme2.txt
--- trunk/reactos/subsys/system/cmd/readme2.txt 2005-10-10 18:35:33 UTC
(rev 18400)
+++ trunk/reactos/subsys/system/cmd/readme2.txt 2005-10-10 18:57:56 UTC
(rev 18401)
@@ -1 +1,19 @@
-Nothing yet...
\ No newline at end of file
+General Overview of How THings Work
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+First it comes into _main in cmd.c(1811). The command line params are
taking in and if it is unicode it uses CommandLineToArgvW. This can
cause a problem on older machines and that is why we have our own custom
_CommandLineToArgvW to help this along. We pull in the launch directory
as the inital dir and set that in _tchdir. We make a handle to the
default console out using CreateFile.
+
+Then we call Initialize(). Here we need to load ntdll.dll if it isnt
loaded(windows 9x machines). We also setup some gloabl vars like
default io handles and nErrorLevel and set %prompt% to $P$G. This is
where all command lines switches given to cmd on startup are done.
+
+From here main calls ProcessInput(). This is where cmd loops for
getting input and doing the commands. First it checks to see if there
is a batch file(note: there is agolbal struct "bc" which is NULL when
not processing a batch file) and if there is it will pull a new line
from that file. If not, thne it will wait for input. Currently there
is some stuff for set /a in there, which might stay there or see if we
can find a better spot.
+
+Once there is input taken in from the command line it is sent into
ParseCommandLine(). In here we fist check for aliases and convert if
need be. THen we look for redirections using GetRedirection() which
will remove any redirection symbols. and pass back info about where to
redirect. from this info it will do some switching around with the
handles for where things go and send them as need be. personally i dont
like this code and i tried to chnage it before but failed. it is
confusing to me and i dont understand why a lot of it is there but
apparently it is needed.
+
+It sends the new string without any redirection info into DoCommand().
In this function we just look to see what should be done. There is one
of 2 things that could happen. 1) we fnd the matching command and send
it off to that commands little section. 2) we dont find it so we send it
to Execute() and see if it is a file that we can do something.
+
+Execute will try to launch the file using createprocess and falls back
on shellexecute. It calls a function called SearchForExecuteable() to
find the full path name and looks in all the correct locations like
PATH, curreent folder, windows folder. If it cant find it, just fails
and prints out a message.
+
+Some useful functions that are used a lot:
+split() - splits a string into an array of string on spaces that arent
inside quotes. which you need to call freep() on later t clean up.
+IsValidPathName(), IsExistingFile(), IsExistingDirectory() - all do
what you would expect.
+PagePrompt() - ask them to hit a key to continue
+FilePromptYN[A]() - ask them a yes or no question
_____
Modified: trunk/reactos/subsys/system/cmd/todo.txt
--- trunk/reactos/subsys/system/cmd/todo.txt 2005-10-10 18:35:33 UTC
(rev 18400)
+++ trunk/reactos/subsys/system/cmd/todo.txt 2005-10-10 18:57:56 UTC
(rev 18401)
@@ -33,4 +33,7 @@
We need more batch files like the one Royce made for "set /a". What
out for if bugs when doing this... could lead to in the wrong direction
when looking for a regression.
*Remove dependance on __REACTOS__
-__REACTOS__ = 0 doesnt compile and is useless. __REACTOS__ = 1 has
been the default and works just fine on windows.
\ No newline at end of file
+__REACTOS__ = 0 doesnt compile and is useless. __REACTOS__ = 1 has
been the default and works just fine on windows.
+
+*Add Breaker
+THere is partly code in place for this already. However it is broken
and not finished. PocketCMD which is open source and based off ros cmd
does do this correctly though. So there is something to look at and see
how it can be done. though it is hard to find where they are doing it
even though they are based on eachother they look pretty different now a
days.
\ No newline at end of file