:: Re: [DNG] netman GIT project
Startseite
Nachricht löschen
Nachricht beantworten
Autor: aitor_czr
Datum:  
To: Edward Bartolo, Tobias Hunger
CC: dng
Betreff: Re: [DNG] netman GIT project
Hi Edward,

Don't change the name of the main funtion. In order to distinguish
between ifup and ifdown, you can use one of the arguments, for example
argv[1] (the first one *int argc* is the number of arguments in the
command line (+1) included itself) .

Aitor.

El 08/09/15 a las 21:40, Edward Bartolo escribió:
> Hi all,
>
> I think, a simple way to avoid the backend having to call external
> programs like ifup and ifdown, is to use code belonging to these
> programs as it they were functions. This means, their code would be
> used like this:
>
> Suppose int main(int argc, char * argv[]) is the main function for
> ifup. The main function's name would be changed like this, and the
> other code belonging to ifup would be used.
>
> int ifup_main(int argc, char * argv[]);
>
> If I am correct, this should allow the backend to avoid having to use
> execl to call ifup or ifdown or whatever other external program.
>
> Edward