1 #include <exec/types.h>
2 #include <proto/exec.h>
4 #include <dos/filesystem.h>
9 int main(int argc
, char **argv
) {
13 struct IOFileSys iofs
;
14 struct FileHandle
*fh
;
21 Printf("in normal (cooked) mode\n");
22 Printf("type something: ");
25 FGets(out
, something
, 64);
26 *(strchr(something
, '\n')) = '\0';
28 Printf("you typed: %s\n", something
);
32 Printf("in raw mode\n");
33 Printf("type something: ");
40 Read(in
, &(something
[i
]), 1);
41 if (something
[i
] == 0x0d) {
45 if (! isprint(something
[i
]))
50 Printf("\nyou typed: %s\n", something
);
52 #ifdef AROS_DOS_PACKETS
53 /* TODO: Switch to cooked mode */
55 fh
= (struct FileHandle
*) in
;
57 iofs
.IOFS
.io_Message
.mn_Node
.ln_Type
= NT_REPLYMSG
;
58 iofs
.IOFS
.io_Message
.mn_ReplyPort
= &(((struct Process
*) FindTask(NULL
))->pr_MsgPort
);
59 iofs
.IOFS
.io_Message
.mn_Length
= sizeof(struct IOFileSys
);
61 iofs
.IOFS
.io_Device
= fh
->fh_Device
;
62 iofs
.IOFS
.io_Unit
= fh
->fh_Unit
;
63 iofs
.IOFS
.io_Command
= FSA_CONSOLE_MODE
;
64 iofs
.IOFS
.io_Flags
= 0;
66 iofs
.io_Union
.io_CONSOLE_MODE
.io_ConsoleMode
= FCM_NOECHO
;
71 Printf("in cooked mode with no echoing\n");
72 Printf("type something: ");
75 FGets(out
, something
, 64);
76 *(strchr(something
, '\n')) = '\0';
78 Printf("you typed: %s\n", something
);
82 Printf("restored normal (cooked) mode\n");