Newer
Older
#include <getopt.h>
#include "slc.hh"
#include "options.hh"
/*!
** Program entry point
**
** @param argc arg count
** @param argv arg vector
**
** @return program err code
*/
int main(int argc, char *argv[])
{
try {
// get argvline options
O.load(argc, argv);
// get environment options
O.loadenv();
// load cmd history
H.load(O.history_file);
C.start();
// Treat keyboards events
S.eventsloop();
// Save history
H.save(O.history_file);
}
catch (const Error &e) {
endwin();
e.print();
_exit(e.code());
}
/*!
** Entry point of the second thread which is used to
** print data sent by server
*/
void *thread_reader(void *) {
while (C.connected())
S << "<< " << C.recvln() << "\n";
pthread_exit(0);
return 0;