Name: Anonymous 2009-01-15 6:31
a simple shell with a static number of commands, not able to execute other programs, just executing one function for each command
so far i've made a struct array where each struct holds the command name, number of arguments and a pointer to the function
and i loop through this struct checking the command name each time you press enter in the shell, unless your line is blank of course
functions use va_list to have variable arguments but other than that they're pretty basic and take the struct as first argument
is this the best practice? what other practices are there to do this?
so far i've made a struct array where each struct holds the command name, number of arguments and a pointer to the function
and i loop through this struct checking the command name each time you press enter in the shell, unless your line is blank of course
functions use va_list to have variable arguments but other than that they're pretty basic and take the struct as first argument
is this the best practice? what other practices are there to do this?