/*
* $Log$
+ * Revision 1.16 2008/02/27 09:42:21 james
+ * *** empty log message ***
+ *
* Revision 1.15 2008/02/27 01:31:38 james
* *** empty log message ***
*
void
mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
- ANSI * ansi, Log * log, int nhistory, int width)
+ ANSI * ansi, Log * log, int nhistory, CRT_Pos *size )
{
fd_set rfds, wfds;
Context c = { 0 };
c.tp = tty_parser_new ();
c.u = utf8_new ();
- c.v = vt102_new (width);
+ c.v = vt102_new (size);
c.h = history_new (nhistory);
c.l = log;
/* are we being fed by a tty or a socket */
/*
* $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 ***
*
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__ */
/*
* $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 ***
*
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];
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 ();
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'])
/*
* $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 ***
*
" -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"
/*
* $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 ***
*
}
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))
{
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);
{
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)
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);
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);
/*
* $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 ***
*
}
TTY *
-ptty_open (char *path, char *argv[], CRT_Pos * size)
+ptty_open (char *path, char *argv[], CRT_Pos *size)
{
PTTY *t;
pid_t child;
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);
/*
* $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 ***
*
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);
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--;
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--;
}
VT102 *
-vt102_new (CRT_Pos * size)
+vt102_new (CRT_Pos *size)
{
VT102 *v;
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);
6488eda7d5c4d46ce3f587f5dc745dfa 1.0.1
ca1ac5a7fc122af620b0cf7296c324c3 1.0.2
-ac9d93b50970b366e4531b4ea5a1c983 1.0.3
-ac9d93b50970b366e4531b4ea5a1c986 1.1.0
-0ea0fc96142920321bfa5354dc6b9daa 1.1.1
+ac9d93b50970b366e4531b4ea5a1c986 1.0.3