From 4add819b42c292ee2a6fc4aeda782a447b1bcf27 Mon Sep 17 00:00:00 2001 From: james <> Date: Wed, 27 Feb 2008 01:31:14 +0000 Subject: *** empty log message *** --- apps/mainloop.c | 7 +++++-- apps/mainloop.h | 5 ++++- apps/sympathy.c | 27 +++++++++++++++------------ apps/usage.c | 15 ++++++++++----- 4 files changed, 34 insertions(+), 20 deletions(-) (limited to 'apps') diff --git a/apps/mainloop.c b/apps/mainloop.c index 3f1c28d..07290e1 100644 --- a/apps/mainloop.c +++ b/apps/mainloop.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.14 2008/02/27 01:31:14 james + * *** empty log message *** + * * Revision 1.13 2008/02/26 23:56:12 james * *** empty log message *** * @@ -391,7 +394,7 @@ msg_from_server (ANSI * a, IPC_Msg * m, Context * c) void mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, - ANSI * ansi, Log * log, int nhistory) + ANSI * ansi, Log * log, int nhistory,int width) { fd_set rfds, wfds; Context c = { 0 }; @@ -402,7 +405,7 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, c.tp = tty_parser_new (); c.u = utf8_new (); - c.v = vt102_new (); + c.v = vt102_new (width); c.h = history_new (nhistory); c.l = log; /* are we being fed by a tty or a socket */ diff --git a/apps/mainloop.h b/apps/mainloop.h index 3bbd960..5d347e7 100644 --- a/apps/mainloop.h +++ b/apps/mainloop.h @@ -12,6 +12,9 @@ /* * $Log$ + * Revision 1.3 2008/02/27 01:31:14 james + * *** empty log message *** + * * Revision 1.2 2008/02/20 18:49:11 staffcvs * *** empty log message *** * @@ -27,6 +30,6 @@ extern void mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, ANSI * a, - Log * log, int nhistory); + Log * log, int nhistory, int width); #endif /* __MAINLOOP_H__ */ diff --git a/apps/sympathy.c b/apps/sympathy.c index 13b54ef..4a9f18a 100644 --- a/apps/sympathy.c +++ b/apps/sympathy.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.15 2008/02/27 01:31:14 james + * *** empty log message *** + * * Revision 1.14 2008/02/24 00:43:55 james * *** empty log message *** * @@ -239,6 +242,7 @@ main (int argc, char *argv[]) int c; extern char *optarg; extern int optind, opterr, optopt; + int width=VT102_COLS_80; int oflags[128]; char *oargs[128]; @@ -255,16 +259,7 @@ main (int argc, char *argv[]) memset (oflags, 0, sizeof (oflags)); memset (oargs, 0, sizeof (oargs)); -#if 0 - "sympathy -t [-K] [-d serialdev|-p] [-b baud] [-f] [-L log]\n" - "sympathy -s [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-F] [-k skt]\n" - " [-n hlines]\n" - "sympathy [-s -c] [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-k skt]\n" - " [-n hlines]\n" - "sympathy -c [-H] -k skt\n" - "sympathy -r id [-H]\n" "sympathy {-l|-ls}\n" -#endif - while ((c = getopt (argc, argv, "utscr:lKHd:pb:fL:Fk:n:")) != EOF) + while ((c = getopt (argc, argv, "w:utscr:lKHd:pb:fL:Fk:n:")) != EOF) { switch (c) { @@ -397,6 +392,7 @@ main (int argc, char *argv[]) oflags['f'] = 0; oflags['L'] = 0; oflags['n'] = 0; + oflags['w'] = 0; if (server_socket) { socket_free_parent (server_socket); @@ -405,6 +401,7 @@ main (int argc, char *argv[]) } } + if (oflags['c'] && !oflags['k']) fatal_moan ("-c requires a socket to be specified with -s or -k"); @@ -418,6 +415,12 @@ main (int argc, char *argv[]) oflags['p']++; } + if (oflags['w']) { + width=safe_atoi(oargs['w']); + if ((width>VT102_MAX_COLS) || (width<1)) + fatal_moan("-w requires a width between 1 and %d\n",VT102_MAX_COLS); + } + if (oflags['s'] && !oflags['F']) { daemon (1, 0); /*incase socket is relative path, unlink then will fail */ @@ -436,7 +439,7 @@ main (int argc, char *argv[]) if (oflags['p']) { - tty = ptty_open (NULL, NULL); + tty = ptty_open (NULL, NULL, width); if (!tty) fatal_moan ("unable to open a ptty"); } @@ -493,7 +496,7 @@ main (int argc, char *argv[]) } } - mainloop (tty, server_socket, client_socket, ansi, log, history); + mainloop (tty, server_socket, client_socket, ansi, log, history,width); if (ansi) { diff --git a/apps/usage.c b/apps/usage.c index 07da7fa..62061fd 100644 --- a/apps/usage.c +++ b/apps/usage.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.10 2008/02/27 01:31:14 james + * *** empty log message *** + * * Revision 1.9 2008/02/24 00:43:55 james * *** empty log message *** * @@ -48,10 +51,10 @@ usage (void) fprintf (stderr, "Usage:\n" "sympathy -t [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-u]\n" - "sympathy -s [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-u] [-F]\n" - " [-k skt] [-n hlines]\n" + "sympathy -s [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-u] [-k skt]\n" + " [-n hlines] [-w width] [-F]\n" "sympathy [-s -c] [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-u] [-k skt]\n" - " [-n hlines]\n" + " [-n hlines] [-w width]\n" "sympathy -c [-H] [-u] -k skt\n" "sympathy -r id [-H] [-u]\n" "sympathy {-l|-ls}\n" @@ -89,10 +92,12 @@ usage (void) " -F do not detach, run the server in the foreground\n" " -H instead of connecting the user's terminal to the session\n" " emit HTML of the current state of the screen on stdout\n" - " -L log activity on the device to the file log\n" + " -L log log activity on the device to the file log\n" " -n hlines the number of lines of history to store in the\n" " server, that are replayed on connexion\n" - " -u don't emit utf-8 instead map all non ascii characters as ?\n"); + " -u don't emit utf-8 try to use ISO-2202 to the local terminal\n" + " -w width start session with a screen of width width<=132\n" + ); exit (1); -- cgit v1.2.3