#include #include #include "slc.hh" #include "options.hh" #include "screen.hh" #include "history.hh" #include "error.hh" #include "connection.hh" Screen S; Options O; History H; Connection C; void main2(); /*! ** Program entry point ** ** @param argc arg count ** @param argv arg vector ** ** @return program err code */ int main(int argc, char *argv[]) { pthread_t t; try { // get argvline options O.load(argc, argv); // get environment options O.loadenv(); // load cmd history H.load(O.history_file); // Create graphic env S.init(); // Showing login screen. Retrieve user/pass. S.login(); // Showing dialog screen S.dialog(); // start connexion C.start(); // Start reader thread pthread_create(&t, 0, (void *(*)(void *)) main2, 0); // Treat keyboards events S.eventsloop(); // Save history H.save(O.history_file); } catch (const Error &e) { endwin(); e.print(); _exit(e.code()); } return 0; } /*! ** Entry point of the second thread which is used to ** print data sent by server */ void main2() { S.socket_reader(); }