home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / CKPM5X_S.ZIP / CKUUS2.C < prev    next >
C/C++ Source or Header  |  1990-03-04  |  28KB  |  885 lines

  1. /*  C K U U S 2  --  "User Interface" STRINGS module for Unix Kermit  */
  2.  
  3. /*
  4.  Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET),
  5.  Columbia University Center for Computing Activities.
  6.  First released January 1985.
  7.  Copyright (C) 1985, 1990, Trustees of Columbia University in the City of New 
  8.  York.  Permission is granted to any individual or institution to use, copy, or
  9.  redistribute this software so long as it is not sold for profit, provided this
  10.  copyright notice is retained. 
  11. */
  12.  
  13. /*  This module separates long strings from the body of the ckuser module. */  
  14.  
  15. #include <stdio.h>
  16. #include <ctype.h>
  17. #include "ckcdeb.h"
  18. #include "ckcasc.h"
  19. #include "ckcker.h"
  20. #include "ckucmd.h"
  21. #include "ckuusr.h"
  22. #include "ckcxla.h"
  23.  
  24. extern CHAR mystch, stchr, eol, seol, padch, mypadc, ctlq;
  25. extern CHAR *data, *rdatap, ttname[];
  26. extern char cmdbuf[], line[], debfil[], pktfil[], sesfil[], trafil[];
  27. extern int nrmt, nprm, dfloc, deblog, seslog, speed, local, parity, duplex;
  28. extern int turn, turnch, pktlog, tralog, mdmtyp, flow, cmask, timef, spsizf;
  29. extern int rtimo, timint, srvtim, npad, mypadn, bctr, delay;
  30. extern int maxtry, spsiz, urpsiz, maxsps, maxrps, ebqflg, ebq;
  31. extern int rptflg, rptq, fncnv, binary, pktlog, warn, quiet, fmask, keep;
  32. extern int tsecs, bctu, len, atcapu, lpcapu, swcapu, sq, rpsiz;
  33. extern int wslots, wslotsn, wslotsr, capas, atcapr;
  34. extern int spackets, rpackets, timeouts, retrans, crunched, wmax;
  35. extern int fcharset, tcharset, tslevel;
  36. extern int rptn, success, language, nlng;
  37. extern int xxstring();
  38.  
  39. extern long filcnt, tfc, tlci, tlco, ffc, flci, flco;
  40. extern char *dftty, *versio, *ckxsys;
  41. extern struct langinfo langs[];
  42. extern struct keytab prmtab[];
  43. extern struct keytab remcmd[];
  44. extern struct keytab lngtab[];
  45. extern struct csinfo fcsinfo[], tcsinfo[];
  46.  
  47. static
  48. char *hlp1[] = {
  49. "\n",
  50. "Usage: kermit [-x arg [-x arg]...[-yyy]..]]\n",
  51. "  -x is an option requiring an argument, -y an option with no argument:\n\n",
  52. "actions:\n",
  53. "  -s files  send files                    -r  receive files\n",
  54. "  -s -      send files from stdin         -k  receive files to stdout\n",
  55. "  -x        enter server mode             -f  finish remote server\n\n",
  56. "  -g files  get remote files from server (quote wildcards)\n",
  57. "  -a name   alternate name, used with -s, -r, -g\n",
  58. "  -c        connect (before file transfer), used with -l and -b\n",
  59. "  -n        connect (after file transfer), used with -l and -b\n\n",
  60. "settings:\n",
  61. "  -l line   communication line device     -q  quiet during file transfer\n",
  62. "  -b bps    line speed, e.g. 1200         -i  binary file transfer\n",
  63. "  -p x      parity, x = e,o,m,s, or n     -t  half duplex, xon handshake\n",
  64. "  -y name   alternate init file name      -d  log debug info to debug.log\n",
  65. "  -e n      receive packet length         -w  don't write over files\n\n",
  66. "If no action command is included, enter interactive dialog.\n",
  67. ""
  68. };
  69.  
  70. /*  U S A G E */
  71.  
  72. usage() {
  73.     conola(hlp1);
  74. }
  75.  
  76.  
  77. /*  Help string definitions  */
  78.  
  79. static char *tophlp[] = { "\n\
  80. Type ? for a list of commands, type 'help x' for any command x.\n\
  81. While typing commands, use the following special characters:\n\n\
  82.  DEL, RUBOUT, BACKSPACE, CTRL-H: Delete the most recent character typed.\n\
  83.  CTRL-W:  Delete the most recent word typed.\n",
  84.  
  85. "\
  86.  CTRL-U:  Delete the current line.\n\
  87.  CTRL-R:  Redisplay the current line.\n\
  88.  ?        (question mark) Display a menu for the current command field.\n\
  89.  ESC      (or TAB) Attempt to complete the current field.\n",
  90.  
  91. "\
  92.  \\        (backslash) include the following character literally.\n\n\
  93. From system level, type 'kermit -h' to get help about command line args.\
  94. \n",
  95. "" };
  96.  
  97. static char *hmxxbye = "\
  98. Shut down and log out a remote Kermit server";
  99.  
  100. static char *hmxxclo = "\
  101. Close one of the following logs:\n\
  102.  session, transaction, packet, debugging -- 'help log' for further info.";
  103.  
  104. static char *hmxxcon = "\
  105. Connect to a remote system via the tty device given in the\n\
  106. most recent 'set line' command";
  107.  
  108. static char *hmxxget = "\
  109. Format: 'get filespec'.  Tell the remote Kermit server to send the named\n\
  110. files.  If filespec is omitted, then you are prompted for the remote and\n\
  111. local filenames separately.";
  112.  
  113. static char *hmxxlg[] = { "\
  114. Record information in a log file:\n\n\
  115.  debugging             Debugging information, to help track down\n\
  116.   (default debug.log)  bugs in the C-Kermit program.\n\n\
  117.  packets               Kermit packets, to help track down protocol problems.\n\
  118.   (packet.log)\n\n",
  119.  
  120. " session               Terminal session, during CONNECT command.\n\
  121.   (session.log)\n\n\
  122.  transactions          Names and statistics about files transferred.\n\
  123.   (transact.log)\n",
  124. "" } ;
  125.  
  126.  
  127. static char *hmxxlogi[] = { "\
  128. Syntax: script text\n\n",
  129. "Login to a remote system using the text provided.  The login script\n",
  130. "is intended to operate similarly to uucp \"L.sys\" entries.\n",
  131. "A login script is a sequence of the form:\n\n",
  132. "   expect send [expect send] . . .\n\n",
  133. "where 'expect' is a prompt or message to be issued by the remote site, and\n",
  134. "'send' is the names, numbers, etc, to return.  The send may also be the\n",
  135. "keyword EOT, to send control-d, or BREAK, to send a break.  Letters in\n",
  136. "send may be prefixed by ~ to send special characters.  These are:\n",
  137. "~b backspace, ~s space, ~q '?', ~n linefeed, ~r return, ~c don\'t\n",
  138. "append a return, and ~o[o[o]] for octal of a character.  As with some \n",
  139. "uucp systems, sent strings are followed by ~r unless they end with ~c.\n\n",
  140. "Only the last 7 characters in each expect are matched.  A null expect,\n",
  141. "e.g. ~0 or two adjacent dashes, causes a short delay.  If you expect\n",
  142. "that a sequence might not arrive, as with uucp, conditional sequences\n",
  143. "may be expressed in the form:\n\n",
  144. "   -send-expect[-send-expect[...]]\n\n",
  145. "where dashed sequences are followed as long as previous expects fail.\n",
  146. "" };
  147.  
  148. static char *hmxxrc[] = { "\
  149. Format: 'receive [filespec]'.  Wait for a file to arrive from the other\n\
  150. Kermit, which must be given a 'send' command.  If the optional filespec is\n",
  151.  
  152. "given, the (first) incoming file will be stored under that name, otherwise\n\
  153. it will be stored under the name it arrives with.",
  154. "" } ;
  155.  
  156. static char *hmxxsen = "\
  157. Format: 'send file1 [file2]'.  File1 may contain wildcard characters '*' or\n\
  158. '?'.  If no wildcards, then file2 may be used to specify the name file1 is\n\
  159. sent under; if file2 is omitted, file1 is sent under its own name.";
  160.  
  161. static char *hmxxser = "\
  162. Enter server mode on the currently selected line.  All further commands\n\
  163. will be taken in packet form from the other Kermit program.";
  164.  
  165. static char *hmhset[] = { "\
  166. The 'set' command is used to establish various communication or file\n",
  167. "parameters.  The 'show' command can be used to display the values of\n",
  168. "'set' parameters.  Help is available for each individual parameter;\n",
  169. "type 'help set ?' to see what's available.\n",
  170. "" } ;
  171.  
  172. static char *hmxychkt[] = { "\
  173. Type of packet block check to be used for error detection, 1, 2, or 3.\n",
  174. "Type 1 is standard, and catches most errors.  Types 2 and 3 specify more\n",
  175. "rigorous checking at the cost of higher overhead.  Not all Kermit programs\n",
  176. "support types 2 and 3.\n",
  177. "" } ;
  178.  
  179.  
  180. static char *hmxyf[] = { "\
  181. set file: character-set, names, type, warning, display.\n\n",
  182. "'character-set' tells the encoding of the local file, ASCII by default.\n",
  183. "The names 'dutch', 'german', 'french', etc, refer to 7-bit ASCII-based\n",
  184. "national replacement character sets (NRC).  Latin-1 is the 8-bit ISO 8859\n", 
  185. "Latin Alphabet 1.\n\n",
  186. "'names' are normally 'converted', which means file names are converted\n",
  187. "to 'common form' during transmission; 'literal' means use filenames\n",
  188. "literally (useful between like systems).\n\n",
  189. "'type' is normally 'text', in which conversion is done between Unix\n",
  190. "newlines and CRLF line delimiters; 'binary' means to do no conversion.\n",
  191. "Use 'binary' for executable programs or binary data.\n\n",
  192. "'warning' is 'on' or 'off', normally off.  When off, incoming files will\n",
  193. "overwrite existing files of the same name.  When on, new names will be\n",
  194. "given to incoming files whose names are the same as existing files.\n",
  195. "\n\
  196. 'display' is normally 'on', causing file transfer progress to be displayed\n",
  197. "on your screen when in local mode.  'set display off' is useful for\n",
  198. "allowing file transfers to proceed in the background.\n\n",
  199. "" } ;
  200.  
  201. static char *hmhrmt[] = { "\
  202. The 'remote' command is used to send file management instructions to a\n",
  203. "remote Kermit server.  There should already be a Kermit running in server\n",
  204. "mode on the other end of the currently selected line.  Type 'remote ?' to\n",
  205. "see a list of available remote commands.  Type 'help remote x' to get\n",
  206. "further information about a particular remote command 'x'.\n",
  207. "" } ;
  208.  
  209.  
  210. /*  D O H L P  --  Give a help message  */
  211.  
  212. dohlp(xx) int xx; {
  213.     int x,y;
  214.  
  215.     if (xx < 0) return(xx);
  216.     switch (xx) {
  217.  
  218. case XXASS:             /* assign */
  219.     return(hmsg("\
  220. Syntax:  ASSIGN variablename string.\n\
  221. Example: ASSIGN \\%a My name is \\%b.\n\
  222. Assigns the current value of the string to the variable."));
  223.  
  224. case XXASK:             /* ask */
  225.     return(hmsg("\
  226. Syntax:  ASK variablename prompt\n\
  227. Example: ASK %n What is your name\\63\\32\n\
  228. Issues the prompt and defines the variable to be whatever you type in."));
  229.  
  230. case XXASKQ:
  231.     puts("\
  232. Syntax:  ASKQ variablename prompt");
  233.     puts("\
  234. Example: ASKQ %p Password:");
  235.     puts("\
  236. Issues the prompt and defines the variable to be whatever you type in.");
  237.     puts("\
  238. The characters that you type do not echo on the screen.");
  239.     return(0);
  240.  
  241. case XXBYE:             /* bye */
  242.     return(hmsg(hmxxbye));
  243.  
  244. case XXCLE:             /* clear */
  245.     return(hmsg("\
  246. Clear the serial port input buffer."));
  247.  
  248. case XXCLO:             /* close */
  249.     return(hmsg(hmxxclo));
  250.  
  251. case XXCOM:             /* comment */
  252.     return(hmsg("\
  253. Introduce a comment.  Beginning of command line only."));
  254.  
  255. case XXCON:             /* connect */
  256.     return(hmsg(hmxxcon));
  257.  
  258. case XXCWD:             /* cd / cwd */
  259. #ifdef vms
  260.     return(hmsg("\
  261. Change Working Directory, equivalent to VMS SET DEFAULT command"));
  262. #else
  263. #ifdef datageneral
  264.     return(hmsg("Change Working Directory, equivalent to DG 'dir' command"));
  265. #else
  266. #ifdef OS2
  267.    return(hmsg("Change Working Directory, equivalent to OS2 'chdir' command"));
  268. #else
  269.     return(hmsg("Change Working Directory, equivalent to Unix 'cd' command"));
  270. #endif
  271. #endif
  272. #endif
  273.  
  274. case XXDEF:             /* define */
  275.     puts("\
  276. Syntax: DEFINE name command, command, command, ...");
  277.     puts("\
  278. Defines a Kermit command macro called 'name'.  The definition is");
  279.     puts("\
  280. a comma-separated list of Kermit commands.  Use the DO command to");
  281.     puts("\
  282. execute the macro, or just type its name, followed optionally by arguments.");
  283.     return(0);
  284.  
  285. case XXDEL:             /* delete */
  286.     return(hmsg("Delete a local file or files"));
  287.  
  288. case XXDIAL:                /* dial */
  289.     return(hmsg("\
  290. Dial a number using modem autodialer.  First you must SET MODEM, then\n\
  291. SET LINE and SET SPEED.  Then just type the DIAL command, followed by\n\
  292. the phone number."));
  293.  
  294. case XXDIR:             /* directory */
  295.     return(hmsg("Display a directory of local files"));
  296.  
  297. case XXDO:              /* do */
  298.     return(hmsg("Execute a macro that was defined by the DEFINE command.\n\
  299. The word DO can be omitted.  Trailing arguments, if any, are automatically\n\
  300. assigned to the parameters \\%1, \\%2, etc."));
  301.  
  302. case XXDEC:
  303.    puts("\
  304. Decrement (subtract one from) the value of a \\% variable if the value is"); 
  305.    puts("\
  306. currently numeric.");
  307.     return(0);
  308.  
  309. case XXECH:             /* echo */
  310.     return(hmsg("Display the rest of the command on the terminal,\n\
  311. useful in command files.  Echo string may contain backslash codes."));
  312.  
  313. case XXEND:             /* end */
  314.     return(hmsg("\
  315. Exit from the current macro or TAKE file, back to wherever invoked from."));
  316.  
  317. case XXEXI:             /* exit */
  318. case XXQUI:
  319.     return(hmsg("Exit from the Kermit program, closing any open logs."));
  320.  
  321. case XXEXE:
  322.     puts("\
  323. Syntax: EVALUATE text");
  324.     puts("\
  325. Evaluate all the variables and other backslash escapes in the text, and");
  326.     puts("\
  327. then attempt to execute the result as a Kermit command");
  328.     return(0);
  329.  
  330. case XXFIN:
  331.     return(hmsg("\
  332. Tell the remote Kermit server to shut down without logging out."));
  333.  
  334. case XXGET:
  335.     return(hmsg(hmxxget));
  336.  
  337. case XXGOTO:
  338.     return(hmsg("\
  339. In a TAKE file or macro, go to the given label.  A label is a word on the\n\
  340. left margin that starts with a colon (:)."));
  341.  
  342. case XXHAN:
  343.     return(hmsg("Hang up the phone."));    
  344.  
  345. case XXHLP:
  346.     return(hmsga(tophlp));
  347.  
  348. case XXIF:
  349.     puts("\
  350. Syntax: IF [NOT] condition command");
  351.     puts("\
  352. If the condition is (is not) true, do the command.  Conditions are");
  353.     puts("\
  354. SUCCESS, FAILURE, DEFINED (variable or macro), COUNT (loop), EXIST (file),");
  355.     puts("\
  356. EQUAL (strings), = (numbers or numeric variables), < (ditto), > (ditto).");
  357.     return(0);
  358.  
  359. case XXINC:
  360.    puts("\
  361. Increment (add one to) the value of a \\% variable if the value is currently");
  362.    puts("\
  363. numeric.");
  364.     return(0);
  365.  
  366. case XXINP:
  367.    return(hmsg("\
  368. Syntax: INPUT n string\n\
  369. Wait up to n seconds for the string to arrive on the communication line.\n\
  370. For use with IF FAILURE and IF SUCCESS."));
  371.  
  372. case XXREI:
  373.     return(hmsg("\
  374. Syntax: REINPUT n string\n\
  375. Look for the string in the text that has recently been INPUT, set SUCCESS\n\
  376. or FAILURE accordingly.  Timeout, n, must be specified but is ignored."));
  377.  
  378. case XXLBL:
  379.     return(hmsg("\
  380. Introduce a label, like :loop, for use with GOTO in TAKE files or macros."));
  381.  
  382. case XXLOG:
  383.     return(hmsga(hmxxlg));
  384.  
  385. case XXLOGI:
  386.     return(hmsga(hmxxlogi));
  387.  
  388. case XXOUT:
  389.     return(hmsg("\
  390. Send the string out the currently selected line, as if you had typed it\n\
  391. during CONNECT mode."));
  392.  
  393. case XXPAU:
  394.     puts("\
  395. Syntax:  PAUSE n");
  396.     puts("\
  397. Example: PAUSE 3");
  398.     puts("\
  399. Do nothing for the specified number of seconds.");
  400.     puts("\
  401. If interrupted from the keyboard, set FAILURE, otherwise set SUCCESS.");
  402.     return(0);
  403.  
  404. case XXPWD:
  405.     return(hmsg("Print the name of my current working directory."));
  406.  
  407. case XXREC:
  408.     return(hmsga(hmxxrc));
  409.  
  410. case XXREM:
  411.     if ((y = cmkey(remcmd,nrmt,"Remote command","",xxstring)) == -2) return(y);
  412.     if (y == -1) return(y);
  413.     if ((x = cmcfm()) < 0) return(x);
  414.     return(dohrmt(y));
  415.  
  416. case XXSEN:
  417.     return(hmsg(hmxxsen));
  418.  
  419. case XXSER:
  420.     return(hmsg(hmxxser));
  421.  
  422. case XXSET:
  423.     if ((y = cmkey(prmtab,nprm,"Parameter","",xxstring)) == -2) return(y);
  424.     if (y == -2) return(y);
  425.     if ((x = cmcfm()) < 0) return(x);
  426.     return(dohset(y));
  427.  
  428. case XXSHE:
  429. #ifdef vms
  430.     return(hmsg("\
  431. Issue a command to VMS."));
  432. #else
  433. #ifdef AMIGA
  434.     return(hmsg("\
  435. Issue a command to CLI."));
  436. #else
  437. #ifdef datageneral
  438.     return(hmsg("\
  439. Issue a command to the CLI."));
  440. #else
  441. #ifdef OS2
  442.     return(hmsg("\
  443. Issue a command to CMD.EXE."));
  444. #else
  445.     return(hmsg("\
  446. Issue a command to the Unix shell."));
  447. #endif
  448. #endif
  449. #endif
  450. #endif
  451.  
  452. case XXSHO:
  453.     return(hmsg("\
  454. Display current values of various categories of SET parameters.\n\
  455. Type SHOW ? for a list of categories."));
  456.  
  457. case XXSPA:
  458. #ifdef datageneral
  459.     return(hmsg("\
  460. Display disk usage in current device, directory,\n\
  461. or return space for a specified device, directory."));
  462. #else
  463.     return(hmsg("Display disk usage in current device, directory"));
  464. #endif
  465.  
  466. case XXSTA:
  467.     return(hmsg("Display statistics about most recent file transfer"));
  468.  
  469. case XXSTO:
  470.     return(hmsg("\
  471. Stop executing the current macro or TAKE file and return immediately\n\
  472. to the C-Kermit prompt."));
  473.  
  474. case XXTAK:
  475.     return(hmsg("\
  476. Take Kermit commands from the named file.  Kermit command files may\n\
  477. themselves contain 'take' commands, up to a reasonable depth of nesting."));
  478.  
  479. case XXTRA:
  480.     puts("\
  481. Syntax: TRANSMIT file n\n\
  482. Raw upload. Send a file, a line at a time (text) or a character at a time.");
  483.     puts("\
  484. For text, wait for turnaround character after each line.");
  485.     puts("\
  486. n = decimal ASCII value of turnaround character, 10 (linefeed) by default.");
  487.     puts("\
  488. Specify 0 for no waiting.  TRANSMIT may be interrupted by Ctrl-C.");
  489.     return(0);
  490.  
  491. case XXTYP:
  492.     return(hmsg("\
  493. Display a file on the screen.  Pauses if you type Ctrl-S, resumes if you\n\
  494. type Ctrl-Q, returns immediately to C-Kermit prompt if you type Ctrl-C."
  495. ));
  496.  
  497. case XXXLA:
  498.     puts("\
  499. Syntax: TRANSLATE file1 file2");
  500.     puts("\
  501. Translates file1 from the character set named in the most recent");
  502.     puts("\
  503. 'set file character-set' command into the character set named in the most");
  504.     puts("\
  505. recent 'set transfer character-set' command, storing the result in file2.");
  506.     return(0);
  507.  
  508. case XXVER:
  509.     puts("Displays the program version number.");
  510.     return(0);
  511.  
  512. case XXWAI:
  513.     puts("\
  514. Syntax:  WAIT n [modem-signal(s)]");
  515.     puts("\
  516. Example: WAIT 5 \\cd\\cts");
  517.     puts("\
  518.  Waits up to the given number of seconds for all of the specified signals.");
  519.     puts("\
  520.  Sets FAILURE if signals do not appear in given time or if interrupted by");
  521.     puts("\
  522.  typing anything at the keyboard during the waiting period.");
  523.     puts("\
  524. Signals: \\cd = Carrier Detect, \\dsr = Dataset Ready, \\cts = Clear To Send");
  525.     puts("\
  526. Warning: This command does not work yet, signals are ignored.");
  527.     return(0);
  528.  
  529. default:
  530.     if ((x = cmcfm()) < 0) return(x);
  531.     printf("Not available yet - %s\n",cmdbuf);
  532.     break;
  533.     }
  534.     return(success = 0);
  535. }
  536.  
  537.  
  538. /*  H M S G  --  Get confirmation, then print the given message  */
  539.  
  540. hmsg(s) char *s; {
  541.     int x;
  542.     if ((x = cmcfm()) < 0) return(x);
  543.     puts(s);
  544.     return(0);
  545. }
  546.  
  547. hmsga(s) char *s[]; {           /* Same function, but for arrays */
  548.     int x, i;
  549.     if ((x = cmcfm()) < 0) return(x);
  550.     for ( i = 0; *s[i] ; i++ ) /* fputs(s[i], stdout); */
  551.       printf("%s",s[i]);
  552.     printf("\n");
  553.     return(0);
  554. }
  555.  
  556.  
  557. /*  D O H S E T  --  Give help for SET command  */
  558.  
  559. dohset(xx) int xx; {
  560.     
  561.     if (xx == -3) return(hmsga(hmhset));
  562.     if (xx < 0) return(xx);
  563.     switch (xx) {
  564.  
  565. case XYATTR:
  566.     puts("Turn Attribute packet exchange off or on");
  567.     return(0);
  568.  
  569. case XYIFD:
  570.     puts("Discard or Keep incompletely received files, default is discard");
  571.     return(0);
  572.  
  573. case XYINPU:
  574.     puts("The SET INPUT command controls the behavior of the INPUT command.");
  575.     puts("SET INPUT CASE { IGNORE, OBSERVE }");
  576.     puts("\
  577.   Tells whether alphabetic case is to be significant in string comparisons.");
  578.     puts("SET INPUT DEFAULT-TIMEOUT secs");
  579.     puts("\
  580.   Establishes default timeout for INPUT commands.  Currently has no effect.");
  581.     puts("SET INPUT ECHO { ON, OFF }");
  582.     puts("\
  583.   Tells whether to display arriving characters read by INPUT on the screen.");
  584.     puts("SET INPUT TIMEOUT-ACTION { PROCEED, QUIT }");
  585.     puts("\
  586.   Tells whether to proceed or quit from a script program if an INPUT command");
  587.     puts("\
  588.   fails.  PROCEED allows the use of IF SUCCESS and IF FAILURE commands.");
  589.     return(0);
  590.  
  591. case XYCHKT:
  592.     return(hmsga(hmxychkt));
  593.  
  594. case XYCOUN:
  595.     return(hmsg("\
  596. Set up a loop counter, for use with IF COUNT."));
  597.  
  598. case XYDELA: 
  599.     puts("\
  600. Number of seconds to wait before sending first packet after 'send' command.");
  601.     return(0);
  602.  
  603. case XYTAKE:
  604.     puts("\
  605. Controls behavior of TAKE command.  SET TAKE ECHO { ON, OFF } tells whether");
  606.     puts("\
  607. commands read from a TAKE file should be displayed on the screen.");
  608.     puts("\
  609. SET TAKE ERROR { ON, OFF } tells whether a TAKE command file should be");
  610.     puts("\
  611. automatically terminated upon a command error.");
  612.     return(0);
  613.  
  614. case XYTERM:
  615. #ifdef OS2
  616.     puts("\
  617. 'SET TERMINAL BYTESIZE 7 or 8'   to use 7- or 8-bit terminal characters.\n\
  618. 'SET TERMINAL VT100 or TEK4014'  to set terminal emulation mode.\n");
  619. #else
  620.     puts("\
  621. 'set terminal bytesize 7 or 8' to use 7- or 8-bit terminal characters.");
  622. #endif
  623.     return(0);
  624.  
  625. case XYDUPL:
  626.     puts("\
  627. During 'connect': 'full' means remote host echoes, 'half' means this program");
  628.     puts("does its own echoing.");
  629.     return(0);
  630.  
  631. case XYESC:
  632.     printf("%s","\
  633. Decimal ASCII value for escape character during 'connect', normally 28\n\
  634. (Control-\\)\n");
  635.     return(0);
  636.  
  637. case XYFILE:
  638.     return(hmsga(hmxyf));
  639.  
  640. case XYFLOW:
  641. #ifdef OS2
  642.     puts("Sets both the flow control and hardware handshaking parameters.\n");
  643.     puts("The choices for flow control are;\n");
  644.     puts("  'none' 'xon/xoff'\n");
  645.     puts("and for hardware handshaking;\n");
  646.     puts("  'odsr' 'idsr' 'ocsr'       These can be set 'on' or 'off'\n");
  647. #else
  648.     puts("\
  649. Type of flow control to be used.  Choices are 'xon/xoff' and 'none'.");
  650.     puts("normally xon/xoff.");
  651. #endif 
  652.     return(0);
  653. case XYHAND:
  654.     puts("\
  655. Decimal ASCII value for character to use for half duplex line turnaround");
  656.     puts("handshake.  Normally, handshaking is not done.");
  657.     return(0);
  658.  
  659. #ifdef NETCONN
  660. case XYNETW:
  661.     puts("\
  662. Select a TCP/IP network host.  Use this command instead of SET LINE.");
  663.     puts("\
  664. After SET HOST give the hostname or IP host number, followed optionally");
  665.     puts("\
  666. by a colon and a service name or socket number (default is telnet)");
  667.     return(0);
  668. #endif /* NETCONN */
  669.  
  670. case XYLANG:
  671.     puts("Select the language for text-mode file transfer.");
  672.     puts("\
  673. Equivalent to 'set file character-set', except that 'set language'");
  674.     puts("\
  675. also selects the appropriate transfer character set for the given");
  676.     puts("\
  677. language.  If you specify 'english' or 'ascii', the transfer-syntax");
  678.     puts("\
  679. character-set will be ASCII, otherwise it will be Latin-1.");
  680.     return(0);
  681.  
  682. case XYLINE:
  683.     printf("\
  684. Device name of communication line to use.  Normally %s.\n",dftty);
  685.     if (!dfloc) {
  686.     printf("\
  687. If you set the line to other than %s, then Kermit\n",dftty);
  688.     printf("\
  689. will be in 'local' mode; 'set line' will reset Kermit to remote mode.\n");
  690.     puts("\
  691. If the line has a modem, and if the modem-dialer is set to direct, this");
  692.     puts("\
  693. command causes waiting for a carrier detect (e.g. on a hayes type modem).");
  694.     puts("\
  695. This can be used to wait for incoming calls.");
  696.     puts("\
  697. To use the modem to dial out, first set modem-dialer (e.g., to hayes), then");
  698.     puts("set line, next issue the dial command, and finally connect.");
  699.     }
  700.     return(0);
  701.  
  702. case XYMACR:
  703.     puts("\
  704. Controls the behavior of macros.  SET MACRO ECHO { ON, OFF } tells whether");
  705.     puts("\
  706. commands executed from a macro definition should be displayed on the screen.");
  707.     puts("\
  708. SET MACRO ERROR { ON, OFF } tells whether a macro should be automatically");
  709.     puts("\
  710. terminated upon a command error.");
  711.     return(0);
  712.  
  713. case XYMODM:
  714.     puts("\
  715. Type of modem for dialing remote connections.  Needed to indicate modem can");
  716.     puts("\
  717. be commanded to dial without 'carrier detect' from modem.  Many recently");
  718.     puts("\
  719. manufactured modems use 'hayes' protocol.  Type 'set modem ?' to see what");
  720.     puts("\
  721. types of modems are supported by this program.");
  722.     return(0);
  723.  
  724.  
  725. case XYPARI:
  726.     puts("Parity to use during terminal connection and file transfer:");
  727.     puts("even, odd, mark, space, or none.  Normally none.");
  728.     return(0);
  729.  
  730. case XYPROM:
  731.     puts("Prompt string for this program, normally 'C-Kermit>'.");
  732.     return(0);
  733.  
  734. case XYRETR:
  735.     puts("\
  736. How many times to retransmit a particular packet before giving up");
  737.     return(0);
  738.  
  739. case XYSPEE:
  740.     puts("\
  741. Communication line speed for external tty line specified in most recent");
  742. #ifdef AMIGA
  743.     puts("\
  744. 'set line' command.  Any baud rate between 110 and 292000, although you");
  745.     puts(" will receive a warning if you do not use a standard baud rate:");
  746.     puts("\
  747. 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600.");
  748. #else
  749. #ifdef datageneral
  750.     puts("\
  751. 'set line' command.  Any of the common baud rates:");
  752.     puts(" 0, 50, 75, 110, 134, 150, 300, 600, 1200, 1800, ");
  753.     puts(" 2400, 3600, 7200, 4800, 9600, 19200, 38400.");
  754. #else
  755.     puts("\
  756. 'set line' command.  Any of the common baud rates:");
  757. #ifdef OS2
  758.     puts(" 0, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200.");
  759.     puts("The highest speed available is hardware-dependant");
  760. #else
  761.     puts(" 0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200.");
  762. #endif
  763. #endif
  764. #endif
  765.     return(0);
  766.  
  767. case XYRECV:
  768.     puts("\
  769. Specify parameters for inbound packets:");
  770.     puts("\
  771. End-Of-Packet (ASCII value), Packet-Length (1000 or less),");
  772.     puts("\
  773. Padding (amount, 94 or less), Pad-Character (ASCII value),");
  774.     puts("\
  775. Start-Of-Packet (ASCII value), and Timeout (94 seconds or less),");
  776.     puts("\
  777. all specified as decimal numbers.");
  778.     return(0);
  779.  
  780. case XYSEND:
  781.     puts("\
  782. Specify parameters for outbound packets:");
  783.     puts("\
  784. End-Of-Packet (ASCII value), Packet-Length (2000 or less),");
  785.     puts("\
  786. Padding (amount, 94 or less), Pad-Character (ASCII value),");
  787.     puts("\
  788. Start-Of-Packet (ASCII value), and Timeout (94 seconds or less),");
  789.     puts("\
  790. all specified as decimal numbers.");
  791.     return(0);
  792.  
  793. case XYSERV:
  794.     puts("server timeout:");
  795.     puts("\
  796. Server command wait timeout interval, how often the C-Kermit server issues");
  797.     puts("\
  798. a NAK while waiting for a command packet.  Specify 0 for no NAKs at all.");
  799.     return(0);
  800.  
  801. case XYUNCS:
  802.    return(hmsg("\
  803. DISCARD (default) means reject any arriving files encoded in unknown\n\
  804. character sets.  KEEP means to accept them anyway."));
  805.  
  806. case XYWIND:
  807.     puts("window slots for sliding windows:");
  808.     puts("\
  809. How many packets can be transmitted before pausing for acknowledgement.");
  810.     puts("\
  811. Default is one, maximum is 31.  Large window size may result in reduction");
  812.     puts("\
  813. of packet length.  Use sliding windows for increased efficiency on");
  814.     puts("\
  815. connections with long delays.");
  816.     return(0);
  817.  
  818. case XYXFER:
  819.     puts("Select the presentation of textual data in Kermit packets:");
  820.     puts("\
  821. normal: ASCII text, lines terminated by CRLF.");
  822.     puts("\
  823. character-set <name>: a single character set other than ASCII, such as");
  824.     puts("\
  825. ISO 8859-1 Latin Alphabet 1 ('latin-1').");
  826.     puts("\
  827. international: a mixture of character sets (not yet implemented).");
  828.     return(0);
  829.  
  830. default:
  831.     printf("Not available yet - %s\n",cmdbuf);
  832.     return(0);
  833.     }
  834. }
  835.  
  836.  
  837. /*  D O H R M T  --  Give help about REMOTE command  */
  838.  
  839. dohrmt(xx) int xx; {
  840.     int x;
  841.     if (xx == -3) return(hmsga(hmhrmt));
  842.     if (xx < 0) return(xx);
  843.     switch (xx) {
  844.  
  845. case XZCWD:
  846.     return(hmsg("\
  847. Ask remote Kermit server to change its working directory."));
  848.  
  849. case XZDEL:
  850.     return(hmsg("\
  851. Ask remote Kermit server to delete the named file(s)."));
  852.  
  853. case XZDIR:
  854.     return(hmsg("\
  855. Ask remote Kermit server to provide directory listing of the named file(s)."));
  856.  
  857. case XZHLP:
  858.     return(hmsg("\
  859. Ask remote Kermit server to tell you what services it provides."));
  860.  
  861. case XZHOS:
  862.     return(hmsg("\
  863. Send a command to the remote system in its own command language\n\
  864. through the remote Kermit server."));
  865.  
  866. case XZSPA:
  867.     return(hmsg("\
  868. Ask the remote Kermit server to tell you about its disk space."));
  869.  
  870. case XZTYP:
  871.     return(hmsg("\
  872. Ask the remote Kermit server to type the named file(s) on your screen."));
  873.  
  874. case XZWHO:
  875.     return(hmsg("\
  876. Ask the remote Kermit server to list who's logged in, or to give information\n\
  877. about the specified user."));
  878.  
  879. default:
  880.     if ((x = cmcfm()) < 0) return(x);
  881.     printf("not working yet - %s\n",cmdbuf);
  882.     return(-2);
  883.     }
  884. }
  885.