chiark / gitweb /
*** empty log message ***
authorjames <james>
Wed, 27 Feb 2008 09:42:21 +0000 (09:42 +0000)
committerjames <james>
Wed, 27 Feb 2008 09:42:21 +0000 (09:42 +0000)
apps/mainloop.c
apps/mainloop.h
apps/sympathy.c
apps/usage.c
src/ansi.c
src/ptty.c
src/vt102.c
version-md5sums
version-micro

index d546ac5152700504d1ca30582a75a76fac3ffeb2..146ebdd5a7f8229ea0b69836abc2f0f644e73bfd 100644 (file)
@@ -11,6 +11,9 @@ static char rcsid[] =
 
 /*
  * $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 ***
  *
@@ -397,7 +400,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, int width)
+          ANSI * ansi, Log * log, int nhistory, CRT_Pos *size )
 {
   fd_set rfds, wfds;
   Context c = { 0 };
@@ -408,7 +411,7 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket,
   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 */
index cea139e886d590a5623b08b5f0d2d19574a13d4e..df32f25ad1fa47ed477048e963855c6754affb71 100644 (file)
@@ -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__ */
index e93c9302398df284a2cbbcee273c7abe6ac5678d..29c328085789780aacc8a03d352fbc47447d933d 100644 (file)
@@ -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'])
index d86294e13ffc190d8b8eceb68d8a342b667fd0f5..598ccb733411e0bd9277738b04d96e8c5fb70335 100644 (file)
@@ -10,9 +10,6 @@ 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 ***
  *
@@ -82,8 +79,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"
index 408efd4429f27ce72e0e1ddf41cd29cc2dc41835..42f6a4c650476b752907670e96b36dbfcbc55c1d 100644 (file)
@@ -10,9 +10,6 @@ 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 ***
  *
@@ -528,10 +525,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))
     {
 
@@ -545,7 +542,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);
@@ -577,7 +574,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)
@@ -587,7 +584,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);
@@ -719,7 +716,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);
index 3be35f22b34b4d2aa46e0272357b62c81c51197f..fba32022ae909916611fd0a6659f81bf5999eb00 100644 (file)
@@ -10,9 +10,6 @@ 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 ***
  *
@@ -149,7 +146,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;
@@ -161,7 +158,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);
index 2132f83f7005874168937f27e47c6096aea2d949..1940dcf513de86d1dde690e0753636f6d715631f 100644 (file)
@@ -10,9 +10,6 @@ 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 ***
  *
@@ -746,10 +743,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);
@@ -1598,9 +1595,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--;
@@ -2017,10 +2014,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--;
 
@@ -2039,7 +2036,7 @@ vt102_reset (VT102 * v)
 }
 
 VT102 *
-vt102_new (CRT_Pos * size)
+vt102_new (CRT_Pos *size)
 {
   VT102 *v;
 
@@ -2047,26 +2044,19 @@ 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);
index 9055410f15d01a190238ee8618d20f91553cb11b..8625f8b09cbd9539ba680eacf396a933a322cd19 100644 (file)
@@ -1,5 +1,3 @@
 6488eda7d5c4d46ce3f587f5dc745dfa       1.0.1
 ca1ac5a7fc122af620b0cf7296c324c3       1.0.2
-ac9d93b50970b366e4531b4ea5a1c983       1.0.3
-ac9d93b50970b366e4531b4ea5a1c986       1.1.0
-0ea0fc96142920321bfa5354dc6b9daa       1.1.1
+ac9d93b50970b366e4531b4ea5a1c986       1.0.3
index 00750edc07d6415dcc07ae0351e9397b0222b7ba..3a2e3f4984a0ee55900f8c7894844c563d2c2744 100644 (file)
@@ -1 +1 @@
-3
+-1