2 Copyright © 2009, The AROS Development Team. All rights reserved.
5 Desc: autoinit library - handle program started from workbench.
8 #include <dos/dosextens.h>
9 #include <aros/startup.h>
10 #include <aros/symbolsets.h>
13 #include <aros/debug.h>
15 struct WBStartup
*WBenchMsg
;
17 int __nowbsupport
__attribute__((weak
)) = 0;
19 static void __startup_fromwb(void)
21 struct Process
*myproc
;
23 D(bug("Entering __startup_fromwb()\n"));
25 myproc
= (struct Process
*)FindTask(NULL
);
27 /* Do we have a CLI structure? */
30 /* Workbench startup. Get WBenchMsg and pass it to main() */
32 WaitPort(&myproc
->pr_MsgPort
);
33 WBenchMsg
= (struct WBStartup
*)GetMsg(&myproc
->pr_MsgPort
);
34 __argv
= (char **) WBenchMsg
;
37 D(bug("[startup] Started from Workbench\n"));
40 __startup_entries_next();
42 /* Reply startup message to Workbench */
45 Forbid(); /* make sure we're not UnLoadseg()ed before we're really done */
46 ReplyMsg((struct Message
*) WBenchMsg
);
49 D(bug("Leaving __startup_fromwb\n"));
52 ADD2SET(__startup_fromwb
, program_entries
, -50);