1 #include <exec/types.h>
2 #include <proto/exec.h>
4 #include <dos/filesystem.h>
9 int main(int argc
, char **argv
) {
13 #ifndef AROS_DOS_PACKETS
14 struct IOFileSys iofs
;
15 struct FileHandle
*fh
;
23 Printf("in normal (cooked) mode\n");
24 Printf("type something: ");
27 FGets(out
, something
, 64);
28 *(strchr(something
, '\n')) = '\0';
30 Printf("you typed: %s\n", something
);
34 Printf("in raw mode\n");
35 Printf("type something: ");
42 Read(in
, &(something
[i
]), 1);
43 if (something
[i
] == 0x0d) {
47 if (! isprint(something
[i
]))
52 Printf("\nyou typed: %s\n", something
);
54 #ifdef AROS_DOS_PACKETS
55 /* TODO: Switch to cooked mode */
57 fh
= (struct FileHandle
*) in
;
59 iofs
.IOFS
.io_Message
.mn_Node
.ln_Type
= NT_REPLYMSG
;
60 iofs
.IOFS
.io_Message
.mn_ReplyPort
= &(((struct Process
*) FindTask(NULL
))->pr_MsgPort
);
61 iofs
.IOFS
.io_Message
.mn_Length
= sizeof(struct IOFileSys
);
63 iofs
.IOFS
.io_Device
= fh
->fh_Device
;
64 iofs
.IOFS
.io_Unit
= fh
->fh_Unit
;
65 iofs
.IOFS
.io_Command
= FSA_CONSOLE_MODE
;
66 iofs
.IOFS
.io_Flags
= 0;
68 iofs
.io_Union
.io_CONSOLE_MODE
.io_ConsoleMode
= FCM_NOECHO
;
73 Printf("in cooked mode with no echoing\n");
74 Printf("type something: ");
77 FGets(out
, something
, 64);
78 *(strchr(something
, '\n')) = '\0';
80 Printf("you typed: %s\n", something
);
84 Printf("restored normal (cooked) mode\n");