Providing a dummy program_handler_load() made made the telnet server work without program-handler but on the other hand incompatible with an exsistng program handler :-(

Therefore I replaced that hack with a clean CONF macro, which by the way really removes the run() and exec() functionality instead of just implementing it empty.
This commit is contained in:
oliverschmidt 2007-04-13 21:04:52 +00:00
parent 87971c35db
commit 7aae71934d
4 changed files with 25 additions and 7 deletions

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki desktop OS.
*
* $Id: shell.c,v 1.2 2006/08/30 22:06:18 oliverschmidt Exp $
* $Id: shell.c,v 1.3 2007/04/13 21:05:57 oliverschmidt Exp $
*
*/
@ -133,6 +133,7 @@ nullterminate(char *str)
return nt;
}
/*-----------------------------------------------------------------------------------*/
#ifdef SHELL_CONF_WITH_PROGRAM_HANDLER
static void
runfile(char *str)
{
@ -153,6 +154,7 @@ execfile(char *str)
runfile(str);
shell_quit(NULL);
}
#endif /* SHELL_CONF_WITH_PROGRAM_HANDLER */
/*-----------------------------------------------------------------------------------*/
static void
killproc(char *str)
@ -179,8 +181,10 @@ static void
help(char *str)
{
shell_output("Available commands:", "");
#ifdef SHELL_CONF_WITH_PROGRAM_HANDLER
shell_output("run - start program", "");
shell_output("exec - start program & exit shell", "");
shell_output("exec - start program & exit shell", "");
#endif
shell_output("ps - show processes", "");
shell_output("kill - kill process", "");
shell_output("ls - display directory", "");
@ -209,8 +213,11 @@ none(char *str)
}
/*-----------------------------------------------------------------------------------*/
static struct ptentry configparsetab[] =
{{'e', 'E', execfile},
{
#ifdef SHELL_CONF_WITH_PROGRAM_HANDLER
{'e', 'E', execfile},
{'r', 'R', runfile},
#endif
{'k', 'K', killproc},
{'p', 'P', processes},
{'l', 'L', directory},

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki desktop OS.
*
* $Id: telnetd.c,v 1.1 2006/06/17 22:41:13 adamdunkels Exp $
* $Id: telnetd.c,v 1.2 2007/04/13 21:04:52 oliverschmidt Exp $
*
*/
@ -394,6 +394,3 @@ telnetd_appcall(void *ts)
}
}
/*-----------------------------------------------------------------------------------*/
void
program_handler_load(char *name, char *arg)
{}

View File

@ -99,6 +99,11 @@ typedef unsigned long clock_time_t;
#define PROGRAM_HANDLER_CONF_MAX_NUMDSCS 10
#define SHELL_CONF_WITH_PROGRAM_HANDLER 1
#define SHELL_GUI_CONF_XSIZE 46
#define SHELL_GUI_CONF_YSIZE 22

View File

@ -105,6 +105,10 @@ typedef unsigned long clock_time_t;
#define SHELL_CONF_WITH_PROGRAM_HANDLER 1
#define SHELL_GUI_CONF_XSIZE 46
#define SHELL_GUI_CONF_YSIZE 22
@ -137,4 +141,9 @@ typedef unsigned short uip_stats_t;
#define WWW_CONF_MAX_INPUTNAMELEN 200
#define WWW_CONF_MAX_INPUTVALUELEN 240
#define TELNETD_CONF_LINELEN 64
#define TELNETD_CONF_NUMLINES 16
#endif /* __CONTIKI_CONF_H__ */