00001 // main.C 00002 // 00003 // By default a user program defines starlab_main 00004 // The user could define their own main(), but they need to make sure 00005 // the user interface is added in a consistent fashion 00006 // 00007 00008 #include "program.h" 00009 00010 Program p; // define the Program! 00011 00012 extern void starlab_main(void); // to be defined by user 00013 00014 int main(int argc, char **argv) // entry point for C++ 00015 { 00016 p.init(argc,argv); // save the CLI of your program 00017 p.parse(); // parse the UI 00018 if (p.go()) starlab_main(); // if ok to go, call your 'main' 00019 p.fini(); // cleanup and report trouble 00020 return 0; // always return ok 00021 }