Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.8 KiB

  1. /*===========================================================================*/
  2. /* Copyright (c) 1987 - 1988, Future Soft Engineering, Inc. */
  3. /* Houston, Texas */
  4. /*===========================================================================*/
  5. #define NOLSTRING TRUE /* jtf win3 mod */
  6. #include <windows.h>
  7. #include "port1632.h"
  8. #include "dcrc.h"
  9. #include "dynacomm.h"
  10. #include "task.h"
  11. BREAKCOND breakcondition_rdModem;
  12. /*---------------------------------------------------------------------------*/
  13. /* rdModem() - Read characters from system modem into local IT buffer. [scf] */
  14. /*---------------------------------------------------------------------------*/
  15. VOID rdModem(BOOL rFlag)
  16. {
  17. INT i;
  18. INT yieldCount;
  19. MSG msg;
  20. if(modemBytes())
  21. {
  22. if(answerMode)
  23. {
  24. theChar = getMdmChar(TRUE); /* mbbx 1.06A: ics new xlate */
  25. return;
  26. }
  27. later = FALSE;
  28. hideTermCursor();
  29. yieldCount = 0;
  30. getPort();
  31. repeat
  32. {
  33. theChar = (the8Char = getMdmChar(TRUE)); /* mbbx 1.06A: ics new xlate... */
  34. if(rFlag)
  35. {
  36. modemInp(the8Char, TRUE); /* mbbx: make this optional ??? */
  37. if(mdmResult[0] < MDMRESLEN)
  38. mdmResult[++(*mdmResult)] = theChar;
  39. if(theChar != LF)
  40. {
  41. if(mdmResult[0] == 1)
  42. mdmResult[0] = 0; /* throw it away!!! */
  43. }
  44. else if(mdmResult[0] > 2)
  45. mdmValid = TRUE;
  46. later = TRUE;
  47. }
  48. else
  49. {
  50. if(xferWaitEcho)
  51. if(xferTxtType == XFRLINE) /* (jtfx) */
  52. {
  53. if(theChar == xferLinStr[xferWaitEcho])
  54. if(xferWaitEcho == xferLinStr[0])
  55. xferWaitEcho = FALSE;
  56. else
  57. xferWaitEcho++;
  58. }
  59. else if((xferTxtType == XFRCHAR) && (theChar == xferCharEcho)) /* (jtfx) */
  60. xferWaitEcho = FALSE;
  61. modemInp(the8Char, TRUE); /* mbbx 1.10 */
  62. if(theChar == CR)
  63. if(trmParams.inpCRLF) /* mbbx 1.10: CUA */
  64. modemInp(LF, TRUE);
  65. if(!modemBytes())
  66. later = TRUE;
  67. if(++yieldCount == YIELDCHARS)
  68. {
  69. termCleanUp(); /* mbbx: per mac version */
  70. yieldCount = 0;
  71. if(yield(&msg, (HWND) NULL)) /* mbbx */
  72. later = TRUE;
  73. }
  74. }
  75. } until(later);
  76. activSelect = FALSE; /* rjs bugs 020 */
  77. termCleanUp();
  78. showTermCursor();
  79. releasePort();
  80. }
  81. }