aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames <>2008-02-27 09:43:27 +0000
committerjames <>2008-02-27 09:43:27 +0000
commit5fd44c11631c66cff497fadd9bbc81b77c7509f7 (patch)
tree8af379c5d2c769d9a2c20f0d372e9059e1a44192
parentd6c2a27d3304842fab285a4217518046b57b771b (diff)
downloadsympathy-5fd44c11631c66cff497fadd9bbc81b77c7509f7.tar.gz
sympathy-5fd44c11631c66cff497fadd9bbc81b77c7509f7.tar.bz2
sympathy-5fd44c11631c66cff497fadd9bbc81b77c7509f7.zip
*** empty log message ***
-rw-r--r--apps/mainloop.c5
-rw-r--r--apps/mainloop.h5
-rw-r--r--apps/sympathy.c41
-rw-r--r--apps/usage.c7
-rw-r--r--src/ansi.c15
-rw-r--r--src/ptty.c7
-rw-r--r--src/vt102.c50
-rw-r--r--src/vt102.h6
-rw-r--r--test/test.c53
-rw-r--r--version-md5sums1
10 files changed, 92 insertions, 98 deletions
diff --git a/apps/mainloop.c b/apps/mainloop.c
index 146ebdd..e9c299c 100644
--- a/apps/mainloop.c
+++ b/apps/mainloop.c
@@ -11,6 +11,9 @@ static char rcsid[] =
/*
* $Log$
+ * Revision 1.17 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.16 2008/02/27 09:42:21 james
* *** empty log message ***
*
@@ -400,7 +403,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, CRT_Pos *size )
+ ANSI * ansi, Log * log, int nhistory, CRT_Pos * size)
{
fd_set rfds, wfds;
Context c = { 0 };
diff --git a/apps/mainloop.h b/apps/mainloop.h
index cea139e..df32f25 100644
--- a/apps/mainloop.h
+++ b/apps/mainloop.h
@@ -12,6 +12,9 @@
/*
* $Log$
+ * Revision 1.5 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.4 2008/02/27 09:42:21 james
* *** empty log message ***
*
@@ -33,6 +36,6 @@
extern void
mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, ANSI * a,
- Log * log, int nhistory, CRT_Pos *size);
+ Log * log, int nhistory, CRT_Pos * size);
#endif /* __MAINLOOP_H__ */
diff --git a/apps/sympathy.c b/apps/sympathy.c
index e93c930..29c3280 100644
--- a/apps/sympathy.c
+++ b/apps/sympathy.c
@@ -11,6 +11,9 @@ static char rcsid[] =
/*
* $Log$
+ * Revision 1.18 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.17 2008/02/27 09:42:21 james
* *** empty log message ***
*
@@ -248,7 +251,7 @@ main (int argc, char *argv[])
int c;
extern char *optarg;
extern int optind, opterr, optopt;
- CRT_Pos size={VT102_COLS_80,VT102_ROWS};
+ CRT_Pos size = { VT102_COLS_80, VT102_ROWS };
int oflags[128];
char *oargs[128];
@@ -316,13 +319,15 @@ main (int argc, char *argv[])
sum += oflags['v'];
if (sum != 1)
- fatal_moan ("specifiy exactly one of ( -c and or -s ), -t, -r, -l and -v");
+ fatal_moan
+ ("specifiy exactly one of ( -c and or -s ), -t, -r, -l and -v");
}
- if (oflags['v']) {
- fprintf("Version: %s\n",libsympathy_version());
- return 0;
- }
+ if (oflags['v'])
+ {
+ fprintf ("Version: %s\n", libsympathy_version ());
+ return 0;
+ }
if (oflags['l'])
return list_sockets ();
@@ -428,22 +433,24 @@ main (int argc, char *argv[])
if (oflags['w'])
{
- char buf[128],*ptr;
- strcpy(buf,oargs['w']);
- ptr=index(buf,'x');
- if (ptr) {
- *ptr=0;
- ptr++;
- size.y=safe_atoi(ptr);
- }
- size.x=safe_atoi(buf);
+ char buf[128], *ptr;
+ strcpy (buf, oargs['w']);
+ ptr = index (buf, 'x');
+ if (ptr)
+ {
+ *ptr = 0;
+ ptr++;
+ size.y = safe_atoi (ptr);
+ }
+ size.x = safe_atoi (buf);
if ((size.x > VT102_MAX_COLS) || (size.x < 1))
fatal_moan ("-w requires a width between 1 and %d\n", VT102_MAX_COLS);
if ((size.y > VT102_ROWS) || (size.y < 1))
- fatal_moan ("-w requires a height between 1 and %d\n", VT102_MAX_COLS);
-
+ fatal_moan ("-w requires a height between 1 and %d\n",
+ VT102_MAX_COLS);
+
}
if (oflags['s'] && !oflags['F'])
diff --git a/apps/usage.c b/apps/usage.c
index 598ccb7..d86294e 100644
--- a/apps/usage.c
+++ b/apps/usage.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.13 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.12 2008/02/27 09:42:21 james
* *** empty log message ***
*
@@ -79,8 +82,8 @@ usage (void)
" -r id client mode: connect to server mode process on socket\n"
" ~/.sympathy/id\n"
" -l or -ls list active sockets in ~/.sympathy\n"
- " -v show version\n"
- " -h show help\n"
+ " -v show version\n"
+ " -h show help\n"
"\n"
"Options:\n"
" -K lock the serial device. By default sympathy checks that no\n"
diff --git a/src/ansi.c b/src/ansi.c
index 42f6a4c..408efd4 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.34 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.33 2008/02/27 09:42:21 james
* *** empty log message ***
*
@@ -525,10 +528,10 @@ ansi_draw_line (ANSI * a, CRT_CA * cap, int y)
}
static void
-ansi_resize_check (ANSI * a, CRT_Pos *size)
+ansi_resize_check (ANSI * a, CRT_Pos * size)
{
- if ((size && crt_pos_cmp(a->crt.size,*size))
+ if ((size && crt_pos_cmp (a->crt.size, *size))
|| crt_pos_cmp (a->terminal->size, a->size))
{
@@ -542,7 +545,7 @@ ansi_resize_check (ANSI * a, CRT_Pos *size)
crt_reset (&a->crt);
if (size)
- a->crt.size =*size;
+ a->crt.size = *size;
// FIXME: -- echos back crap?
// a->terminal->xmit (a->terminal, "\033[c", 3);
@@ -574,7 +577,7 @@ ansi_history (ANSI * a, History * h)
{
char buf[32];
int i;
- int guess_scroll;
+ int guess_scroll;
/*Do we need to catch up on history?*/
if (a->history_ptr == h->wptr)
@@ -584,7 +587,7 @@ ansi_history (ANSI * a, History * h)
if ((a->size.x < a->crt.size.x) || (a->size.y < a->crt.size.y))
return;
- guess_scroll=a->crt.size.y-1; /*Bototm line should be a status line*/
+ guess_scroll = a->crt.size.y - 1; /*Bototm line should be a status line */
ansi_force_attr_normal (a);
@@ -716,7 +719,7 @@ ansi_reset (ANSI * a, CRT * c)
static void
ansi_terminal_reset (ANSI * a)
{
- CRT_Pos p = { 0, a->crt.size.y};
+ CRT_Pos p = { 0, a->crt.size.y };
ansi_force_attr_normal (a);
ansi_move (a, p);
diff --git a/src/ptty.c b/src/ptty.c
index fba3202..3be35f2 100644
--- a/src/ptty.c
+++ b/src/ptty.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.15 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.14 2008/02/27 09:42:22 james
* *** empty log message ***
*
@@ -146,7 +149,7 @@ ptty_write (TTY * _t, void *buf, int len)
}
TTY *
-ptty_open (char *path, char *argv[], CRT_Pos *size)
+ptty_open (char *path, char *argv[], CRT_Pos * size)
{
PTTY *t;
pid_t child;
@@ -158,7 +161,7 @@ ptty_open (char *path, char *argv[], CRT_Pos *size)
client_termios (&ctermios);
- winsize.ws_row = size ? size->y :VT102_ROWS;
+ winsize.ws_row = size ? size->y : VT102_ROWS;
winsize.ws_col = size ? size->x : VT102_COLS_80;
child = forkpty (&fd, name, &ctermios, &winsize);
diff --git a/src/vt102.c b/src/vt102.c
index 1940dcf..2132f83 100644
--- a/src/vt102.c
+++ b/src/vt102.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.48 2008/02/27 09:42:53 james
+ * *** empty log message ***
+ *
* Revision 1.47 2008/02/27 09:42:22 james
* *** empty log message ***
*
@@ -743,10 +746,10 @@ vt102_change_mode (VT102 * v, int private, char *ns, int set)
VT102_COLS_80;
v->crt.size = v->current_size;
- v->crt.size.y++;
- v->screen_end=v->current_size;
- v->screen_end.x--;
- v->screen_end.y--;
+ v->crt.size.y++;
+ v->screen_end = v->current_size;
+ v->screen_end.x--;
+ v->screen_end.y--;
v->top_margin = v->screen_start;
v->bottom_margin = v->screen_end;
vt102_cursor_home (v);
@@ -1595,9 +1598,9 @@ vt102_reset_state (VT102 * v)
v->application_keypad_mode = 0;
- v->current_size=v->original_size;
+ v->current_size = v->original_size;
v->crt.size = v->current_size;
- v->crt.size.y++;
+ v->crt.size.y++;
v->screen_end = v->current_size;
v->screen_end.x--;
v->screen_end.y--;
@@ -2014,10 +2017,10 @@ vt102_reset (VT102 * v)
v->screen_start.x = 0;
v->screen_start.y = 0;
- v->current_size=v->original_size;
- v->crt.size=v->current_size;
- v->crt.size.y++;
- v->screen_end=v->current_size;
+ v->current_size = v->original_size;
+ v->crt.size = v->current_size;
+ v->crt.size.y++;
+ v->screen_end = v->current_size;
v->screen_end.x--;
v->screen_end.y--;
@@ -2036,7 +2039,7 @@ vt102_reset (VT102 * v)
}
VT102 *
-vt102_new (CRT_Pos *size)
+vt102_new (CRT_Pos * size)
{
VT102 *v;
@@ -2044,19 +2047,26 @@ vt102_new (CRT_Pos *size)
v->xn_glitch = 1;
-
- if (size) {
+
+ if (size)
+ {
v->original_size = *size;
- if (v->original_size.x<1) v->original_size.x=1;
- if (v->original_size.y<1) v->original_size.y=1;
+ if (v->original_size.x < 1)
+ v->original_size.x = 1;
+ if (v->original_size.y < 1)
+ v->original_size.y = 1;
- if (v->original_size.x>VT102_MAX_COLS) v->original_size.x=VT102_MAX_COLS;
- if (v->original_size.y>VT102_ROWS) v->original_size.y=VT102_ROWS;
+ if (v->original_size.x > VT102_MAX_COLS)
+ v->original_size.x = VT102_MAX_COLS;
+ if (v->original_size.y > VT102_ROWS)
+ v->original_size.y = VT102_ROWS;
- } else {
- v->original_size.x=VT102_COLS_80;
- v->original_size.y=VT102_ROWS;
+ }
+ else
+ {
+ v->original_size.x = VT102_COLS_80;
+ v->original_size.y = VT102_ROWS;
}
vt102_reset (v);
diff --git a/src/vt102.h b/src/vt102.h
index 7be7d05..e09fbf6 100644
--- a/src/vt102.h
+++ b/src/vt102.h
@@ -12,6 +12,9 @@
/*
* $Log$
+ * Revision 1.20 2008/02/27 09:42:22 james
+ * *** empty log message ***
+ *
* Revision 1.19 2008/02/26 23:23:17 james
* *** empty log message ***
*
@@ -129,7 +132,8 @@ typedef struct
int last_reg_char;
int xn_glitch;
- int current_width;
+ CRT_Pos current_size;
+ CRT_Pos original_size;
int g[2];
int cs;
diff --git a/test/test.c b/test/test.c
index 597a61e..fb77478 100644
--- a/test/test.c
+++ b/test/test.c
@@ -6,11 +6,13 @@
*
*/
-static char rcsid[] =
- "$Id$";
+static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.8 2008/02/27 09:42:22 james
+ * *** empty log message ***
+ *
* Revision 1.7 2008/02/20 20:16:07 james
* *** empty log message ***
*
@@ -49,50 +51,5 @@ static char rcsid[] =
int
main (int argc, char *argv[])
{
-#if 0
- fd_set rfds, wfds;
- ANSI a = { 0 };
- Context c;
-
-
- c.t = ptty_open (NULL, NULL);
- c.v = vt102_new ();
- c.h = history_new (200);
- c.l = file_log_new ("log");
- c.k = keydis_vt102_new ();
-
- terminal_register_handlers ();
- a.terminal = terminal_open (0, 1);
-
- ansi_reset (&a, NULL);
-
- for (;;)
- {
- struct timeval tv = { 10, 0 };
-
- FD_ZERO (&rfds);
- FD_ZERO (&wfds);
-
- tty_pre_select (c.t, &rfds, &wfds);
- tty_pre_select (a.terminal, &rfds, &wfds);
-
-
- select (FD_SETSIZE, &rfds, &wfds, NULL, &tv);
-
- if (FD_ISSET (c.t->rfd, &rfds))
- {
- if (vt102_dispatch(&c)) break;
- }
-
- ansi_dispatch (&a, &c);
- ansi_update (&a, &c);
-
-
- }
-
- ansi_terminal_reset (&a);
- terminal_atexit ();
- printf ("QUAT\n");
-#endif
-return 0;
+ return 0;
}
diff --git a/version-md5sums b/version-md5sums
index 6259056..8625f8b 100644
--- a/version-md5sums
+++ b/version-md5sums
@@ -1,2 +1,3 @@
6488eda7d5c4d46ce3f587f5dc745dfa 1.0.1
ca1ac5a7fc122af620b0cf7296c324c3 1.0.2
+ac9d93b50970b366e4531b4ea5a1c986 1.0.3