Newer
Older
SLC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
SLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLC; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "sll/connection.hh"
#include "engine.hh"
#include <getopt.h>
/*!
** 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);
// 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;