2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
6 #include <proto/alib.h>
7 #include <proto/exec.h>
9 #include <proto/intuition.h>
11 #include <exec/memory.h>
12 #include <exec/nodes.h>
20 #include "hdtoolbox_support.h"
22 #include "partitions.h"
23 #include "partitiontables.h"
30 extern struct ListNode root
;
32 struct IntuitionBase
*IntuitionBase
= NULL
;
33 struct GfxBase
*GfxBase
= NULL
;
34 struct PartitionBase
*PartitionBase
= NULL
;
36 LONG
initEnv(char *device
)
40 D(bug("[HDToolBox] initEnv('%s')\n", device
));
42 if (!InitListNode(&root
, NULL
))
44 IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library", 37);
47 GfxBase
= (struct GfxBase
*)OpenLibrary("graphics.library", 37);
50 PartitionBase
= (struct PartitionBase
*)OpenLibrary("partition.library", 1);
55 if (retval
!= ERR_NONE
)
58 LoadPrefs("ENV:hdtoolbox.prefs");
65 D(bug("[HDToolBox] uninitEnv()\n"));
71 CloseLibrary((struct Library
*)PartitionBase
);
73 CloseLibrary((struct Library
*)GfxBase
);
75 CloseLibrary((struct Library
*)IntuitionBase
);
82 D(bug("[HDToolBox] waitMessage()\n"));
84 while (!QuitGUI(&sigs
))
88 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
89 if (sigs
& SIGBREAKF_CTRL_C
)
91 if (sigs
& SIGBREAKF_CTRL_D
)
97 int main(int argc
, char **argv
)
102 D(bug("[HDToolBox] main()\n"));
104 InitLocale("System/Tools/HDToolBox.catalog", 2);
105 device
= argc
> 1 ? argv
[1] : NULL
;
106 if ((error
=initEnv(device
))==ERR_NONE
)
111 printf("Error %d\n", (int)error
);