Mercurial > hg > Game > Cerium
comparison TaskManager/kernel/main.cc @ 216:e9a52d68db42 draft
rename cerium_main to TMmain, add TMend()
author | gongo@localhost.localdomain |
---|---|
date | Wed, 04 Feb 2009 22:44:16 +0900 |
parents | 028ffc9c0375 |
children | 23e76c5369b7 1e697b4b7e1f |
comparison
equal
deleted
inserted
replaced
214:cd3fda5a24ae | 216:e9a52d68db42 |
---|---|
1 #include <stdlib.h> | 1 #include <stdlib.h> |
2 #include <string.h> | 2 #include <string.h> |
3 #include <SDL.h> | 3 #include <SDL.h> |
4 #include "TaskManager.h" | 4 #include "TaskManager.h" |
5 | 5 |
6 /* for user main function */ | 6 /* User main function */ |
7 extern int cerium_main(int argc, char *argv[]); | 7 extern int TMmain(int argc, char *argv[]); |
8 | |
9 /* Default TMend function */ | |
10 static void | |
11 defaultTMend(void) {} | |
8 | 12 |
9 TaskManager *manager; | 13 TaskManager *manager; |
10 static char *help_str = "\n\ | 14 static char *help_str = "\n\ |
11 * Cerium program option *\n\ | 15 * Cerium program option *\n\ |
12 -chelp Print this message \n\ | 16 -chelp Print this message \n\ |
28 } | 32 } |
29 | 33 |
30 manager = new TaskManager(cpuNum); | 34 manager = new TaskManager(cpuNum); |
31 manager->init(); | 35 manager->init(); |
32 | 36 |
33 if (cerium_main(argc, argv) < 0) { | 37 manager->set_TMend(defaultTMend); |
38 | |
39 if (TMmain(argc, argv) < 0) { | |
34 goto FINISH; | 40 goto FINISH; |
35 } | 41 } |
36 | 42 |
37 manager->run(); | 43 manager->run(); |
44 | |
45 (manager->tm_end)(); | |
38 | 46 |
39 FINISH: | 47 FINISH: |
40 delete manager; | 48 delete manager; |
41 | 49 |
42 return EXIT_SUCCESS; | 50 return EXIT_SUCCESS; |