Fetch: qjmp is for queueing up jumps while rd_waiting, not while stalled.
[firearm.git] / testbench.cpp
index 4188d71..53be841 100644 (file)
@@ -1,8 +1,30 @@
 #include "Vsystem.h"
 #include <stdio.h>
+#define _XOPEN_SOURCE
+#include <stdlib.h>
+#include <fcntl.h>
 
 Vsystem *top;
 
+void term_output(unsigned char d)
+{
+       int fd = posix_openpt(O_RDWR);
+       static int fd2 = -1;
+       char b[128];
+
+       if (fd2 == -1)
+       {
+               grantpt(fd);  
+               fcntl(fd, F_SETFD, 0);  /* clear close-on-exec */
+               sprintf(b, "rxvt -pty-fd %d -bg black -fg white -title \"Output terminal\" &", fd);
+               system(b);
+               unlockpt(fd);
+               fd2 = open(ptsname(fd), O_RDWR);
+               close(fd);
+       }
+       write(fd2, &d, 1);
+}
+
 unsigned int main_time = 0;
 
 double sc_time_stamp ()
This page took 0.01717 seconds and 4 git commands to generate.