summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-28 07:20:32 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-28 07:20:32 -0600
commitfbe67261712462537e2d4158e193f808f1a859b8 (patch)
treed8a825a24ade66051b5a97d9cefefa4f881b4772
parent9811576dddf0a9a7300e35174d291c9ece70bd12 (diff)
downloadnuttx-fbe67261712462537e2d4158e193f808f1a859b8.tar.gz
nuttx-fbe67261712462537e2d4158e193f808f1a859b8.tar.bz2
nuttx-fbe67261712462537e2d4158e193f808f1a859b8.zip
apps/examples/telnetd: Naming confusion fixed: shell vs telnetd
-rw-r--r--apps/ChangeLog.txt4
-rw-r--r--apps/examples/telnetd/Makefile2
-rw-r--r--apps/examples/telnetd/telnetd.c (renamed from apps/examples/telnetd/shell.c)58
-rw-r--r--apps/examples/telnetd/telnetd.h (renamed from apps/examples/telnetd/shell.h)8
4 files changed, 38 insertions, 34 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 3cf4d91c7..af1f8fa53 100644
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -894,3 +894,7 @@
instead of using the stack. From Bob Doiron (2014-4-21).
* apps/examples/cpuhog, serialblaster, and serialrx: Stress test
examples added by Bob Doiron (2014-4-22).
+ * apps/examples/telnetd: Naming is confused. In someplaces 'telnetd',
+ and in others 'shell.' All changes to telnetd. Noted by Pelle
+ Windestam (2014-4-38).
+
diff --git a/apps/examples/telnetd/Makefile b/apps/examples/telnetd/Makefile
index 7ba00ba11..18e035113 100644
--- a/apps/examples/telnetd/Makefile
+++ b/apps/examples/telnetd/Makefile
@@ -40,7 +40,7 @@ include $(APPDIR)/Make.defs
# Hello, World! Example
ASRCS =
-CSRCS = shell.c
+CSRCS = telnetd.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
diff --git a/apps/examples/telnetd/shell.c b/apps/examples/telnetd/telnetd.c
index 03d178e9c..351f466c6 100644
--- a/apps/examples/telnetd/shell.c
+++ b/apps/examples/telnetd/telnetd.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * examples/telnetd/shell.c
+ * examples/telnetd/telnetd.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -50,7 +50,7 @@
#include <apps/netutils/telnetd.h>
#include <apps/netutils/uiplib.h>
-#include "shell.h"
+#include "telnetd.h"
/****************************************************************************
* Definitions
@@ -70,10 +70,10 @@ struct ptentry_s
* Private Function Prototypes
****************************************************************************/
-static void shell_help(int argc, char **argv);
-static void shell_quit(int argc, char **argv);
-static void shell_unknown(int argc, char **argv);
-static void shell_parse(FAR char *line, int len);
+static void telnetd_help(int argc, char **argv);
+static void telnetd_quit(int argc, char **argv);
+static void telnetd_unknown(int argc, char **argv);
+static void telnetd_parse(FAR char *line, int len);
/****************************************************************************
* Private Data
@@ -81,10 +81,10 @@ static void shell_parse(FAR char *line, int len);
static struct ptentry_s g_parsetab[] =
{
- {"help", shell_help},
- {"exit", shell_quit},
- {"?", shell_help},
- {NULL, shell_unknown}
+ {"help", telnetd_help},
+ {"exit", telnetd_quit},
+ {"?", telnetd_help},
+ {NULL, telnetd_unknown}
};
/****************************************************************************
@@ -92,10 +92,10 @@ static struct ptentry_s g_parsetab[] =
****************************************************************************/
/****************************************************************************
- * Name: shell_help
+ * Name: telnetd_help
****************************************************************************/
-static void shell_help(int argc, char **argv)
+static void telnetd_help(int argc, char **argv)
{
printf("Available commands:\n");
printf(" help, ? - show help\n");
@@ -103,10 +103,10 @@ static void shell_help(int argc, char **argv)
}
/****************************************************************************
- * Name: shell_help
+ * Name: telnetd_help
****************************************************************************/
-static void shell_unknown(int argc, char **argv)
+static void telnetd_unknown(int argc, char **argv)
{
if (argv[0])
{
@@ -115,20 +115,20 @@ static void shell_unknown(int argc, char **argv)
}
/****************************************************************************
- * Name: shell_quit
+ * Name: telnetd_quit
****************************************************************************/
-static void shell_quit(int argc, char **argv)
+static void telnetd_quit(int argc, char **argv)
{
printf("Bye!\n");
exit(0);
}
/****************************************************************************
- * Name: shell_parse
+ * Name: telnetd_parse
****************************************************************************/
-static void shell_parse(FAR char *line, int len)
+static void telnetd_parse(FAR char *line, int len)
{
struct ptentry_s *entry;
FAR char *cmd;
@@ -154,10 +154,10 @@ static void shell_parse(FAR char *line, int len)
}
/****************************************************************************
- * Name: shell_session
+ * Name: telnetd_session
****************************************************************************/
-int shell_session(int argc, char *argv[])
+int telnetd_session(int argc, char *argv[])
{
char line[128];
@@ -174,17 +174,17 @@ int shell_session(int argc, char *argv[])
break;
}
- shell_parse(line, 128);
+ telnetd_parse(line, 128);
}
return 0;
}
/****************************************************************************
- * Name: shell_netinit
+ * Name: telnetd_netinit
****************************************************************************/
-static void shell_netinit(void)
+static void telnetd_netinit(void)
{
struct in_addr addr;
#ifdef CONFIG_EXAMPLES_TELNETD_NOMAC
@@ -223,15 +223,15 @@ static void shell_netinit(void)
* Public Functions
****************************************************************************/
-int shell_main(int argc, char *argv[])
+int telnetd_main(int argc, char *argv[])
{
struct telnetd_config_s config;
int ret;
/* Configure the network */
- printf("shell_main: Initializing the network\n");
- shell_netinit();
+ printf("telnetd_main: Initializing the network\n");
+ telnetd_netinit();
/* Configure the telnet daemon */
@@ -240,17 +240,17 @@ int shell_main(int argc, char *argv[])
config.d_stacksize = CONFIG_EXAMPLES_TELNETD_DAEMONSTACKSIZE;
config.t_priority = CONFIG_EXAMPLES_TELNETD_CLIENTPRIO;
config.t_stacksize = CONFIG_EXAMPLES_TELNETD_CLIENTSTACKSIZE;
- config.t_entry = shell_session;
+ config.t_entry = telnetd_session;
/* Start the telnet daemon */
- printf("shell_main: Starting the Telnet daemon\n");
+ printf("telnetd_main: Starting the Telnet daemon\n");
ret = telnetd_start(&config);
if (ret < 0)
{
printf("Failed to tart the Telnet daemon\n");
}
- printf("shell_main: Exiting\n");
+ printf("telnetd_main: Exiting\n");
return 0;
}
diff --git a/apps/examples/telnetd/shell.h b/apps/examples/telnetd/telnetd.h
index 59d51a562..f5cd4c440 100644
--- a/apps/examples/telnetd/shell.h
+++ b/apps/examples/telnetd/telnetd.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * apps/examples/telnetd/shell.h
+ * apps/examples/telnetd/telnetd.h
* Interface for the Contiki shell.
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
@@ -32,8 +32,8 @@
*
****************************************************************************/
-#ifndef __APPS_EXAMPLES_TELNETD_SHELL_H
-#define __APPS_EXAMPLES_TELNETD_SHELL_H
+#ifndef __APPS_EXAMPLES_TELNETD_TELNETL_H
+#define __APPS_EXAMPLES_TELNETD_TELNETL_H
/****************************************************************************
* Pre-processor Definitions
@@ -89,4 +89,4 @@
* Public Function Prototypes
****************************************************************************/
-#endif /* __APPS_EXAMPLES_TELNETD_SHELL_H */
+#endif /* __APPS_EXAMPLES_TELNETD_TELNETL_H */