diff options
Diffstat (limited to 'src/util/shell.c')
-rw-r--r-- | src/util/shell.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <stdio.h> +#include <string.h> + +#include <libgsmd/libgsmd.h> + +#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); + } +} |