blob: eb1991daba3028308e6dc7d554be699e550a671e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
}
}
|