chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / libsympathy.c
index 40f8a9d247498b867d1bf21f5116dd2e1d8f3f20..989b664a7f433596a3823cae2214275cc827c4f2 100644 (file)
@@ -6,10 +6,56 @@
  *
  */
 
-static char rcsid[] = "$Id$";
+static char rcsid[] =
+  "$Id$";
 
 /*
  * $Log$
+ * Revision 1.16  2008/02/13 09:12:21  james
+ * *** empty log message ***
+ *
+ * Revision 1.15  2008/02/13 01:08:18  james
+ * *** empty log message ***
+ *
+ * Revision 1.14  2008/02/12 22:36:46  james
+ * *** empty log message ***
+ *
+ * Revision 1.13  2008/02/08 15:06:42  james
+ * *** empty log message ***
+ *
+ * Revision 1.12  2008/02/07 13:26:35  james
+ * *** empty log message ***
+ *
+ * Revision 1.11  2008/02/07 13:22:51  james
+ * *** empty log message ***
+ *
+ * Revision 1.10  2008/02/07 11:32:41  james
+ * *** empty log message ***
+ *
+ * Revision 1.9  2008/02/07 11:11:14  staffcvs
+ * *** empty log message ***
+ *
+ * Revision 1.8  2008/02/07 00:43:27  james
+ * *** empty log message ***
+ *
+ * Revision 1.7  2008/02/07 00:39:13  james
+ * *** empty log message ***
+ *
+ * Revision 1.6  2008/02/06 20:26:58  james
+ * *** empty log message ***
+ *
+ * Revision 1.5  2008/02/06 17:53:28  james
+ * *** empty log message ***
+ *
+ * Revision 1.4  2008/02/04 20:23:55  james
+ * *** empty log message ***
+ *
+ * Revision 1.3  2008/02/04 05:45:55  james
+ * ::
+ *
+ * Revision 1.2  2008/02/04 02:05:06  james
+ * *** empty log message ***
+ *
  * Revision 1.1  2008/02/03 16:20:24  james
  * *** empty log message ***
  *
@@ -18,3 +64,71 @@ static char rcsid[] = "$Id$";
 
 #include "project.h"
 
+
+
+void
+testy (void)
+{
+  fd_set rfd;
+  struct termios raw = { 0 };
+  ANSI a = { 0 };
+  Context c;
+
+#if 0
+  int fd;
+  char c;
+
+  TTY *t;
+  VT102 *v;
+  History *h;
+  int i;
+#endif
+
+
+
+  ansi_reset (&a);
+
+
+  c.t = ptty_open (NULL, NULL);
+  c.v = vt102_new ();
+  c.h = history_new (200);
+  c.l = NULL;
+
+  terminal_register_handlers ();
+  a.terminal = terminal_open (0, 1);
+
+
+  FD_ZERO (&rfd);
+  for (;;)
+    {
+      struct timeval tv = { 0, 100000 };
+
+
+      FD_SET (c.t->rfd, &rfd);
+      FD_SET (a.terminal->rfd, &rfd);
+
+      select (FD_SETSIZE, &rfd, NULL, NULL, &tv);
+
+      ansi_dispatch (&a, &c);
+
+      if (FD_ISSET (c.t->rfd, &rfd))
+        {
+          if (vt102_dispatch (&c))
+            break;
+        }
+
+#if 0
+      if (had_winch)
+        {
+          had_winch = 0;
+          ansi_getsize (&a);
+          ansi_reset (&a);
+          ansi_draw (&a, &v->crt);
+        }
+#endif
+      //FIXME history
+      ansi_draw (&a, &c.v->crt);
+    }
+
+  terminal_atexit ();
+}