move the tests under the debug folder
[AROS.git] / debug / test / dos / consolemodes.c
blob7e76f1d0f18a7075523a6df3cd32c61a26a8a8d3
1 /*
2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <proto/exec.h>
8 #include <proto/dos.h>
9 #include <string.h>
10 #include <stdlib.h>
11 #include <ctype.h>
13 int main(int argc, char **argv) {
14 BPTR in, out;
15 TEXT something[64];
16 int i;
18 in = Input();
19 out = Output();
21 SetMode(in, 0);
23 Printf("in normal (cooked) mode\n");
24 Printf("type something: ");
25 Flush(out);
27 FGets(out, something, 64);
28 *(strchr(something, '\n')) = '\0';
30 Printf("you typed: %s\n", something);
32 SetMode(in, 1);
34 Printf("in raw mode\n");
35 Printf("type something: ");
36 Flush(out);
38 something[63] = '\0';
39 i = 0;
40 while (i < 63) {
41 Read(in, &(something[i]), 1);
42 if (something[i] == 0x0d) {
43 something[i] = '\0';
44 break;
46 if (! isprint(something[i]))
47 continue;
48 i++;
51 Printf("\nyou typed: %s\n", something);
53 SetMode(in, 0);
55 Printf("restored normal (cooked) mode\n");
57 return 0;