Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!apple!netcom!ward From: ward@netcom.UUCP (Mike Ward) Newsgroups: comp.os.minix Subject: XCOMM 2.2 for MINIX v1.3d (part 1) Keywords: terminal emulation, xmodem, cisb, phonelist, script Message-ID: <1273@netcom.UUCP> Date: 23 May 89 13:28:13 GMT Organization: NetCom Services - Public Access Unix System (408) 997-9175 guest Lines: 680 Greetings ... I was looking around for a communications program to use under MINIX V1.3 and found XCOMM 2.2 by Larry Gensch on the COMPUSERVE UNIX forum. It took a little hacking to get it to run properly under MINIX, and I haven't tested everything thouroughly, but the things I have tried seem to work, so I though it would be safe to post. (Please send me info on any problems you find). MINIX XCOMM 2.2 supports the XMODEM file transfer protocol with CRC or CHECKSUM error detection, CompuServe Information Service protocol B, text capturing, and a phone directory. It also comes with documentation (which I've updated to reflect the changes I made), and should be fairly compatable with XCOMM 2.2 which Larry will support. I'm posting the package in three shell archives. Enjoy ... cut below the dotted line and place it in a file (xc22pX.sh) and then run through the MINIX v1.3 shell: sh xc22pX.sh ------------------------------------------------------------------------------- echo x - historical.doc sed '/^X/s///' > historical.doc << '/' X X X C O M M R E V I S I O N H I S T O R Y X XVersion 2.2 MINIX mike ward 20 May 89 X Modified terminal mode special characters to IBM-PC ALT chars X Removed PUT_TAKE if defs and PUT_TAKE code X Removed HAVE_DUP2 if defs and DUP2 code X Removed HAVE_STRSTR if defs and STRSTR code X Removed DTR_DROPS_CARRIER if defs and associated code X Modified to use rather than however X XON/XOFF control is stubbed out since not controllable in RAW mode X Interruptability is not controllable in RAW mode X Removed text vs binary XMODEM transfers. Can only send/recieve XMODEM X one way. If you want to modify the file contents use a filter. X Modified open of /dev/tty to use w+, this required MINIX fopen mod X Removed reperences to getopt, opterr, optarg for command line args X Had to add fflush calls to get output to screen working in places X Had to shorten some external names to make them uniq in first 7/8 chars X s_set_* to ss_*, script_* to spt_* X Had to add code to define strdup X Added help message to terminal mode X Modified signal stuff since MINIX did not behave as expected X SIGALRM to SIGIOT X SIGUSR1 to SIGQUIT X SIGCLD to SIGHUP X added signal SIGHUP from child to parent on child termination X Modified erasln to use ^[[0K to erase to end of line X XVersion 2.2 larry gensch 12/8/87 Major code restructure X Reduced program and command options X Added SET command for setting various parameters X Added HANGUP command for disconnecting modem X Modified xccisb.c code to support CIS "Quick B" Protocol X Added xcscrpt.c code for processing script files X Added SCRIPT= parameter to phonebook processing (auto-logon scripts) X Added CIS parameter for CIS auto transfers X Added NL parameter for newline translation X Added HANGUP command from terminal mode X Added SCRIPT command from terminal mode X XVersion 2.1b larry gensch 11/11/87 Bug Fix release X (no bugs in the code, just some portability fixes) X Changed "sigset" in xccisb to "signal" X Removed #include from xcxmdm X XVersion 2.1a larry gensch 10/28/87 General Update X Added CIS "B" Protocol (c, ct commands) X Added BAUD= & BITS= parameters to phonelist file. X Switched some command letters X Revised command line parsing to use getopt() X XVersion 2.0 larry gensch 10/19/87 Revisions for System V.3 X Basically version 1.1 with minor modifications X XVersion 1.1 Eric E Coe 7/21/85 X Autodial for Hayes-compatible modem. X General rearranging of the code X XVersion 1.0 Eric E Coe 4/12/85 X Program created / echo x - phonelist.doc sed '/^X/s///' > phonelist.doc << '/' XFormat of the .phonelist file: X X1. The .phonelist must exist with the file name ".phonelist" either in the X current directory, or your home directory as defined by the $HOME X environment variable. The name of the phonelist file can be changed X using the SET PFILE command. X X2. The .phonelist file is ASCII text (lines of text separated by newlines). X It can be created and maintained using emacs, vi, or even ed. X X3. The first field of data in each line (after any whitespace and up to the X next occurance of whitespace) is assumed to be a phone number in a valid X format for the modem being dialed. X X4. Any text may follow the phone number. X X5. Special strings within each line: X X BITS=x (x=7|8) - Set the terminal mode mask to 7/8 bits. X BAUD=nnnn (n=300|1200|2400|4800|9600) - Set the baud rate to the X specified value X SCRIPT=file Immediately after sending the autodial string, execute the X script file specified. (Note that the specified filename is X CASE SENSITIVE!) X X6. A sample entry is shown below: X X 687-0374 CompuServe BITS=7 BAUD=1200, SCRIPT=cis.cmd X X The above entry indicates that the number to be dialed is 687-0374; the X bit mask is to be set to seven bits (ignore high bits), the baud rate is X to be set to 1200 baud, and commands are to be taken from the file X "compusrv.cmd" in either the current or home directory. X X A sample .phonelist file is included in the XCOMM source code X distribution. / echo x - readme sed '/^X/s///' > readme << '/' XXCOMM 2.2 MINIX: X XNew in this release... X X* Modified XCOMM command line interface X* CIS "Quick B" Protocol support for faster up/downloads X* Brand new script processor with integration into the phonebook X* Some code cleanup X* Better "vanilla" Unix support (thanks to bug reports) X XRefer to "historical.doc" for a list of ALL new features. X XXCOMM is a PUBLIC DOMAIN (not shareware) communication program that works on XUnix System V.3 (and MINIX). It probably works on other Unix systems with no Xmodification, since no machine specific coding was done. X XMINIX XCOMM is distributed in three bundles: X XXCM22P1.SH All documentation for XCOMM XXCM22P2.SH source code, header files, and makefile. XXCM22P3.SH source code X XThis README manifest file is included in both packages. X XContents of XCM22P1.SH: X Xreadme This manifest file Xscript.doc Quick reference to the XCOMM script language Xxcomm.doc Latest documentation for the XCOMM program Xhistorical.doc Historical information about versions 1.0 and 1.1 Xphonelist.doc Documentation on using XCOMM's phonelist X X XContents of XCM22SRC.SH: X Xreadme This manifest file Xinstall.doc Quick installation notes Xmakefile Make file for compiling XCOMM Xcis.cmd A sample XCOMM script file for logging onto CompuServe. X.phonelist A sample Phone List file Xxcomm.h XCOMM's header file Xxcxmdm.c XCOMM XMODEM protocol module Xxccisb.c XCOMM CIS-B/QuickB protocol module X X XContents of XCM22SRC.SH: X Xreadme This manifest file Xxcomm.c XCOMM main program Xxcport.c XCOMM Terminal I/O module Xxcscrpt.c XCOMM Script processor Xxcsubs.c XCOMM's subroutines Xxcterm.c XCOMM Terminal mode module / echo x - script.doc sed '/^X/s///' > script.doc << '/' X X XCOMM SCRIPT QUICK REFERENCE X XCOMM Release 2.2 X X X XIntroduction X X Script files can automate some tedious tasks such as logging into a X system. A script file is an Ascii text file and may be entered or X edited using any standard Unix text editor. X X The script file is read line by line. Empty lines (consisting of white X space only) are ignored. Comments are lines whose first non-space X character is a pound sign (#). X X The script processor reads each script line, ignoring leading white X space, into "words". A word is defined as either: X X - A sequence of characters delimited by white space; or X - A sequence of characters enclosed in single or double quotes. X X The first word of a script file is considered the "command word." X If the last character of the command word is a colon (:), the line is X considered to be a LABEL (the object of a GOTO statement). Otherwise, X it is assumed to be a script command and is interpreted as such. X Command words are case insensative. X X Some commands take one or more arguments. Each argument is parsed as a X single word as defined above. If blanks are required in an argument, X the argument MUST be quoted using single or double quotes. X X Enclosed in the XCOMM distribution is the file "compusrv.cmd". This is X an example script file (No, that is not really my user ID or my X password in that file!), and shows the use of most of the available X script commands. The script commands are self explanatory for the most X part. X X XStartup Scripts X X When XCOMM is started up, it looks for the file ".xcomm" in the current X or $HOME directory. If it is found, it is executed. This is useful for X setting your "basic" parameters without having to recompile XCOMM. For X example, your startup file may turn CIS mode off, set your baud X rate to 9600, and set 7BIT translation. X X XScript Command List X X Below is the description of all commands that may be used in the XCOMM X script language: X X XCAPTURE ON|OFF X X The command CAPTURE ON will open the capture command; all characters X received during WAITFOR processing will be appended to the capture file. X The command CAPTURE OFF will close the capture file. X X This setting does NOT currently extend to terminal mode. This may be X offered in a later release (probably through the SET command). X X XDIAL X X Dial the specified number. XCOMM supports generic "Hayes" compatible X modems for dialing. Note that this command requires an actual phone X number; the phonebook is not used for this function. X X XECHO ON|OFF X X If the argument to the ECHO command is ON, all subsequent command lines X that are processed will be displayed on the local screen. The exception X to this is lines containing a TRANSMIT command. These lines will just X print "TRANSMIT ...", so that passwords, etc. can be protected. X X If the argument to the ECHO command is OFF, scripts will execute X quietly (this is the default setting). X X XEXIT X X Terminate the script file prior to the end of file. Returns to terminal X mode. X X XGOTO