X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=apps%2Fsympathy.c;h=4ea7bf00e730fd8a81ceda048e4d259295418eae;hb=3422c467b484c200c8486da77678a7f4f58d4d0f;hp=29cf0ace8f1c5fffb29405b44020d99a069b554e;hpb=590e9b4596f1caddf7c87dd767f4f57c6385c90b;p=sympathy.git diff --git a/apps/sympathy.c b/apps/sympathy.c index 29cf0ac..4ea7bf0 100644 --- a/apps/sympathy.c +++ b/apps/sympathy.c @@ -10,6 +10,18 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.11 2008/02/20 20:16:07 james + * *** empty log message *** + * + * Revision 1.10 2008/02/20 19:44:37 james + * @@ + * + * Revision 1.9 2008/02/20 18:49:11 staffcvs + * *** empty log message *** + * + * Revision 1.8 2008/02/20 18:33:37 james + * *** empty log message *** + * * Revision 1.7 2008/02/20 18:31:44 james * *** empty log message *** * @@ -40,6 +52,9 @@ static char rcsid[] = "$Id$"; #include #include #include +#include +#include +#include #include "mainloop.h" @@ -303,11 +318,11 @@ main (int argc, char *argv[]) if (oflags['n']) { - nhistory = safe_atoi (oargs['n']); - if (nhistory < 0) + history = safe_atoi (oargs['n']); + if (history < 0) fatal_moan ("cannot parse -n %s as an integer", oargs['n']); - if (!nhistory) + if (!history) fatal_moan ("agrument to -n must be greater than zero"); } @@ -393,6 +408,11 @@ main (int argc, char *argv[]) oflags['p']++; } + if (oflags['s'] && !oflags['F']) + { + daemon (1, 0); /*incase socket is relative path, unlink then will fail */ + } + if (oflags['s'] || oflags['t']) { @@ -445,34 +465,27 @@ main (int argc, char *argv[]) } - if (oflags['s'] && !oflags['F']) - { - daemon (1, 0); /*incase socket is relative path, unlink then will fail */ - } if (oflags['c'] || oflags['t']) { if (oflags['H']) { - fatal_moan ("fix a bug in HTML dispatcher before this works"); + ansi=ansi_new_html(stdout); } else { - ansi = (ANSI *) malloc (sizeof (ANSI)); - memset (ansi, 0, sizeof (ANSI)); - terminal_register_handlers (); - ansi->terminal = terminal_open (0, 1); - ansi_reset (ansi, NULL); + ansi=ansi_new_from_terminal(terminal_open(0,1)); + ansi->reset(ansi, NULL); } } - mainloop (tty, server_socket, client_socket, ansi, log, nhistory); + mainloop (tty, server_socket, client_socket, ansi, log, history); if (ansi) { - ansi_terminal_reset (ansi); + ansi->close(ansi); terminal_atexit (); } @@ -486,6 +499,7 @@ main (int argc, char *argv[]) if (client_socket) socket_free (client_socket); + if (!oflags['H']) printf ("you have now exited sympathy\n"); return 0; }