diff options
| author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2015-10-05 08:38:46 -0400 |
|---|---|---|
| committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2015-10-05 08:38:46 -0400 |
| commit | 99cf9c4dc5855b1f5f26d00267fdbbe672ee27a7 (patch) | |
| tree | 83a11a0dc0f87198e251ca7ec19504aeec152bc1 /f_get_st.c | |
| download | foslib-99cf9c4dc5855b1f5f26d00267fdbbe672ee27a7.tar.gz foslib-99cf9c4dc5855b1f5f26d00267fdbbe672ee27a7.zip | |
Diffstat (limited to 'f_get_st.c')
| -rw-r--r-- | f_get_st.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/f_get_st.c b/f_get_st.c new file mode 100644 index 0000000..a8d9c03 --- /dev/null +++ b/f_get_st.c @@ -0,0 +1,50 @@ +#include "fossil.h"
+#include <dos.h>
+#include <stdlib.h>
+int F_Get_Status(unsigned char function)
+{
+ int arg = 0;
+
+ union REGS regs;
+
+ if(function == CK_DCD && dcd_ignore)
+ return TRUE;
+
+ regs.h.ah = 0x03; /* function = request status */
+ regs.h.al = 0x00;
+ regs.x.dx = (unsigned char) port;
+ int86(FOSSIL_INT, ®s, ®s);
+
+
+ switch (function) {
+ case 1:
+ arg = ((regs.h.al & 0x10) == 0x10) ? 1 : 0; /* CTS * /
+ break;
+ case 2:
+ arg = ((regs.h.al & 0x20) == 0x20) ? 1 : 0; /* DSR */
+ break;
+ case 3:
+ arg = ((regs.h.al & 0x40) == 0x40) ? 1 : 0; /* RING */
+ break;
+ case 4:
+ arg = ((regs.h.al & 0x80) == 0x80) ? 1 : 0; /* DCD */
+ break;
+ case 5:
+ arg = ((regs.h.ah & 0x00) == 0x00) ? 1 : 0; /* RDA */
+ break;
+ case 6:
+ arg = ((regs.h.ah & 0x02) == 0x02) ? 1 : 0; /* OVRN */
+ break;
+ case 7:
+ arg = ((regs.h.ah & 0x20) == 0x20) ? 1 : 0; /* THRE */
+ break;
+ case 8:
+ arg = ((regs.h.ah & 0x40) == 0x040) ? 1 : 0; /* TSRE */
+ break;
+ case 9:
+ arg = ((regs.h.ah & 0x80) == 0x80) ? 1 : 0; /* TIMEOUT */
+ default:
+ return (FALSE);
+ }
+ return (arg);
+}
|
