chiark / gitweb /
*** empty log message ***
authorjames <james>
Thu, 28 Feb 2008 16:57:51 +0000 (16:57 +0000)
committerjames <james>
Thu, 28 Feb 2008 16:57:51 +0000 (16:57 +0000)
20 files changed:
apps/clients.c
apps/mainloop.c
apps/sympathy.c
apps/usage.c
src/ansi.c
src/cmd.c
src/crt.h
src/ipc.c
src/keydis.c
src/prototypes.h
src/ptty.c
src/serial.c
src/terminal.c
src/tty.c
src/tty.h
src/vt102.c
src/vt102.h
version-md5sums
version-micro
version-stamps

index a4b5fce562f25ce2dd434563eeab0d3f5cd74e9c..d5bd256cb7b4846bf9d31d7bee348aad1072bbec 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.14  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.13  2008/02/28 16:37:16  james
  * *** empty log message ***
  *
@@ -92,10 +95,10 @@ client_msg (IPC_Msg * m, Context * c)
       tty_hangup (c->t);
       break;
     case IPC_MSG_TYPE_SETSIZE:
-      vt102_resize(c,m->setsize.winsize);
+      vt102_resize (c, m->setsize.winsize);
       break;
     case IPC_MSG_TYPE_RESET:
-      vt102_reset(c);
+      vt102_reset (c);
       break;
     default:
       fprintf (stderr, "Unhandeled message type %d\n", m->hdr.type);
index 7c648f3d478ba6e05c9d24f282ac24f9e5a67093..9737bd29439f545c8a3ebc162708715bf74615a0 100644 (file)
@@ -11,6 +11,9 @@ static char rcsid[] =
 
 /*
  * $Log$
+ * Revision 1.20  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.19  2008/02/28 16:37:16  james
  * *** empty log message ***
  *
@@ -449,7 +452,7 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
     }
 
 
-   vt102_reset(&c);
+  vt102_reset (&c);
 
 
   if (server_socket)
index 91f6c0c789e809712d8f48e2194389c9dfdbf16a..b5bf326f1395e46d4e17502153690afa49a4393b 100644 (file)
@@ -11,6 +11,9 @@ static char rcsid[] =
 
 /*
  * $Log$
+ * Revision 1.23  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.22  2008/02/28 01:47:44  james
  * *** empty log message ***
  *
@@ -264,7 +267,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_24 };
 
   int oflags[128];
   char *oargs[128];
@@ -322,13 +325,14 @@ main (int argc, char *argv[])
     sum += oflags['l'];
     sum += oflags['v'];
 
-    if (!sum) {
-      /*If no mode is specified behave like screen */
-      oflags['s']++;
-      oflags['c']++;
-      sum++;
-    }
-       
+    if (!sum)
+      {
+        /*If no mode is specified behave like screen */
+        oflags['s']++;
+        oflags['c']++;
+        sum++;
+      }
+
     if (sum != 1)
       fatal_moan
         ("specifiy exactly one of ( -c and or -s ), -t, -r, -l and -v");
@@ -367,11 +371,14 @@ main (int argc, char *argv[])
         fatal_moan ("cannot parse -r %s as an integer", oargs['r']);
 
       oflags['k']++;
-      if (safe_atoi(id)>0) {
-       oargs['k'] = mome ("/.sympathy/%s%d", hostname, safe_atoi(id));
-      } else {
-       oargs['k'] = mome ("/.sympathy/%s", id);
-      }
+      if (safe_atoi (id) > 0)
+        {
+          oargs['k'] = mome ("/.sympathy/%s%d", hostname, safe_atoi (id));
+        }
+      else
+        {
+          oargs['k'] = mome ("/.sympathy/%s", id);
+        }
       oflags['r'] = 0;
       oflags['c']++;
     }
@@ -463,7 +470,7 @@ main (int argc, char *argv[])
       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))
+      if ((size.y > VT102_MAX_ROWS) || (size.y < 1))
         fatal_moan ("-w requires a height between 1 and %d\n",
                     VT102_MAX_COLS);
 
@@ -493,30 +500,31 @@ main (int argc, char *argv[])
         }
       else
         {
-        /*HACK-- check that console=device does not occur in */
-        /*/proc/cmdline*/
-        if (!oargs['d']) 
-               fatal_moan("no argument to -d");
-               
-         {
-        char kernel_cmdline[4096]={0};
-        char search_string[1024]="console=";
-        char *ptr=oargs['d'];
-        int fd;
-
-        if (!strncmp("/dev/",ptr,5)) ptr+=5; 
-
-       strcat(search_string,ptr);
-
-       fd=open("/proc/cmdline",O_RDONLY);
-       read(fd,kernel_cmdline,sizeof(kernel_cmdline));
-       close(fd);
-
-       kernel_cmdline[sizeof(kernel_cmdline)-1]=0;
-
-       if (strstr(kernel_cmdline,search_string))
-               fatal_moan("/proc/cmdline contains %s",search_string);
-        } 
+          /*HACK-- check that console=device does not occur in */
+          /*/proc/cmdline */
+          if (!oargs['d'])
+            fatal_moan ("no argument to -d");
+
+          {
+            char kernel_cmdline[4096] = { 0 };
+            char search_string[1024] = "console=";
+            char *ptr = oargs['d'];
+            int fd;
+
+            if (!strncmp ("/dev/", ptr, 5))
+              ptr += 5;
+
+            strcat (search_string, ptr);
+
+            fd = open ("/proc/cmdline", O_RDONLY);
+            read (fd, kernel_cmdline, sizeof (kernel_cmdline));
+            close (fd);
+
+            kernel_cmdline[sizeof (kernel_cmdline) - 1] = 0;
+
+            if (strstr (kernel_cmdline, search_string))
+              fatal_moan ("/proc/cmdline contains %s", search_string);
+          }
 
           tty =
             serial_open (oargs['d'],
index d76f9d9d57481f9570043032130f5484f17a04f9..307511d4863ebd41d5ce90d92adb592b5a64e748 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.17  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.16  2008/02/27 18:29:49  james
  * *** empty log message ***
  *
@@ -120,8 +123,7 @@ usage (void)
            "                 server, that are replayed on connexion\n"
            "   -u  don't emit utf-8 try to use ISO-2202 to the local terminal\n"
            "   -w W[xH]  start session with a screen of size W by H. 0<W<=132,\n"
-           "             0<H<24, default 80 by 24\n"
-           );
+           "             0<H<24, default 80 by 24\n");
 
 
   exit (1);
index 42f6a4c650476b752907670e96b36dbfcbc55c1d..4113a36b773aa8aeff72dccd8a3d9f023d970026 100644 (file)
@@ -10,6 +10,12 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.35  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
+ * 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 +531,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 +548,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 +580,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 +590,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 +722,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);
@@ -945,6 +951,7 @@ ansi_update (ANSI * a, Context * c)
 {
   ansi_history (a, c->h);
   ansi_draw (a, &c->v->crt);
+  tty_length(a->terminal,c->v->crt.size.y);
 }
 
 static void
index a2cf7cd03f2040d96473193bf99df8110e1e4f89..7e86977a7e1c7a2e2d4e96305aa8b0c44124babf 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.6  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.5  2008/02/28 15:37:06  james
  * *** empty log message ***
  *
@@ -52,12 +55,13 @@ cmd_parse (Cmd * c, Context * ctx, char *buf)
   else if (!strcmp (buf, "reset"))
     ctx->k->reset (ctx->k, ctx);
   else if (!strncmp (buf, "width", 5))
-    ctx->k->set_size (ctx->k, ctx,atoi(buf+5),0);
+    ctx->k->set_size (ctx->k, ctx, atoi (buf + 5), 0);
   else if (!strncmp (buf, "height", 6))
-    ctx->k->set_size (ctx->k, ctx,0,atoi(buf+6));
-  else return -1;
+    ctx->k->set_size (ctx->k, ctx, 0, atoi (buf + 6));
+  else
+    return -1;
 
-return 0;
+  return 0;
 
 
 }
@@ -68,7 +72,7 @@ cmd_show_status (Cmd * c, Context * ctx)
   if (!ctx->v)
     return;
 
-  if (c->error) 
+  if (c->error)
     vt102_status_line (ctx->v, "Command not recognized - press any key");
   else if (!c->active)
     vt102_status_line (ctx->v, c->csl);
@@ -81,20 +85,24 @@ int
 cmd_key (Cmd * c, Context * ctx, int key)
 {
 
-  if (c->error) {
-       c->error=0;
-       c->active=0;
-        cmd_show_status (c, ctx);
-       return 0;
-  }
+  if (c->error)
+    {
+      c->error = 0;
+      c->active = 0;
+      cmd_show_status (c, ctx);
+      return 0;
+    }
 
   if (key == 13)
     {
-      if (cmd_parse (c, ctx, c->buf + 1))  {
-       c->error++;
-       } else{
-      c->active = 0;
-       }
+      if (cmd_parse (c, ctx, c->buf + 1))
+        {
+          c->error++;
+        }
+      else
+        {
+          c->active = 0;
+        }
       cmd_show_status (c, ctx);
       return 0;
     }
index bc58a5d82148eb88dd63e6649f7cb40a942cf1cb..d935255f1f47ee3b7c85bcc6100082100c08e932 100644 (file)
--- a/src/crt.h
+++ b/src/crt.h
@@ -12,6 +12,9 @@
 
 /*
  * $Log$
+ * Revision 1.14  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.13  2008/02/27 09:42:22  james
  * *** empty log message ***
  *
@@ -56,7 +59,7 @@
 #ifndef __CRT_H__
 #define __CRT_H__
 
-#define CRT_ROWS 25
+#define CRT_ROWS 60
 #define CRT_COLS 132
 
 #define CRT_CELS (CRT_ROWS*CRT_COLS)
index 480281009348db52a7007068f9b2719b6d5e4d86..720cadd087af0448517f537459a0fbe0becef4db 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.6  2008/02/28 16:57:51  james
+ * *** empty log message ***
+ *
  * Revision 1.5  2008/02/28 11:27:48  james
  * *** empty log message ***
  *
@@ -220,13 +223,13 @@ ipc_msg_send_hangup (Socket * s)
 }
 
 int
-ipc_msg_send_setsize (Socket * s,CRT_Pos size)
+ipc_msg_send_setsize (Socket * s, CRT_Pos size)
 {
   IPC_Msg_setsize m;
 
   m.size = sizeof (m);
   m.type = IPC_MSG_TYPE_SETSIZE;
-  m.winsize=size;
+  m.winsize = size;
 
   return ipc_msg_send (s, (IPC_Msg *) & m);
 }
index 3aed96e9f5c40ef90171f121e288cc2115ccb03f..c6e4db2362decb599f8d27ca939ae4301e1c8ee2 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.8  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.7  2008/02/28 16:37:16  james
  * *** empty log message ***
  *
@@ -124,14 +127,14 @@ keydis_ipc_hangup (KeyDis * _t, Context * c)
 
 
 static int
-keydis_ipc_set_size (KeyDis * _t, Context * c,int w,int h)
+keydis_ipc_set_size (KeyDis * _t, Context * c, int w, int h)
 {
-CRT_Pos p={w,h};
+  CRT_Pos p = { w, h };
 
   KeyDis_IPC *t = (KeyDis_IPC *) _t;
 
-  vt102_resize(c,p);
-  ipc_msg_send_setsize (t->s,p);
+  vt102_resize (c, p);
+  ipc_msg_send_setsize (t->s, p);
 
   return 0;
 }
@@ -142,7 +145,7 @@ keydis_ipc_reset (KeyDis * _t, Context * c)
 {
   KeyDis_IPC *t = (KeyDis_IPC *) _t;
 
-  vt102_reset(c);
+  vt102_reset (c);
   ipc_msg_send_reset (t->s);
 
   return 0;
@@ -212,12 +215,12 @@ keydis_vt102_hangup (KeyDis * _t, Context * c)
 }
 
 static int
-keydis_vt102_set_size (KeyDis * _t, Context * c,int w, int h)
+keydis_vt102_set_size (KeyDis * _t, Context * c, int w, int h)
 {
   KeyDis_VT102 *t = (KeyDis_VT102 *) _t;
-  CRT_Pos p={w,h};
-  
-  vt102_resize(c,p);
+  CRT_Pos p = { w, h };
+
+  vt102_resize (c, p);
 
   return 0;
 }
index cd4fcd0f25afb1354477cc4b7ba5f852503067a3..e96cb1bd39c95f46e3ea119bcc6138da7f26ea46 100644 (file)
@@ -17,6 +17,7 @@ extern char *libsympathy_version(void);
 /* vt102.c */
 extern int vt102_cmd_length[128];
 extern int vt102_cmd_termination[128];
+extern void vt102_crt_update(Context *c);
 extern void vt102_do_resize(Context *c);
 extern void vt102_log_line(Context *c, int line);
 extern void vt102_history(Context *c, CRT_Pos t, CRT_Pos b);
@@ -174,9 +175,9 @@ extern UTF8 *utf8_new(void);
 extern int utf8_encode(char *ptr, int ch);
 extern void utf8_emit(TTY *t, int ch);
 /* vt102_charset.c */
-extern uint32_t vt102_charset_c0[VT102_CHARSET_SIZE];
-extern uint32_t vt102_charset_us[VT102_CHARSET_SIZE];
-extern uint32_t vt102_charset_uk[VT102_CHARSET_SIZE];
-extern uint32_t vt102_charset_vt52[VT102_CHARSET_SIZE];
-extern uint32_t vt102_charset_gl[VT102_CHARSET_SIZE];
+extern uint32_t vt102_charset_c0[128];
+extern uint32_t vt102_charset_us[128];
+extern uint32_t vt102_charset_uk[128];
+extern uint32_t vt102_charset_vt52[128];
+extern uint32_t vt102_charset_gl[128];
 extern uint32_t *charset_from_csid[];
index fba32022ae909916611fd0a6659f81bf5999eb00..f8b6b9fced7c8467d1643399a257c789ff779022 100644 (file)
@@ -10,6 +10,12 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.16  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
+ * 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 +152,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 +164,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_24;
   winsize.ws_col = size ? size->x : VT102_COLS_80;
 
   child = forkpty (&fd, name, &ctermios, &winsize);
index fe0859445267bcbcdc5b05ab743bad738aec79bc..e269c83b8e44073c641127d5b007f5fc2ce96fe1 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.12  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.11  2008/02/26 23:23:17  james
  * *** empty log message ***
  *
@@ -208,7 +211,7 @@ serial_open (char *path, int lock_mode)
   t->rfd = t->fd;
   t->wfd = t->fd;
   t->size.x = VT102_COLS_80;
-  t->size.y = VT102_ROWS;
+  t->size.y = VT102_ROWS_24;
   t->blocked = serial_lock_check (t->lock);
   t->hanging_up = 0;
 
index 72a7764d3b80163a706ce7d9b65c5c855ce1fa13..a3be09bc62f1b835a7457d1ade6aeade8933dbab 100644 (file)
@@ -11,6 +11,9 @@ static char rcsid[] =
 
 /*
  * $Log$
+ * Revision 1.12  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.11  2008/02/26 23:56:12  james
  * *** empty log message ***
  *
@@ -110,7 +113,7 @@ terminal_close (TTY * _t)
   t->xmit (_t, "\017", 1);      //Select G0
   t->xmit (_t, "\033[r", 3);    //No margins
   t->xmit (_t, "\033[0m", 4);   //Default attributes
-  i = sprintf (buf, "\033[%d;%dH", CRT_ROWS + 1, 1); //Cursor to bottom
+  i = sprintf (buf, "\033[%d;%dH", t->displayed_length ?(t->displayed_length+1): (CRT_ROWS +1), 1); //Cursor to bottom
   t->xmit (_t, buf, i);
   t->xmit (_t, "\033[J", 3);    //erase rest of screen
 
index f27afea2bff68c1990956a3dc80494d0d151fc81..df7c13fbe3b0ba7dfe2c5db03ca03100de6b1658 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.19  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.18  2008/02/28 16:37:16  james
  * *** empty log message ***
  *
@@ -340,13 +343,18 @@ tty_hangup (TTY * t)
 
 }
 
+void tty_length(TTY *t,int l)
+{
+t->displayed_length=l;
+}
 
-void tty_winch(TTY * t,CRT_Pos size)
+void
+tty_winch (TTY * t, CRT_Pos size)
 {
   struct winsize sz = { 0 };
 
-  sz.ws_col=size.x;
-  sz.ws_row=size.y;
+  sz.ws_col = size.x;
+  sz.ws_row = size.y;
 
   ioctl (t->wfd, TIOCSWINSZ, &sz);
 }
index 76f9fbb7b1fc9fe3dc75cbc6505b0b2f6c100dc8..d91500e024ee3b0b685094cdea60a0696ba43f0d 100644 (file)
--- a/src/tty.h
+++ b/src/tty.h
@@ -12,6 +12,9 @@
 
 /*
  * $Log$
+ * Revision 1.12  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.11  2008/02/23 11:48:37  james
  * *** empty log message ***
  *
@@ -63,7 +66,8 @@
        int rfd; \
        int wfd; \
        int hanging_up; \
-       struct timeval hangup_clock;
+       struct timeval hangup_clock; \
+       int displayed_length;
 
 
 #define TTY_BITFREQ_LEN        10
index 1d3709bcbb87a0fe02714fbfe502094fcb45a9cf..74888035be62746b0bd559c00299c755b96f37b1 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.52  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.51  2008/02/28 16:37:16  james
  * *** empty log message ***
  *
@@ -402,9 +405,11 @@ in_margins (VT102 * v, CRT_Pos p)
 
   return 1;
 }
-void   vt102_crt_update(Context *c)
+
+void
+vt102_crt_update (Context * c)
 {
-VT102 *v=c->v;
+  VT102 *v = c->v;
 
   v->crt.pos = v->pos;
   v->crt.hide_cursor =
@@ -419,26 +424,28 @@ VT102 *v=c->v;
   if (c->d)
     cmd_show_status (c->d, c);
 }
-void vt102_do_resize(Context *c)
+
+void
+vt102_do_resize (Context * c)
 {
 
-VT102 *v=c->v;
+  VT102 *v = c->v;
 
-          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->top_margin = v->screen_start;
-          v->bottom_margin = v->screen_end;
-          vt102_cursor_home (v);
-          crt_cls (&v->crt);
+  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->top_margin = v->screen_start;
+  v->bottom_margin = v->screen_end;
+  vt102_cursor_home (v);
+  crt_cls (&v->crt);
 
-         if (c->t)
-               tty_winch(c->t,v->current_size);
+  if (c->t)
+    tty_winch (c->t, v->current_size);
 
-       log_f(c->l,"<size now %dx%d>", v->current_size.x,v->current_size.y);
-vt102_crt_update(c);
+  log_f (c->l, "<size now %dx%d>", v->current_size.x, v->current_size.y);
+  vt102_crt_update (c);
 }
 
 
@@ -750,9 +757,9 @@ vt102_insert_into_line (VT102 * v, CRT_Pos p)
 
 
 void
-vt102_change_mode (Context *c, int private, char *ns, int set)
+vt102_change_mode (Context * c, int private, char *ns, int set)
 {
-  VT102 *v=c->v;
+  VT102 *v = c->v;
   int m;
 
 
@@ -794,7 +801,7 @@ vt102_change_mode (Context *c, int private, char *ns, int set)
             private_modes[VT102_PRIVATE_MODE_132COLS] ? VT102_COLS_132 :
             VT102_COLS_80;
 
-         vt102_do_resize(c);
+          vt102_do_resize (c);
           break;
         }
 
@@ -808,9 +815,9 @@ vt102_change_mode (Context *c, int private, char *ns, int set)
 }
 
 void
-vt102_parse_mode_string (Context *c, char *buf, int len)
+vt102_parse_mode_string (Context * c, char *buf, int len)
 {
-  VT102 *v=c->v;
+  VT102 *v = c->v;
   int private = 0;
   char last = buf[len - 1];
   char num[4];
@@ -1627,9 +1634,9 @@ vt102_parser_reset (VT102_parser * p)
 
 
 void
-vt102_reset_state (Context *c)
+vt102_reset_state (Context * c)
 {
-  VT102 *v=c->v;
+  VT102 *v = c->v;
   vt102_parser_reset (&v->parser);
 
   v->attr = CRT_ATTR_NORMAL;
@@ -1639,7 +1646,7 @@ vt102_reset_state (Context *c)
 
   v->current_size = v->original_size;
 
-  vt102_do_resize(c);
+  vt102_do_resize (c);
 
   memset (v->modes, 0, VT102_NMODES);
   memset (v->private_modes, 0, VT102_NMODES);
@@ -1856,7 +1863,7 @@ vt102_parse_char (Context * c, int ch)
 #endif
     }
 
-  vt102_crt_update(c);
+  vt102_crt_update (c);
 
 
 }
@@ -2032,7 +2039,7 @@ vt102_send (Context * c, uint8_t key)
 void
 vt102_reset (Context * c)
 {
-  VT102 *v=c->v;
+  VT102 *v = c->v;
   VT102_parser *p = &v->parser;
 
 
@@ -2084,14 +2091,14 @@ vt102_new (CRT_Pos * size)
 
       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.y > VT102_MAX_ROWS)
+        v->original_size.y = VT102_MAX_ROWS;
 
     }
   else
     {
       v->original_size.x = VT102_COLS_80;
-      v->original_size.y = VT102_ROWS;
+      v->original_size.y = VT102_ROWS_24;
     }
 
   return v;
@@ -2103,25 +2110,28 @@ vt102_set_ansi (VT102 * v, int ansi)
   v->xn_glitch = ansi ? 0 : 1;
 }
 
-void vt102_resize(Context *c,CRT_Pos size)
+void
+vt102_resize (Context * c, CRT_Pos size)
 {
-       log_f(c->l,"<size change to %dx%d requested>", size.x,size.y);
+  log_f (c->l, "<size change to %dx%d requested>", size.x, size.y);
 
-       if (!size.x) size.x=c->v->current_size.x;
-       if (!size.y) size.y=c->v->current_size.y;
+  if (!size.x)
+    size.x = c->v->current_size.x;
+  if (!size.y)
+    size.y = c->v->current_size.y;
 
-      if (size.x < 1)
-        size.x = 1;
-      if (size.y < 1)
-        size.y = 1;
+  if (size.x < 1)
+    size.x = 1;
+  if (size.y < 1)
+    size.y = 1;
 
-      if (size.x > VT102_MAX_COLS)
-        size.x = VT102_MAX_COLS;
-      if (size.y > VT102_ROWS)
-        size.y = VT102_ROWS;
+  if (size.x > VT102_MAX_COLS)
+    size.x = VT102_MAX_COLS;
+  if (size.y > VT102_MAX_ROWS)
+    size.y = VT102_MAX_ROWS;
 
-       c->v->current_size=size;
-       vt102_do_resize(c);
+  c->v->current_size = size;
+  vt102_do_resize (c);
 }
 
 void
index e09fbf60e068711504c4a6f95137264e488d136a..02fdf990718abd080b5d831a4dcbf568da5fb994 100644 (file)
@@ -12,6 +12,9 @@
 
 /*
  * $Log$
+ * Revision 1.21  2008/02/28 16:57:52  james
+ * *** empty log message ***
+ *
  * Revision 1.20  2008/02/27 09:42:22  james
  * *** empty log message ***
  *
@@ -79,7 +82,8 @@
 
 #define VT102_CMD_LEN 128
 
-#define VT102_ROWS             24
+#define VT102_MAX_ROWS         ((CRT_ROWS) - 1)
+#define VT102_ROWS_24          24
 #define VT102_COLS_132         132
 #define VT102_COLS_80          80
 #define VT102_MAX_COLS         VT102_COLS_132
@@ -92,7 +96,7 @@ typedef struct
 {
   int in_escape;
   int in_cmd;
-  
+
   int cmd_ptr;
   int cmd_more_bytes;
   int cmd_termination;
index b7dc3a0a6dad673a0cd91017e06d5f2357c7bdce..08fdf3454faf21c040bef0d08115e52057c44e36 100644 (file)
@@ -9,3 +9,4 @@ f844259e45d571cf913580d8851ee261        1.1.3
 93f010bab6441e6f679f523725507d04       1.1.5
 0baf4bcc06f0271dba444738df2ef1e3       1.1.6
 30b3685c955c05efa7ba0affb9fbca1a       1.1.7
+b9ef98229248516850808e590721c0e5       1.1.8
index 7f8f011eb73d6043d2e6db9d2c101195ae2801f2..45a4fb75db864000d01701c0f7a51864bd4daabf 100644 (file)
@@ -1 +1 @@
-7
+8
index 8a2a5c4f0c7b6302edffecdf0c15d64f6dee7c6d..9a07f4920d0b2ff45420932c6e912fe6446f1291 100644 (file)
@@ -1,3 +1,5 @@
 88cd008326dcedb9dee8011ce2697e6a       "February 27, 2008"
 93f010bab6441e6f679f523725507d04       "February 28, 2008"
 0baf4bcc06f0271dba444738df2ef1e3       "February 28, 2008"
+30b3685c955c05efa7ba0affb9fbca1a       "February 28, 2008"
+b9ef98229248516850808e590721c0e5       "February 28, 2008"