From bf9b037645a5943e3ba0220be55f7f875445bd5a Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 22 Oct 2006 14:05:53 +0000 Subject: some further gsmd/libgsmd work git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@96 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/shell.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/util/shell.c (limited to 'src/util/shell.c') diff --git a/src/util/shell.c b/src/util/shell.c new file mode 100644 index 0000000..eb1991d --- /dev/null +++ b/src/util/shell.c @@ -0,0 +1,25 @@ +#include +#include + +#include + +#define STDIN_BUF_SIZE 1024 + +int shell_main(struct lgsmd_handle *lgsmh) +{ + int rc; + char buf[STDIN_BUF_SIZE+1]; + + while (1) { + rc = fscanf(stdin, "%s", buf); + if (rc == EOF) { + printf("EOF\n"); + return -1; + } + if (rc <= 0) { + printf("NULL\n"); + continue; + } + printf("STR=`%s'\n", buf); + } +} -- cgit v1.2.3