home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / libs / xpr / xprzmodem.doc < prev    next >
Text File  |  1984-11-18  |  38KB  |  734 lines

  1.  
  2.                     Documentation for XPRZModem.library
  3.               Version 2.10, 12 February 1991, by Rick Huebner
  4.  
  5. |---
  6. |           Update comments for XprZmodem.Library
  7. |    Version 2.50 Update, 15 November 1991, by William M. Perkins
  8. |    Version 2.51 bug fix, 29 January 1992, by John Tillema
  9. |    Version 2.52 recompiled, 6 March 1992, by William M. Perkins
  10. |    Version 2.54 Update, 28 June 1993, by Olaf `Olsen' Barthel
  11. |    Version 2.56 Update, 18 February 1995, by Olaf `Olsen' Barthel
  12. |      Proto additions for the SAS 5.10B Compiler by Jim Cooper
  13. |---
  14.  
  15. |---
  16. |    All of my additions to this documentation are indicated by
  17. |  <--  this left margin braketing.   -WMP-
  18. |---
  19.  
  20. 1.  Introduction (or "What is this thing, anyway?")
  21. ---------------------------------------------------
  22.  
  23.      XPRZModem.library is an Amiga shared library (with full Lattice C
  24. source code) which provides ZModem file transfer capability to any
  25. XPR-compatible communications program.  The XPR external protocol standard
  26. describes an interface method which allows various file transfer protocols
  27. to be implemented as Amiga shared libraries which may then be used
  28. interchangeably in any compatible communications program.  This takes a
  29. heavy load off of the comm program author, who no longer has to support
  30. scads of different file transfer protocols (many of which are quite tricky
  31. to code) in their program in order to make it widely useful and popular.
  32. The comm program is also smaller and more efficient as a result, since all
  33. those obscure protocols (you know, the ones *you* don't need) are no longer
  34. taking up space.  The XPR standard also helps users, who can mix and match
  35. their favorite file transfer protocols (and implementations thereof) with
  36. their favorite comm programs.  And when new protocols are invented, the
  37. user simply plugs in a new library, and voila!, it's ready to use.
  38. Hopefully, making protocols easy to support will allow more and better comm
  39. programs to be written, as authors can concentrate on their programs
  40. instead of constantly re-inventing the wheel.
  41.  
  42.      Of course, for all of this wonderful stuff to happen, there needs to
  43. be a good selection of these XPR protocol libraries available to the
  44. public.  It's the classic chicken-and-egg problem; comm program authors
  45. won't be motivated to support the XPR standard unless there are a goodly
  46. number of protocols available for it.  And other programmers won't be
  47. motivated to write XPR protocol libraries until there are a goodly number
  48. of comm programs which can use them.  In an effort to do my bit [ B^) ] for
  49. the Amiga community, which has given me so many neat toys to play with over
  50. the past few years, I decided to try and help get the ball rolling.
  51.  
  52.      Hopefully, the early availability of a ZModem library will help
  53. stimulate interest in the XPR standard, resulting in better Amiga telecomms
  54. for all of us.  And by making my source code PD, I hope to help others
  55. interested in writing XPR protocol libraries by giving them some serious
  56. example code.  Also, having ZModem library code readily available to John
  57. Q. Hacker should help ensure a steady stream of new lemon-fresh enhanced
  58. ZModem libraries (with enzymes) for all of us to use in the future.
  59.  
  60.      Of course, no discussion of the XPR standard would be complete without
  61. giving proper credit to the author, Willy Langeveld of the Stanford Linear
  62. Accelerator Center.  Many thanks are due him for this effort.  If you have
  63. any further questions about the XPR standard, be sure and download the spec;
  64. it should be available on BIX (since he's a sysop there), or on most other
  65. major systems.  And I'll try to keep the current version available on my
  66. BBS, as well.
  67.  
  68.      All files in this archive which are not copyrighted are hereby
  69. released to the public domain (which they were anyway, by way of not being
  70. copyrighted, but I want to make sure YOU realize that).  Do as you like
  71. with them.  Please make lots of copies and distribute them all over the
  72. place, and make lots of derivative works, and everything!  Heck, you can
  73. even publicly perform and/or display this code if you can figure out how...
  74.  
  75.  
  76.  
  77. 2.  Installation (OK, enough chatter; let's get to work)
  78. --------------------------------------------------------
  79.  
  80.      Couldn't be easier.  Just copy the xprzmodem.library file into your
  81. LIBS: directory.  All XPR-compatible comm programs should provide a way for
  82. you to select which XPR protocol you wish to use, either by giving you a
  83. file requester showing LIBS:xpr*.library, or by automatically detecting
  84. these libraries and adding them into their menus.
  85.  
  86. WARNING:  Versions of VLT prior to revision 4.107 had a bug in the
  87. xpr_sflush() routine which caused random Guru 3 crashes on some systems.  If
  88. you're using a version of VLT older than 4.107, it would be a good idea to
  89. upgrade to the latest rev.  Besides, there's a bunch of new features you're
  90. missing, anyway...
  91.  
  92. ANOTHER WARNING:  Versions of VLT prior to 5.034 had a bug in the
  93. xpr_sread() function which caused them to (at least sometimes) fail to
  94. return any bytes received so far when an xpr_sread() call timed out.  This
  95. version of XPRZModem.library requires VLT version 5.034 or later.  (Yes,
  96. Willy, it really was broken B-))
  97.  
  98. |---
  99. |    XprZmodem.Library version 2.50 and 2.52 tested with WTerm version
  100. |    0.82 and Willy's term program, VLT version 5.045.  No problems
  101. |    occurred.  It should work fine with any term program that was able
  102. |    to work with the version 2.10 of XprZmodem.Library.    -WMP-
  103. |---
  104.  
  105. |---
  106. |    xprzmodem.library v2.56 *requires* Kickstart 2.04 or higher to
  107. |    work properly! Trying to use this library with any previous
  108. |    operating system revision will most certainly fail!
  109. |    All library texts are now localized, i.e. if a translation
  110. |    table for you preferred system language is available, the
  111. |    library will issue error messages and such in it. As of this
  112. |    writing only a German translation is available. I have included
  113. |    a blank catalog translation file (zmodem_blank.ct) for your
  114. |    convenience; feel free to translate it to your preferred
  115. |    language and mail it to me (see the address at the end of this
  116. |    document). It will be included in the next release.
  117. |---
  118.  
  119. 3.  Options
  120. -----------
  121.  
  122.      The XPR standard lays out two ways for the comm program user to
  123. specify options for the XPR protocol.  The more primitive option is for the
  124. comm program to provide a method of passing an option string to the XPR
  125. library before transferring files.  The precise format and usage of this
  126. option string is left up to the XPR protocol author; the comm program just
  127. sends it verbatim.  If an environment variable is found with the same name
  128. as the XPR protocol (i.e. there's a file in the ENV: directory called
  129. "xprzmodem"), the comm program is supposed to use this string (contents of
  130. file) to initialize the protocol options.  Also, a menu option or some such
  131. should normally be provided which will allow the user to be prompted for
  132. the option string interactively.
  133.  
  134.      Version 2.0 of the XPR standard created a new, more sophisticated way
  135. for the comm program user to specify XPR options.  If the comm program
  136. supports it, the XPR library can give the comm program a list of option
  137. prompts, and the comm program can then let the user interactively set the
  138. various options individually, possibly even using nice gadgets and stuff.
  139.  
  140.      In any case, no matter how your particular comm program feels like
  141. handling it, these are the options supported by this implementation of
  142. ZModem:
  143.  
  144.           T{Y|N|?|C}   Text translation mode:
  145.              TY = Text Yes; if receiving, translate CR/LF pairs or solo
  146.                   CR chars to normal Amiga LF chars.  Ignore data past ^Z.
  147.                   If sending, suggests to receiver that they should receive
  148.                   this file in text mode.
  149.              TN = Text No; receive file verbatim, without changes.  If
  150.                   sending, suggest to receiver that they receive this
  151.                   file verbatim, without translations.
  152.              T? = Text status unknown; if receiving, use sender's
  153.                   suggestion as to whether to do EOL translations or not.
  154.                   If sending, tell receiver to use default mode, 'cause we
  155.                   don't know either.
  156.              TC = Text mode set by Comm program; the library asks the comm
  157.                   program whether or not to use Text mode for each file.
  158.                   If the comm program doesn't support the necessary
  159.                   xpr_finfo() call, or if the call fails, this option acts
  160.                   like T?.  From the user's point of view, what this option
  161.                   normally does is set the Text mode to match the comm
  162.                   program's built-in text/binary/end-of-line/translation
  163.                   mode, if any.
  164.  
  165.           O{Y|N|R|S}  Overwrite mode:
  166.              OY = Overwrite Yes; if about to receive file with same name as
  167.                   one which already exists, delete the old file and receive
  168.                   the new file in its place.
  169.              ON = Overwrite No; if about to receive file with same name as
  170.                   one which already exists, append ".dup" onto the name of
  171.                   the new file to keep them separate.
  172.              OR = Overwrite Resume; if about to receive file with same name
  173.                   as one which already exists, resume receiving file data
  174.                   from the current end of the existing file.
  175.              OS = Overwrite Skip; if (etc.), tell sender never mind, skip
  176.                   this file, we don't want it.  Batch transfers will move
  177.                   on to the next file in the set, if any.
  178.  
  179.           Bnnn   Buffer size:
  180.              XPRZModem.library adds a layer of file I/O buffering in
  181.              addition to whatever the comm program may or may not provide.
  182.              This option sets the size of XPRZModem's file I/O buffer in
  183.              kilobytes.  The minimum value is 1 KB, for those using RAM
  184.              drives or fast hard drives, or those whose comm programs
  185.              already provide sufficient buffering.  The maximum value is
  186.              as much contiguous RAM as you have available in your Amiga.
  187.              If you specify more than is actually available, XPRZModem will
  188.              keep decrementing the buffer size requested by 1 KB until the
  189.              memory allocation works.  That way, if your RAM is too
  190.              fragmented to use the amount you request, XPRZModem simply
  191.              uses the largest block available.  Buffering is especially
  192.              helpful for floppy drive users; it keeps your drive from
  193.              continuously gronking and slowing things down all through the
  194.              transfer.  NOTE: Versions of VLT prior to 5.034 couldn't handle
  195.              buffer sizes >= 32 KB.  If you wanted to use larger buffers
  196.              before and couldn't, try again now.
  197.  
  198.           Fnnn   Frame size:
  199.              Although normally avoided, ZModem has the ability to require
  200.              an ACK to be sent from the receiver to the sender every X-many
  201.              data bytes.  Normally you don't want to use this feature,
  202.              because not waiting for ACKs is part of how ZModem works so
  203.              fast.  However, this feature can be very useful in conjunction
  204.              with file I/O buffering on slow devices (namely those floppy
  205.              drives).  If you set up a large I/O buffer to avoid gronking
  206.              your floppy so often, you'll find that when the buffer finally
  207.              *does* get around to being flushed that it can take a looonng
  208.              time; so long, in fact, that the delay can cause timeouts and
  209.              errors.  But if you set your ZModem to require the sender to
  210.              wait for an ACK every buffer's-worth of data, the sender will
  211.              politely wait for you to flush your buffer to the slow floppy
  212.              and send it an ACK saying it's OK to continue now.  This value
  213.              should be set to 0 to disable ACKs (normal mode), or set it to
  214.              the actual number of data bytes allowed between ACKs.  For
  215.              example, if you set B64 because of your floppy, you should
  216.              also set F65536.
  217.  
  218.           Ennn   Error count:
  219.              This allows you to set the number of sequential errors which
  220.              will be required to convince ZModem to abort the transfer.  The
  221.              normal value is 10, meaning that 10 errors must happen in a row
  222.              with no valid data being transferred in order to cause an abort.
  223.              This setting is provided for those using XPRZModem with a BBS,
  224.              who may wish to use a relaxed setting, or those with really
  225.              lousy phone lines who are desparate and patient enough to want
  226.              the transfer to continue in spite of horrible performance.
  227. |---
  228. |         C{Y|N}   Escape control characters:
  229. |            CY = Prefix certain control characters with extra characters; useful
  230. |                 only for certain Unix ttys which have the unnerving habit of
  231. |                 stripping the ZModem escape commands. Not necessarily a good
  232. |                 idea to enable on the Amiga side unless the remote really requires
  233. |                 it. Please note that if you enable this option the amount of
  234. |                 data to transfer will slightly increase due to the overhead
  235. |                 introduced by encoding control characters.
  236. |            CN = Send the control characters as usual, do not extra work. This
  237. |                 is the default.
  238. |
  239. |         I{R|S|B} Transfer/honor file attributes:
  240. |            IR = Honor file attributes (creation date, protection bits) when
  241. |                 receiving files. Note: as this feature actually goes beyond
  242. |                 the original XPR specifications it may not be supported by
  243. |                 all telecommunications programs.
  244. |
  245. |            IS = Transmit file attributes (creation date, protection bits) when
  246. |                 sending files. Note: as this feature actually goes beyond
  247. |                 the original XPR specifications it may not be supported by
  248. |                 all telecommunications programs.
  249. |
  250. |            IB = Do both, i.e. honor file attributes when receiving and
  251. |                 transmit file attributes when sending files.
  252. |---
  253.           A{Y|N}   Auto-activate mode:
  254.              AY = Auto-activate Yes; if the comm program supports the
  255.                   ability, the library will automatically go into receive
  256.                   mode when the start of a ZModem download is detected.
  257.              AN = Auto-activate No; don't try to automatically start
  258.                   downloading, make the user activate it.
  259.  
  260.           D{Y|N}   Delete after sending:
  261.              DY = Delete Yes; delete each file after it has been
  262.                   sucessfully sent.
  263.              DN = Delete No; don't delete files after sending them.
  264.  
  265.           K{Y|N}   Keep partial files:
  266.              KY = Keep Yes; keep the fragment of a file received so far
  267.                   if file reception is aborted.  This allows you to use the
  268.                   Overwrite Resume option above to pick up where you left
  269.                   off on your next attempt.
  270.              KN = Keep No; delete any partially-received file after an
  271.                   aborted transfer.
  272.  
  273.           S{Y|N}   Send full directory path:
  274.              SY = Send path Yes; send full filenames including directory
  275.                   path to receiver.
  276.              SN = Send path No; send only simple filenames, not including
  277.                   directory path.
  278.  
  279.           R{Y|N}   Receive full directory path:
  280.              RY = Receive path Yes; use full filename exactly as received,
  281.                   instead of using the P option directory path.
  282.              RN = Receive path No; ignore received directory path (if any),
  283.                   use P option directory path instead.
  284.  
  285.           P{dir}   Path to use for received files:
  286.              Px = Store all received files in directory "x" if option RN
  287.                   set.  Ignored if option RY set.  "x" can be any valid
  288.                   existing directory, with or without trailing "/"
  289.                   (e.g. "Pdf0:", "PComm:hold", etc.).
  290.  
  291.      If setting the options via the option string method (either ENV: file
  292. or primitive comm program), note that the setting for each option must
  293. immediately follow the option character with no intervening characters
  294. ("TY", not "T Y" or "T=Y").  When setting multiple options at once,
  295. separate the options from each other with commas and/or spaces; for
  296. example, "TN,OR,F0".  You don't have to specify all options every time; the
  297. options you specify will be merged into the current option settings,
  298. replacing their old values.  Upper/lower case is not significant.  The
  299. default option settings if you don't change anything are "TC, ON, B16, F0,
  300. E10, AY, DN, KY, SN, RN, P".
  301.  
  302.      If the comm program supports the xpr_options() call added in version
  303. 2.0 of the XPR spec, you should be prompted for each option with a nice
  304. prompt message such as "Text mode (Y,N,?,C):" and possibly be able to use
  305. Intuition string and/or button gadgets instead of being stuck with the
  306. semi-cryptic option string format described above.
  307.  
  308.  
  309.  
  310. 4.  Serial port settings
  311. ------------------------
  312.  
  313.      ZModem (at least this implementation of it) requires that your serial
  314. port be set to 8 data bits, no parity, 1 stop bit.  This allows ZModem to
  315. send full 8-bit binary data bytes without having them munged on the way
  316. through the modem.
  317.  
  318.      ZModem works well in all serial port handshaking modes; none,
  319. XON/XOFF, or 7-wire/RTS/CTS.  Since any or all of those handshaking modes
  320. may be appropriate at different times, with different modems or remote
  321. systems, XPRZModem lets you set the handshaking mode and doesn't mess with
  322. it.
  323.  
  324.  
  325.  
  326. 5.  Receiving files
  327. -------------------
  328.  
  329.      Once you get the ZModem options and your serial port configuration set
  330. up properly, you're ready to actually use this thing (gasp!).  Receiving
  331. files via ZModem is quite simple.  First, get the file sender going by
  332. using whatever command it wants.  ZModem is a batch file transfer protocol,
  333. meaning that it's capable of transferring several files in a single
  334. exchange, so the remote system may allow you to specify multiple files to
  335. be sent to you at one time.  It may also allow you to use wildcard
  336. characters in the filename(s); this is all system dependant.
  337.  
  338.      This may be all you have to do.  If you specified option AY
  339. (auto-activate on), and your comm program supports it, XPRZModem should
  340. automatically activate at this point and start receiving your files.  If
  341. you specified AN, or your comm program doesn't support auto-activation, you
  342. should now use whatever option your comm program provides to activate file
  343. reception; this will usually be a menu option or button gadget.  Either
  344. way, once XPRZModem starts receiving files, it should automatically receive
  345. all of the files you specified into the proper directory as indicated by
  346. the R and P options.
  347.  
  348.      Make sure that you have set the ZModem options properly before
  349. starting the transfer; especially, make sure you only use TY if you know
  350. that all of the files being transferred in this batch are printable ASCII
  351. text files.  If you use TY on normal binary files like .ARCs or .ZOOs,
  352. they'll be mangled beyond use.
  353.  
  354.  
  355.  
  356. 6.  Sending files
  357. -----------------
  358.  
  359.      Sending files using ZModem is fairly straightforward.  First, activate
  360. the file receiver with whatever command the remote system requires.  You
  361. may or may not need to specify a filename or directory to the remote
  362. system; this depends on their implementation of ZModem.  Once the remote
  363. system is ready to receive files, activate your comm program's ZModem send
  364. function.  Your comm program will prompt you for which file(s) to send.
  365. Although ZModem is a batch protocol, your comm program may or may not allow
  366. you to specify multiple file names to be sent; also, wildcards may or may
  367. not be supported.  These decisions are up to the comm program author;
  368. ZModem will handle multiple files and wildcards if the comm program allows
  369. them.  Once you've specified the file name(s), the file(s) will be sent to
  370. the remote system.  Note that the T option serves only as a suggestion to
  371. the receiving system when sending files; the receiver makes the final
  372. decision as to whether to take your advice or to force the files to be
  373. received in text or binary mode.
  374.  
  375.      If errors occur while sending the file(s), you'll probably notice a
  376. small enhancement I made to the normal ZModem error recovery procedures.
  377. Normally, file transfer protocols have to compromise between efficient data
  378. transmission on good, clean phone lines and quick error recovery on bad,
  379. noisy phone lines.  If you pick a large packet size, you get high
  380. throughput on clean lines due to low packet overhead, but you have slow
  381. recovery times and large amounts of retransmitted data on noisy lines.  If
  382. you've used YModem on noisy lines you've seen this problem.  But, if you
  383. use small packets to reduce retransmitted data on noisy lines, you increase
  384. the amount of time the protocol spends sending packet overhead, and your
  385. throughput suffers.  The solution is to vary the block size according to
  386. the experienced error rate during the transfer.  That way you aren't stuck
  387. with a rigid packet length which will sometimes be the wrong size no matter
  388. what.  I came up with this idea back when I first wrote the ZModem code for
  389. Opus, and cleared it for future compatibility with ZModem's designer, Chuck
  390. Forsberg, back then.  Since then the basic concept has been extensively
  391. tested in the Opus BBS system, and has proven quite effective; it has also
  392. been incorporated into various other ZModem implementations over time.  The
  393. actual algorithm for deciding what size packets to use when is pretty much
  394. up to the protocol author; XPRZModem uses a modified version of the Opus
  395. algorithm which prevents locking the packet size at a small value when a
  396. large one-time burst of errors occurs.
  397.  
  398.  
  399.  
  400. 7.  Notes for comm program authors
  401. ----------------------------------
  402.  
  403.      That's pretty much everything you need to know in order to use
  404. XPRZModem properly.  Here are some notes for the "other" XPR standard
  405. users, namely the comm program authors:
  406.  
  407.      Certain XPR callback functions *must* be implemented by the comm
  408. program author in order for XPRZModem to be used.  If any of these
  409. functions are not supported by your comm program, XPRZModem will display an
  410. error message and abort when invoked.  These required functions are:
  411.  
  412.           xpr_fopen(), xpr_fclose(), xpr_fread(), xpr_fwrite(),
  413.           xpr_fseek(), xpr_sread(), xpr_swrite(), and xpr_update()
  414.  
  415.      The xpr_update() function provides many data fields for your comm
  416. program to potentially display to the user.  These are the XPR_UPDATE
  417. struct elements which XPRZModem will keep updated during transfers:
  418.  
  419.           xpru_protocol, xpru_filename, xpru_filesize, xpru_msg,
  420.           xpru_errormsg, xpru_blocks, xpru_blocksize, xpru_bytes,
  421.           xpru_errors, xpru_timeouts, xpru_blockcheck, xpru_expecttime,
  422.           xpru_elapsedtime, and xpru_datarate
  423.  
  424.      As you can see, XPRZModem tries to provide as many status fields as
  425. possible.  Although all of them are useful, the ones which are most
  426. important to ZModem users are filename, filesize, msg and/or errormsg, and
  427. bytes.  Please try to provide at least these fields in your status display,
  428. plus as many of the rest as you can manage.
  429.  
  430.      Although only the XPR callback functions listed above are crucial for
  431. XPRZModem, almost all of them are used if they are provided.  Although
  432. XPRZModem will function without any of the other routines, its performance
  433. or capabilities may be degraded somewhat.  Specifically, this is what you
  434. give up if you choose not to supply any of these other XPR callback
  435. functions:
  436.  
  437.           xpr_sflush(): Used when performing error recovery and resync
  438.                when sending files.  If not provided, extra timeout errors
  439.                and delayed error recovery will be likely.  The files will
  440.                still be transferred properly, but errors will degrade
  441.                overall throughput more than usual.
  442.  
  443.           xpr_chkabort(): Called between sending or receiving packets.
  444.                If not provided, there's no way for your comm program user
  445.                to abort a transfer in progress except by trying to somehow
  446.                force it to decide to give up and abort on its own, such as
  447.                by turning off the modem and hoping the protocol will abort
  448.                after enough timeouts (it will, eventually...).
  449. |---
  450. |           xprzmodem.library supports several levels of abort. Sending
  451. |           an abort code > 0 will skip the current file, a code < 0
  452. |           will abort the entire file transfer.
  453. |---
  454.            xpr_gets(): Called to prompt the user interactively for options
  455.                when your comm program invokes XProtocolSetup() with a null
  456.                xpr_filename field (if xpr_options() isn't available
  457.                instead).  If not provided, you'll have to prompt
  458.                the user for the options string yourself, and pass this
  459.                string in xpr_filename when invoking XProtocolSetup().
  460.  
  461.            xpr_setserial(): Called to obtain the current serial port
  462.                settings.  If not provided, XPRZModem will
  463.                assume all transfers are being done at 2400 bps, which
  464.                won't hurt anything, and your users will have to make sure
  465.                that the serial port is set to 8N1 themselves.
  466.  
  467.            xpr_ffirst() and xpr_fnext(): If either of these routines are
  468.                missing, XPRZModem will lose the ability to send multiple
  469.                files in a batch.  The xpr_filename pointer passed to
  470.                XProtocolSend() will be assumed to point to the actual full
  471.                filename of the single file to be sent in this batch.  If
  472.                both of these routines are provided, XPRZModem will rely
  473.                upon them completely to obtain the names of the files to
  474.                send, and the xpr_filename pointer will not be used for any
  475.                purpose by XPRZModem except to be passed to ffirst/fnext.
  476.                This gives your comm program a way to send not just a single
  477.                filename template's worth of files in a batch, but a list of
  478.                different filenames.  If, for example, you set xpr_filename
  479.                to point to the first node of a linked list of filenames
  480.                and/or templates to be sent, rather than just having it
  481.                point to a string, you can have your ffirst and fnext
  482.                routines traverse this linked list in order to determine the
  483.                next file to be sent.  Or you could have xpr_filename point
  484.                to a buffer containing a list of filenames separated by
  485.                commas, and your ffirst/fnext routines could return each
  486.                filename in this list in turn.  The key here is that if you
  487.                provide these two routines, you're in complete control over
  488.                the series of names fed to XProtocolSend.  If you omit these
  489.                routines, XPRZModem is stuck with single-file mode.  Once
  490.                again, if these two routines are provided, XPRZModem will
  491.                *always* call them; it makes no attempt to use the
  492.                xpr_filename pointer for anything itself.  This is not
  493.                explicitly spelled out in the XPR standard, but it seems the
  494.                only reasonable way to handle batch protocols to me.
  495.                Hopefully other XPR library authors will follow this
  496.                precedent as well, so that comm program authors will be able
  497.                to count on multiple-filename batch sessions being handled
  498.                properly.
  499.  
  500.            xpr_finfo(): Used to determine the filesize of files being sent,
  501.                in order to tell the receiving system how big they are.
  502.                Also used to determine the size of a file which already
  503.                exists when in Overwrite Resume mode; XPRZModem must be able
  504.                to get the size of the current portion of the file in order
  505.                to be able to tell the sender where to resume sending from.
  506.                If this routine isn't provided, Overwrite Resume mode is
  507.                not allowed.  This routine is also used to check if Text
  508.                mode should be set to Y or N for each file when option TC
  509.                is set.
  510.  
  511.            xpr_options(): If you don't supply this, users will be stuck
  512.                with setting the library options via the semi-cryptic text
  513.                string method (ENV: and/or xpr_gets()).  This routine and
  514.                xpr_update() have a lot to do with the look and feel of your
  515.                program when using XPR libraries; any skimping on these two
  516.                routines will be painfully obvious to the user.  Conversely,
  517.                doing a nice job on these two routines will really make your
  518.                program shine.
  519.  
  520.            xpr_unlink(): Required by the DY and KN options, so if you don't
  521.                supply it, those options are not allowed.
  522.  
  523.  
  524.  
  525. 8.  The future
  526. --------------
  527.  
  528.      I don't want or expect this to be the last or only XPR ZModem library
  529. available.  There are a lot of less-commonly-used ZModem features which
  530. have popped up over the past few years, and many people might like to see
  531. some of them made available.  Such as 32-bit CRC (although I consider
  532. CRC-16 perfectly adequate for the max 1K packets sent by ZModem), full
  533. control-character escaping, or maybe 8th bit escaping to allow use of 7-bit
  534. serial channels.  I didn't want to add a bunch of rarely-used bells and
  535. whistles to this version of the library, because I want it to be able to
  536. serve as comprehensible example code.  I just want to provide a good solid
  537. ZModem which reliably handles the majority of people's needs.  Hopefully,
  538. this will serve as a foundation for future enhanced versions, while
  539. providing a safe fallback for people to come back to if that fancy new
  540. enhanced version (with neo-maxi zoomed weebies) turns out to need some more
  541. debugging.
  542.  
  543.      Bug reports, questions, or comments may be sent to me at:
  544.  
  545.           BIX: rahuebner
  546.           Compu$erve: 73105,1022
  547.  
  548.      Or, if you think it's important, and you want an answer in less than a
  549. week or two, call my BBS:
  550.  
  551.           The Wind Dragon Inn
  552.           1-402-291-8053, 300-9600+ bps, HST/V.32/V.42
  553.        or 1-402-291-3636, 300-2400 bps
  554.  
  555.      I check the messages on my BBS fairly often, so that's where to
  556. get ahold of me quick.  I'll also try and stock the latest XPR standard
  557. spec and XPR libraries there.
  558.  
  559. |---
  560. |    Any comments about the version 2.50 to 2.52 update code may be
  561. |    directed to me, William M. Perkins on BIX, with mail sent to
  562. |     wmperkins.
  563. |---
  564.  
  565. |---
  566. |    Any comments on v2.56 should be sent to olsen@sourcery.han.de,
  567. |    or if you prefer snail mail:
  568. |
  569. |        Olaf Barthel
  570. |        Brabeckstrasse 35
  571. |        D-30559 Hannover
  572. |        Federal Republic of Germany
  573. |---
  574.  
  575. 9.  The past (revision history)
  576. -------------------------------
  577. 1.0, 29 July 89:  Original release.
  578.  
  579.  
  580.  
  581. 1.1, 3 August 89:  Fixed zsdata() to send file data packet in one swrite()
  582. call instead of calling zsendline for every byte, to prevent hammering the
  583. serial.device with single-byte write requests during uploads, and to speed
  584. up effective data transmission rates.
  585.  
  586.  
  587.  
  588. 2.0, 28 October 89:  Converted from Manx to Lattice C 5.04.  Created
  589. prototypes and made other tweaks as required.  Designed new library skeleton
  590. for Lattice code, replacing the old Manx library skeleton.  Added new
  591. options TC, A, D, K, S, R, and P.  Added support for xpr_options() callback
  592. routine, and generally brought things up to par with XPR Spec 2.0.
  593.  
  594.  
  595.  
  596. 2.10, 12 February 91: Fixed the following generally minor problems:
  597.  
  598.   No longer munges A6 register (this was potentially serious), and added
  599. callback glue to ensure comm program can't munge OUR registers either.
  600. Decided that the protective glue was much safer than the more elegant direct
  601. invocation used in version 2.0.
  602.  
  603.   Slightly less transmission overhead (concatenates all output into single
  604. swrites, builds output packets a bit faster).
  605.  
  606.   Considerably less receive overhead; does a lot more waiting and a lot
  607. fewer sreads, especially at high speed.  WARNING: this change doesn't work
  608. with VLT version 4.846 or earlier (yes, Willy; it really was broken B-)).
  609. This change may or may not actually do you any good, depending upon how
  610. your comm program implements the xpr_sread() function.
  611.  
  612.   Fixed problems getting synchronized with some systems on uploads.
  613.  
  614.   No longer closes files twice.
  615.  
  616.   Now uses fully-reentrant sprintf() from amiga.lib; no more nasty BSS.
  617.  
  618.   A couple of obscure error messages were > 50 bytes long, causing problems
  619. with some comm program's transfer status windows, e.g. the infamouse VLT
  620. "Incredible Shrinking Status Window."
  621.  
  622.   Stabilized spastic data rate by computing elapsed time more accurately.
  623.  
  624.   Fixed sprintf() error which caused invalid filelength to be sent on uploads.
  625.  
  626.   Aligned all data for optimal performance on 68030++ CPUs (now that I have
  627. my A3000... B-)).  Doesn't really make any noticeable difference, but it
  628. makes us 68030 owners feel better anyway.  I'm also including a version of
  629. the library compiled for the 68020+ CPU, on the same principle.
  630.  
  631.   Now uses .DUP2 instead of .DUP.DUP, etc.
  632.  
  633.   Added config option E for number of errors which cause an abort.
  634.  
  635.   Fixed bogus IO_Torture false alarm concerning timer.device.
  636.  
  637.   Tried to fix an elusive Enforcer hit on reading location 0, but I'm not
  638. sure I really got it, since I had trouble reproducing the problem.
  639.  
  640. |---
  641. |    2.52 version, 6 March 1992: Recompile code for 68020 library code.
  642. |    Non-68020 code worked fine but John Tillema was not able to test
  643. |    the 2.51 68020 version.
  644. |
  645. |    2.51 version, 29 January 1992: Rxtimeout changed from 600 to 300
  646. |    for upload timeout problem by John Tillema.
  647. |
  648. |    2.50 version, 15 November 1991:  Added code to support 32 bit CRC
  649. |    (Circular Redundency Check).  CRC-32 adds a little more protection
  650. |    to the data being sent and received than does CRC-16.  Source for
  651. |    the CRC-32 additions came from the Unix version of RZ/SZ by Chuck
  652. |    Forsberg.
  653. |
  654. |    Added code to update_rate() function in utils.c to avoid the
  655. |    Guru # 80000005 if you decide to adjust the system clock during an
  656. |    upload or download from Daylight Saving Time to Standard Time.  :-)
  657. |
  658. |    Proto additions using libinit.o and libent.o, and eliminating all
  659. |    of the assembler code was supplied by Jim Cooper of SAS.  Jim
  660. |    also supplied the mysprintf() code to replace sprintf().  This
  661. |    version of XprZmodem can be compiled with the SAS version 5.10 C
  662. |    Compiler.  I do not know how well it might compile with the Aztec
  663. |    compiler.
  664. |
  665. |    THINGS TO DO
  666. |
  667. |    - Preserve date of file being transfered.
  668. |
  669. |    - Investigate possibility of saving file protection bits.
  670. |
  671. |    - Work out ways to increase the transfer speed.
  672. |
  673. |    - Additional changes as time and others may suggest.  :-)
  674. |
  675. |    -WMP-
  676. |---
  677.  
  678. |---
  679. |    Version 2.54, 28 June 1993, by Olaf `Olsen' Barthel: Got rid of the
  680. |    timer.c code, added OS 2.0 dependencies, rewrote update_rate() to
  681. |    display only the information which was really available, added
  682. |    control-code escaping & run-length encoding, changed the abort
  683. |    routine to pay attention to the different abort levels, removed
  684. |    SAS/C library dependencies (octal conversion, etc.), added
  685. |    support to transfer proper file creation date and access
  686. |    permission bits. The library texts were localized.
  687. |---
  688.  
  689. |---
  690. |       Version 2.56, 18 February 1995, by Olaf `Olsen' Barthel:
  691. |
  692. |       - The RLE and the maximum subpacket size options present in
  693. |         earlier releases were removed as they were either of little
  694. |         value or could cause serious problems.
  695. |
  696. |       - The protocol now properly pays attention to requests to abort
  697. |         transfers, i.e. if you tell it to stop the current send session
  698. |         in progress, it will transmit the zmodem cancel command and
  699. |         stop as soon as possible. The same applies to receive sessions.
  700. |
  701. |       - The zmodem skip command is implemented in a rather rudimentary
  702. |         fashion; although it appears to work the sender may have to
  703. |         abort the transfer manually.
  704. |
  705. |       - The receiver now pays attention to the zmodem cancel command
  706. |         and will flush the contents of the serial buffer upon error exit
  707. |         in order to avoid that leftover binary data spills over the
  708. |         terminal display.
  709. |
  710. |       - Added facilities to transfer and to honor file attributes and
  711. |         modification times. This feature actually goes beyond the original
  712. |         XPR specifications and thus may not work with all XPR hosts.
  713. |         Not all file attributes are transferred, as of this writing
  714. |         the W and D bits are merged into write access and the R and E
  715. |         bits are transferred `as is'. The `group' and `other' attributes
  716. |         as used by Envoy and the MultiUserFileSystem are also encoded
  717. |         and transferred. The modification time of files to send is treated
  718. |         as Unix local time and gets converted into GMT by adding the
  719. |         GMT offset found in the default locale (requires locale.library).
  720. |         For modification times received the process is reversed, i.e. the
  721. |         GMT timestamp is converted into local time.
  722. |
  723. |       - The transfer time and cps rate calculation was rewritten to take
  724. |         the actual number of bytes sent and received into account. Previous
  725. |         library releases would only look at how many bytes of a file were
  726. |         transferred so far. This meant that if you were resuming a file
  727. |         transfer or the remote requested that the local side should restart
  728. |         sending from an earlier file position, the cps rate would either
  729. |         suddenly skyrocket or drop flat to the ground, respectively.
  730. |
  731. |       - The library no longer calls xpr_setserial() to change the current
  732. |         serial parameters.
  733. |---
  734.