2 * fat-handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007-2015 The AROS Development Team
7 * This program is free software; you can redistribute it and/or modify it
8 * under the same terms as AROS itself.
13 #include <exec/types.h>
14 #include <exec/execbase.h>
15 #include <dos/dosextens.h>
16 #include <dos/filehandler.h>
17 #include <devices/input.h>
18 #include <devices/inputevent.h>
19 #include <intuition/intuition.h>
20 #include <intuition/intuitionbase.h>
22 #include <proto/intuition.h>
23 #include <proto/exec.h>
24 #include <proto/alib.h>
31 void SendEvent(LONG event
, struct Globals
*glob
)
33 struct IOStdReq
*InputRequest
;
34 struct MsgPort
*InputPort
;
35 struct InputEvent
*ie
;
37 if ((InputPort
= (struct MsgPort
*)CreateMsgPort()))
40 if ((InputRequest
= (struct IOStdReq
*)CreateIORequest(InputPort
,
41 sizeof(struct IOStdReq
))))
44 if (!OpenDevice("input.device", 0,
45 (struct IORequest
*)InputRequest
, 0))
48 if ((ie
= AllocVec(sizeof(struct InputEvent
),
49 MEMF_PUBLIC
| MEMF_CLEAR
)))
52 InputRequest
->io_Command
= IND_WRITEEVENT
;
53 InputRequest
->io_Data
= ie
;
54 InputRequest
->io_Length
= sizeof(struct InputEvent
);
56 DoIO((struct IORequest
*)InputRequest
);
60 CloseDevice((struct IORequest
*)InputRequest
);
62 DeleteIORequest((struct IORequest
*)InputRequest
);
64 DeleteMsgPort(InputPort
);
71 ULONG bitmask
= 1 << bitoffset
;
75 if ((data
& bitmask
) != 0)
86 LONG
ErrorMessageArgs(struct Globals
*glob
, char *options
, CONST_STRPTR format
, ...)
88 struct IntuitionBase
*IntuitionBase
;
91 AROS_SLOWSTACKFORMAT_PRE(format
);
94 (struct IntuitionBase
*)OpenLibrary("intuition.library", 36);
97 struct EasyStruct es
=
99 sizeof(struct EasyStruct
),
106 es
.es_TextFormat
= format
;
107 answer
= EasyRequestArgs(NULL
, &es
, NULL
, AROS_SLOWSTACKFORMAT_ARG(format
));
108 CloseLibrary((struct Library
*)IntuitionBase
);
111 AROS_SLOWSTACKFORMAT_POST(format
);