summaryrefslogtreecommitdiff
path: root/f_reciev.c
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2015-10-05 08:38:46 -0400
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2015-10-05 08:38:46 -0400
commit99cf9c4dc5855b1f5f26d00267fdbbe672ee27a7 (patch)
tree83a11a0dc0f87198e251ca7ec19504aeec152bc1 /f_reciev.c
downloadfoslib-master.tar.gz
foslib-master.zip
Initial commitHEADmaster
Diffstat (limited to 'f_reciev.c')
-rw-r--r--f_reciev.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/f_reciev.c b/f_reciev.c
new file mode 100644
index 0000000..4a6a6c8
--- /dev/null
+++ b/f_reciev.c
@@ -0,0 +1,34 @@
+#include "fossil.h"
+#include <dos.h>
+#include <conio.h>
+#include <stdlib.h>
+
+unsigned char F_Receive_Wait()
+{
+ union REGS regs;
+ unsigned char key;
+ double time_allowed;
+ time_allowed = Set_Time(30); /* sets the timer function */
+ do { /* Watch carrier while waiting for next char */
+ if (!local) {
+ if (F_Get_Status(CK_DCD) == FALSE)
+ return(FALSE);
+ }
+ if (Timer(time_allowed) == FALSE) /* if no one types it times */
+ return(FALSE); /* out after 30 seconds */
+ if (Kb_Hit()) { /* Allows local keyboard over-ride */
+ key = (unsigned char) getche();
+ if (key == 0 || key == 0xe0)
+ key = (unsigned char) getche();
+ return(key);
+ }}
+ while (!F_Peek());
+ if(!local) {
+ regs.h.ah = 0x02;
+ regs.h.al = 0x00;
+ regs.x.dx = port;
+ int86(FOSSIL_INT, &regs, &regs);
+ regs.h.ah = 0x00;
+ return(unsigned char)regs.h.al; }
+ return(FALSE);
+ }