Re: CLIL source code from book "Firmware demystified"
- From: "Lanarcam" <lanarcam1@xxxxxxxx>
- Date: 29 Jun 2005 04:58:14 -0700
Roman Mashak wrote:
> Hello, Lanarcam!
> You wrote on 29 Jun 2005 02:02:52 -0700:
>
> ??>> parsing it, than calls appropriate function (for example, which shows
> ??>> env. variables: show_env()) and pass 'argc' and 'argv[]' to that
> ??>> function (assuming that in CLI prompt you enter some arguments, like
> ??>> 'show env current'). How is it possible to work?
>
> L> What exactly do you not understand?
> L> - main function getting command line from user?
> L> - parsing it?
> L> - calls appropriate function?
> L> - pass 'argc' and 'argv[]'?
> Main function gets command line (comman and its arguments) from user and
> than pass it to appropriate function handling all functionality. I don't
> understand why is 'argc' and 'argv[]' is passed, because I used to think
> 'argc' and 'argv[]' are valid only with a program running, not function.
If from a script shell you invoke a command such as
prompt> prog arg1 arg2
then a process is started, prog, whose main function receives
as arguments argc, the number of arguments and argv[], the
list of arguments, here arg1 and arg2.
The process is started by the shell. The process then parses
the arguments and calls the appropriate function.
When the process has finished its task it terminates and
the prompt is displayed again.
Or the process could be launched as a background process
and the prompt is displayed immediately.
> With best regards, Roman Mashak. E-mail: mrv@xxxxxxxx
.
- References:
- CLIL source code from book "Firmware demystified"
- From: Roman Mashak
- Re: CLIL source code from book "Firmware demystified"
- From: Lanarcam
- Re: CLIL source code from book "Firmware demystified"
- From: Roman Mashak
- CLIL source code from book "Firmware demystified"
- Prev by Date: Re: MISRA new rule suggestion
- Next by Date: Re: Startup code
- Previous by thread: Re: CLIL source code from book "Firmware demystified"
- Next by thread: Re: CLIL source code from book "Firmware demystified"
- Index(es):
Relevant Pages
|