comparison lcdemu/process.c @ 905:841982f31be3

lcdemu: got to input lines
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 07 Sep 2015 08:51:02 +0000
parents 312778104f54
children 7a189b7bbd67
comparison
equal deleted inserted replaced
904:e54abee27e8f 905:841982f31be3
13 #include "globals.h" 13 #include "globals.h"
14 14
15 input_on_stdin(inbuf, incount) 15 input_on_stdin(inbuf, incount)
16 char *inbuf; 16 char *inbuf;
17 { 17 {
18 /* to be implemented */ 18 char *input_end = inbuf + incount;
19 static char linebuf[1024];
20 static int linesz;
21 char *cp;
22
23 for (cp = inbuf; cp < input_end; cp++) {
24 if (*cp == '\n') {
25 linebuf[linesz] = '\0';
26 process_input_line(linebuf);
27 linesz = 0;
28 continue;
29 }
30 if (linesz < sizeof(linebuf) - 1)
31 linebuf[linesz++] = *cp;
32 }
19 } 33 }
34
35 process_input_line(line)
36 char *line;
37 {
38 printf("Got input line: %s\n", line);
39 }