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>
30 void SendEvent(LONG event
, struct Globals
*glob
)
32 struct IOStdReq
*InputRequest
;
33 struct MsgPort
*InputPort
;
34 struct InputEvent
*ie
;
36 if ((InputPort
= (struct MsgPort
*)CreateMsgPort()))
39 if ((InputRequest
= (struct IOStdReq
*)CreateIORequest(InputPort
,
40 sizeof(struct IOStdReq
))))
43 if (!OpenDevice("input.device", 0,
44 (struct IORequest
*)InputRequest
, 0))
47 if ((ie
= AllocVec(sizeof(struct InputEvent
),
48 MEMF_PUBLIC
| MEMF_CLEAR
)))
51 InputRequest
->io_Command
= IND_WRITEEVENT
;
52 InputRequest
->io_Data
= ie
;
53 InputRequest
->io_Length
= sizeof(struct InputEvent
);
55 DoIO((struct IORequest
*)InputRequest
);
59 CloseDevice((struct IORequest
*)InputRequest
);
61 DeleteIORequest((struct IORequest
*)InputRequest
);
63 DeleteMsgPort(InputPort
);
70 ULONG bitmask
= 1 << bitoffset
;
74 if ((data
& bitmask
) != 0)
85 void ErrorMessageArgs(char *fmt
, IPTR
*ap
, struct Globals
*glob
)
87 struct IntuitionBase
*IntuitionBase
;
90 (struct IntuitionBase
*)OpenLibrary("intuition.library", 36);
93 struct EasyStruct es
=
95 sizeof(struct EasyStruct
),
97 "FAT filesystem critical error",
102 es
.es_TextFormat
= fmt
;
103 EasyRequestArgs(NULL
, &es
, NULL
, ap
);
104 CloseLibrary((struct Library
*)IntuitionBase
);