#ifndef __MAIN_H__ #define __MAIN_H__ #include "gettext.h" #include "Exceptions.h" extern char ** environ; class Main : public Base { public: Main(); virtual ~Main(); virtual int startup() throw (GeneralException) = 0; static int truemain(Main *, int, char **, char **); protected: int argc; char ** argv; char ** enve; bool setted; private: void set_args(int, char **, char **); }; #define CODE_BEGINS class Appli : public Main { #define CODE_ENDS }; \ int main(int argc, char ** argv) { \ int r; \ setlocale(LC_ALL, ""); \ Appli * Application = new Appli(); \ r = Main::truemain(Application, argc, argv, environ); \ delete Application; \ return r; \ } #endif