Mercurial > hg > Game > Cerium
view TaskManager/kernel/main.cc @ 109:028ffc9c0375 draft
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | |
children | e9a52d68db42 |
line wrap: on
line source
#include <stdlib.h> #include <string.h> #include <SDL.h> #include "TaskManager.h" /* for user main function */ extern int cerium_main(int argc, char *argv[]); TaskManager *manager; static char *help_str = "\n\ * Cerium program option *\n\ -chelp Print this message \n\ -cpu Number of CPU (default 1) \n"; int main(int argc, char *argv[]) { int cpuNum = 1; for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-cpu") == 0) { cpuNum = atoi(argv[++i]); } if (strcmp(argv[i], "-chelp") == 0) { printf("%s\n", help_str); return EXIT_SUCCESS; } } manager = new TaskManager(cpuNum); manager->init(); if (cerium_main(argc, argv) < 0) { goto FINISH; } manager->run(); FINISH: delete manager; return EXIT_SUCCESS; }