home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff330.lzh / XprKermit / kermitvar.h < prev    next >
C/C++ Source or Header  |  1990-03-02  |  5KB  |  123 lines

  1. /*
  2.  * kermitvar.h
  3.  */
  4.  
  5. /*
  6.  * In a fit of cleverness, here are some macro defines for variables we *
  7.  * aren't currently using. Only now we tell Lint to ignore constant    *
  8.  * Booleans!
  9.  */
  10. #define local 1        /* Local mode flag--that is, I'm on your end    */
  11. #define server 0    /* We are never server                */
  12. #define delay 0        /* Time to delay before sending first packet    */
  13. #define xpkt 0        /* Send X packet instead of F?            */
  14.  
  15. #define atcapb 8    /* Attribute capability bit            */
  16. #define swcapb 4    /* Sliding windows capability bit        */
  17. #define lpcapb 2    /* Long packets capability bit            */
  18. #define closif zclosi    /* I use closif() to close the input file in    *
  19.              * case it needs to be more complex later, but    *
  20.              * for now it just calls the z routine.        */
  21. /*
  22.  * Here are the variables which need to be set to startup values, and which
  23.  * also can be freely changed between protocol transfers.  At first I thought
  24.  * to declare them all "extern" in order to force definition elsewhere.
  25.  * On reflection, it makes sense to both declare them here and set them to
  26.  * their default startup values.  Thus they can be ignored outside of this
  27.  * module if you so desire.
  28.  *
  29.  * Note that the names are very systematic:  Names beginning with "r" have
  30.  * to do with values I use for received packets;  those beginning with "s"
  31.  * are values I use for sending packets.  Also note we set some, others are
  32.  * set for us.  I have made the ones we get in spar() static (local),
  33.  * and the ones we send in rpar() global.
  34.  *
  35.  * First the ints.
  36.  */
  37.  
  38. struct Vars {
  39.     struct XPR_IO io;
  40.     struct XPR_UPDATE xpru;
  41. int    cx,
  42.     cz,        /* Flags for aborting transfers.  cx (control-X)*
  43.              * is set to 1 if an abort of the current file    *
  44.              * is desired, cz (control-Z) if an abort of    *
  45.              * an entire batch transfer is desired.        */
  46.     rpsiz,        /* Maximum packet size                */
  47.             /* Like most of the receive packet parameters,    *
  48.              * this one is actually set by the sender.  But    *
  49.              * since the sender has the option to not send    *
  50.              * these, we must initialize to "reasonable"    *
  51.              * defaults.                    */
  52.     bctr,        /* Block check type to request.            */
  53.     limit,        /* Retry limit on receive            */
  54.     warn,        /* 1 for warn before overwriting files        */
  55.     rpadn,        /* Number of pad characters I require.        */
  56.     rtimo;        /* How long I want you to wait before you    *
  57.              * you time me out.                */
  58. char    rmark,        /* Start of packet marker for receive        */
  59.     reol,        /* End of packet marker for receive        */
  60.     start,        /* Start state                    */
  61.     sctlq,        /* Control character quote character for send    */
  62.     rpadc;        /* Pad character I want you to use        */
  63. /*
  64.  * Variables which MUST be set by the external interface.
  65.  */
  66. int
  67.     parity,        /* 0 for no parity--need for proper 8th-bit quote */
  68.     text,        /* Flag 1 for text file, 0 for binary file    */
  69.     urpsiz;        /* Maximum receive packet size user wants.    */
  70. char    *cmarg;        /* Character string containing Kermit server cmd */
  71. /*
  72.  * This block of defines is strictly internal flags of various kinds.    *
  73.  * I hope to Grid that I've got them all.  Someday this will be cleaner *
  74.  */
  75. int
  76.     spsiz,        /* Maximum send packet size            */
  77.     wsize,        /* Maximum window size                */
  78.     sndpkl,        /* Size of packet currently being attempted    */
  79.     filcnt,        /* Number of files transferred so far        */
  80.     bctu,        /* Block check type to use            */
  81.     rqf,        /* Flag for 8th bit quote negotiations        */
  82.     ebq,        /* 8th-bit prefix                */
  83.     ebqflg,        /* 8th-bit quoting flag                */
  84.     xflag,        /* Output to screen for generic server commands    */
  85.     rq,        /* Received 8bq bid                */
  86.     sq,        /* Sent 8bq bid                    */
  87.     rpt,        /* Repeat count                    */
  88.     rptq,        /* Repeat prefix                */
  89.     rptflg,        /* Repeat processing flag            */
  90.     capas,        /* Final position of inbound capas mask        */
  91.     atcapr,        /* Attribute capability requested        */
  92.     atcapu,        /* Attribute capability used            */
  93.     swcapr,        /* Sliding windows capability requested        */
  94.     swcapu,        /* Sliding windows capability used        */
  95.     lpcapr,        /* Long packets capability requested        */
  96.     lpcapu,        /* Long packets capability used            */
  97.     rsn,        /* Received sequence number            */
  98.     seq,        /* Current sequence number            */
  99.     maxsiz,        /* Maximum data size for packet            */
  100.     rln,        /* Length of received data field        */
  101.     size,        /* Current size of output packet data        */
  102.     osize,        /* Previous output packet data size        */
  103.     first,        /* Some kind of lookahead flag            */
  104.     stimo,        /* Timeout interval for me to use        */
  105.     spadn;        /* Number of pad characters for me to use    */
  106.  
  107. char
  108.     smark,        /* Start of packet marker for send        */
  109.     spadc,        /* Pad character to use on sending        */
  110.     seol,        /* End of packet marker for sending        */
  111.     rctlq,        /* Control character quote char for receiving    */
  112.     filnam[50],    /* Current file name                */
  113.     ssc,        /* Start server command                */
  114.     *sndpkt,    /* Send packet.                    */
  115.     *rcvpkt,    /* Receieve packet.                */
  116.     *data,        /* Data to send/receive before encode/decode    */
  117.     *rdatap,    /* Pointer to null-terminated data field    */
  118.     *isp,        /* Pointer to characters in memory        */
  119.     *osp;        /* Output string pointer            */
  120.  
  121. int     state;
  122. };
  123.