home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Workbench / Libs / XPRZ33.LHA / XprZMoDem.Library_v3.0 / XPrZMoDem.Doc < prev   
Encoding:
Text File  |  1993-08-13  |  34.2 KB  |  655 lines

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