]>
Commit | Line | Data |
---|---|---|
2bcaaabf JW |
1 | #include <stdio.h> |
2 | ||
3 | void dowrite(char *s, int len) | |
4 | { | |
5 | int i; | |
6 | for (i=0; i<len; i++) | |
7 | { | |
8 | write(1, s+i, 1); | |
9 | } | |
10 | } | |
11 | ||
12 | void main() | |
13 | { | |
14 | char buf[259]; | |
15 | int sz; | |
16 | dowrite("\x1B" "A\x00\x00\x00...", 8); | |
17 | fprintf(stderr, "Address sent\n"); | |
18 | while ((sz = read(0, buf+3, 128)) > 0) | |
19 | { | |
20 | buf[0] = 0x1B; | |
21 | buf[1] = 'D'; | |
22 | buf[2] = sz - 1; | |
23 | dowrite(buf, sz + 3); | |
24 | dowrite(".", 1); | |
25 | fprintf(stderr, "Data sent\n"); | |
26 | usleep(100000); | |
27 | } | |
28 | } |