mdmx_sd.c
Upload User: caisha3
Upload Date: 2013-09-21
Package Size: 208739k
Code Size: 3k
Category:

Windows Develop

Development Platform:

Visual C++

  1. /* File: C:WACKERxfermdmx_sd.c (Created: 17-Jan-1994)
  2.  * created from HAWIN
  3.  * mdmx_sd.c -- Routines to handle xmodem displays for HA5a/G
  4.  *
  5.  * Copyright 1989, 1994 by Hilgraeve Inc. -- Monroe, MI
  6.  * All rights reserved
  7.  *
  8.  * $Revision: 1 $
  9.  * $Date: 10/05/98 1:16p $
  10.  */
  11. #include <windows.h>
  12. #pragma hdrstop
  13. #include <setjmp.h>
  14. #define BYTE unsigned char
  15. #include <tdllstdtyp.h>
  16. #include <tdllsession.h>
  17. #include <tdllxfer_msc.h>
  18. #include <tdllload_res.h>
  19. #include <termres.h>
  20. #include <tdllglobals.h>
  21. #include <tdllfile_io.h>
  22. #include "xfr_srvc.h"
  23. #include "xfr_todo.h"
  24. #include "xfr_dsp.h"
  25. #include "xfer_tsc.h"
  26. #include "foo.h"
  27. #include "xfer.h"
  28. #include "xfer.hh"
  29. #include "mdmx.h"
  30. #include "mdmx.hh"
  31. void mdmxXferInit(ST_MDMX *xc, int method)
  32. {
  33. XFR_XY_PARAMS *pX;
  34. pX = (XFR_XY_PARAMS *)xfer_get_params(xc->hSession, method);
  35. switch (pX->nErrCheckType)
  36. {
  37. default:
  38. case XP_ECP_AUTOMATIC:
  39. xc->mdmx_chkt = UNDETERMINED;
  40. break;
  41. case XP_ECP_CRC:
  42. xc->mdmx_chkt = CRC;
  43. break;
  44. case XP_ECP_CHECKSUM:
  45. xc->mdmx_chkt = CHECKSUM;
  46. break;
  47. }
  48. xc->mdmx_tries        = pX->nNumRetries;
  49. xc->mdmx_chartime     = pX->nByteWait;
  50. xc->mdmx_pckttime     = pX->nPacketWait;
  51. xc->p_putc            = xm_putc;
  52. // Should we do this ?
  53. // xc->p_getc            = xm_getc;
  54. xc->p_crc_tbl         = NULL;
  55. resLoadDataBlock(glblQueryDllHinst(),
  56. IDT_CSB_CRC_TABLE,
  57. &xc->p_crc_tbl,
  58. (int *)0);
  59. }
  60. void mdmxdspFilecnt(ST_MDMX *pX, int cnt)
  61. {
  62. xferMsgFilecnt(pX->hSession, cnt);
  63. }
  64. void mdmxdspErrorcnt(ST_MDMX *pX, int cnt)
  65. {
  66. xferMsgErrorcnt(pX->hSession, cnt);
  67. }
  68. void mdmxdspPacketErrorcnt(ST_MDMX *pX, int cnt)
  69. {
  70. xferMsgPacketErrcnt(pX->hSession, cnt);
  71. }
  72. void mdmxdspTotalsize(ST_MDMX *pX, long bytes)
  73. {
  74. xferMsgTotalsize(pX->hSession, bytes);
  75. }
  76. void mdmxdspFilesize(ST_MDMX *pX, long fsize)
  77. {
  78. xferMsgFilesize(pX->hSession, fsize);
  79. }
  80. void mdmxdspNewfile(ST_MDMX *pX,
  81. int filen,
  82. LPSTR theirname,
  83. LPTSTR ourname)
  84. {
  85. xferMsgNewfile(pX->hSession,
  86.    filen,
  87.    theirname,
  88.    ourname);
  89. }
  90. void mdmxdspProgress(ST_MDMX *pX,
  91.  long stime,
  92.  long ttime,
  93.  long cps,
  94.  long file_so_far,
  95.  long total_so_far)
  96. {
  97. xferMsgProgress(pX->hSession,
  98. stime,
  99. ttime,
  100. cps,
  101. file_so_far,
  102. total_so_far);
  103. }
  104. void mdmxdspChecktype(ST_MDMX *pX, int ctype)
  105. {
  106. xferMsgChecktype(pX->hSession, ctype);
  107. }
  108. void mdmxdspPacketnumber(ST_MDMX *pX, long number)
  109. {
  110. xferMsgPacketnumber(pX->hSession, number);
  111. }
  112. void mdmxdspLastError(ST_MDMX *pX, int errcode)
  113. {
  114. xferMsgLasterror(pX->hSession, errcode);
  115. }
  116. void mdmxdspCloseDisplay(ST_MDMX * pX)
  117. {
  118. xferMsgClose(pX->hSession);
  119. }