📄 ckcplm.doc
字号:
MAXFCSETS by 1. Then, in CK?XLA.C: . Add a barbarian entry into the fcsinfo array. . Add a "barbarian" entry to file character set keyword table, fcstab. . Add a "barbarian" entry to terminal character set keyword table, ttcstab. . Add a translation table from Latin-1 to barbarian: yl1ba[]. . Add a translation table from barbarian to Latin-1: ybal1[]. . Add a translation function from Barbarian to ASCII: xbaas(). . Add a translation function from Barbarian to Latin-1: xbal1(). . Add a translation function from Latin-1 to Barbarian: xl1ba(). . etc etc for each transfer character set... . Add translation function pointers to the xls and xlr tables. Other translations involving Barbarian (e.g. from Barbarian to Latin-Cyrillic) are performed through these tables and functions. See CKUXLA.H and CKUXLA.C for extensive examples.GROUP 2:The user interface. This is the code that communicates with the user, getsher commands, informs her of the results. It may be command-line oriented,interactive prompting dialog, menus and arrow keys, windows and mice, speechrecognition, telepathy, etc. The user interface has three major functions:1. Sets the parameters for the file transfer and then starts it. This is doneby setting certain (many) global variables, such as the protocol machine startstate, the file specification, file type, communication parameters, packetlength, window size, character set, etc.2. Displays messages on the user's screen during the file transfer, using thescreen() function, which is called by the group-1 modules.3. Executes any commands directly that do not require Kermit protocol, suchas the CONNECT command, local file management commands, parameter-settingcommands, etc.If you plan to imbed the Group 1 files into a program with a different userinterface, your interface must supply an appropriate screen() function, plus acouple related ones like chkint() and intmsg() for handling keyboard (ormouse, etc) interruptions during file transfer. The best way to find outabout this is to link all the C-Kermit modules together except the CKUU*.Oand CKUCON.O modules, and see which missing symbols turn up.C-Kermit's character-oriented user interface (as opposed to the Macintoshversion's graphical user interface) consists of the following modules.C-Kermit can be built with an interactive command parser, a command-line-option-only parser, a graphical user interface, or any combination, and itcan even be built with no user interface at all (in which case it runs as aremote-mode Kermit server). CKUUSR.H - Definitions of symbols used in Kermit's commands. CKUUSR.H, CKUUSR.C, CKUUS2.C, CKUUS3.C, CKUUS4.C, CKUUS5.C, ... - Kermit's interactive command parser, including the script programming language. CKUUSY.C - The command-line-option parser. CKUUSX.C - Functions that are common to both the interactive and command-line parsers. CKUCMD.H, CKUCMD.C - The command parsing primitives used by the interactive command parser to parse keywords, numbers, filenames, etc, and to give help, complete fields, supply defaults, allow abbreviations and editing, etc. This package is totally independent of Kermit, but does depend on the Group 3 functions. CKUVER.H - Version heralds for different implementations. CKUSCR.C - The (old, uucp-like) SCRIPT command. CKUDIA.C - The DIAL command. Includes specific knowledge of many types of modems. CK?CON.C - The CONNECT command. Terminal connection, and in some cases (Macintosh, OS/2) also terminal emulation.For other implementations, the files may, and probably do, have differentnames. For example, the Macintosh graphical user interface filenames startwith CKM. OS/2 uses the CKUCMD and CKUUS* modules, but has its own CONNECTcommand in CKOCON.C. And so on.Here is a brief description of C-Kermit's "user interface interface", from CKUUSR.C. It is nowhere near complete; in particular, hundreds of globalvariables are shared among the many modules. These should, some day, becollected into classes or structures that can be passed around as needed;not only for purity's sake, but also to allow for multiple simultaneouscommunication sessions.The ckuus*.c modules depend on the existence of C library features like fopen,fgets, feof, (f)printf, argv/argc, etc. Other functions that are likely tovary among operating systems -- like setting terminal modes or interrupts --are invoked via calls to functions that are defined in the system-dependentmodules, ck?[ft]io.c. The command line parser processes any arguments foundon the command line, as passed to main() via argv/argc. The interactiveparser uses the facilities of the cmd package (developed for this program, butusable by any program). Any command parser may be substituted for this one.The only requirements for the Kermit command parser are these:1. Set parameters via global variables like duplex, speed, ttname, etc. See ckcmai.c for the declarations and descriptions of these variables.2. If a command can be executed without the use of Kermit protocol, then execute the command directly and set the variable sstate to 0. Examples include 'set' commands, local directory listings, the 'connect' command.3. If a command requires the Kermit protocol, set the following variables: sstate string data 'x' (enter server mode) (none) 'r' (send a 'get' command) cmarg, cmarg2 'v' (enter receive mode) cmarg2 'g' (send a generic command) cmarg 's' (send files) nfils, cmarg & cmarg2 OR cmlist 'c' (send a remote host command) cmarg cmlist is an array of pointers to strings. cmarg, cmarg2 are pointers to strings. nfils is an integer. cmarg can be a filename string (possibly wild), or a pointer to a prefabricated generic command string, or a pointer to a host command string. cmarg2 is the name to send a single file under, or the name under which to store an incoming file; must not be wild. If it's the name for receiving, a null value means to store the file under the name it arrives with. cmlist is a list of nonwild filenames, such as passed via argv. nfils is an integer, interpreted as follows: -1: filespec (possibly wild) in cmarg, must be expanded internally. 0: send from stdin (standard input). >0: number of files to send, from cmlist.The screen() function is used to update the screen during file transfer.The tlog() function writes to a transaction log (if TLOG is defined).The debug() function writes to a debugging log (if DEBUG is defined).The intmsg() and chkint() functions provide the user i/o for interruptingfile transfers.GROUP 3:System-dependent function definitions. All the Kermit modules, including thecommand package, call upon these functions, which are designed to providesystem-independent primitives for controlling and manipulating devices andfiles. For UNIX, these functions are defined in the files CKUFIO.C (files),CKUTIO.C (communication devices), and CKUSIG.C (signal handling).For VMS, the files are CKVFIO.C, CKVTIO.C, and CKUSIG.C (VMS can use the samesignal handling routines as UNIX). For OS/2, CKOFIO.C, CKOTIO.C, CKOSIG.C(OS/2 has its own signal handling). It doesn't really matter what the filesare called, except for Kermit distribution purposes (grouping related filestogether alphabetically), only that each function is provided with the nameindicated, observes the same calling and return conventions, and has the sametype.The Group 3 modules contain both functions and global variables that areaccessed by modules in the other groups. These are now described. Changessince version 4E of C-Kermit are flagged by the symbol *NEW* (use grep).(By the way, I got this list by linking all the C-Kermit modules togetherexcept CKUTIO and CKUFIO. These are the symbols that ld reported as undefined)A. Variables:char *DELCMD; Pointer to string containing command for deleting files. Example: char *DELCMD = "rm -f "; (UNIX) Example: char *DELCMD = "delete "; (VMS) Note trailing space. Filename is concatenated to end of this string.char *DIRCMD; Pointer to string containing command for listing files when a filespec is given. Example: char *DIRCMD = "/bin/ls -l "; (UNIX) Example: char *DIRCMD = "directory "; (VMS) Note trailing space. Filename is concatenated to end of this string.char *DIRCM2; *NEW* Pointer to string containing command for listing files when a filespec is not given. (currently not used, handled in another way.) Example: char *DIRCMD = "/bin/ls -ld *"; char *PWDCMD; Pointer to string containing command to display current directory. Example: char *PWDCMD = "pwd ";char *SPACMD; Pointer to command to display free disk space in current device/directory. Example: char *SPACMD = "df .";char *SPACM2; Pointer to command to display free disk space in another device/directory. Example: char *SPACM2 = "df "; Note trailing space. Device or directory name is added to this string.char *TYPCMD; Pointer to command for displaying the contents of a file. Example: char *TYPCMD = "cat "; Note trailing space. Device or directory name is added to this string.char *WHOCMD; Pointer to command for displaying logged-in users. Example: char *WHOCMD = "who "; Note trailing space. Specific user name may be added to this string.int backgrd = 0; Flag for whether program is running in foreground (0) or background (nonzero). Background operation implies that screen output should not be done and that all errors should be fatal.int ckxech; Flag for who is to echo console typein: 1 - The program (system is not echoing). 0 - The system, front end, terminal, etc (not this program)char *ckxsys; Pointer to string that names the computer and operating system. Example: char *ckxsys = " NeXT Mach 1.0"; Tells what computer system ckxv applies to. In UNIX Kermit, this variable is also used to print the program herald, and in the SHOW VERSION command.char *ckxv; Pointer to version/edit info of ck?tio.c module. Example: char *ckxv = "UNIX Communications Support, 6.0.169, 6 Sep 96"; Used by SHOW VERSION command.char *ckzsys; Like ckxsys, but briefer. Example: char *ckzsys = " 4.3 BSD"; Tells what platform ckzv applies to. Used by the SHOW VERSION command.char *ckzv; Pointer to version/edit info of ck?fio.c module. Example: char *ckzv = "UNIX File support, 6.0.113, 6 Sep 96"; Used by SHOW VERSION command.int dfflow; Default flow control. 0 = none, 1 = Xon/Xoff, ... (see FLO_xxx symbols in ckcdeb.h) Set to by group 3 module. Used by ckcmai.c to initialize flow control variable.int dfloc; Default location. 0 = remote, 1 = local. Set by group 3 module. Used by ckcmai.c to initialize local variable. Used in various places in the user interface.int dfprty; Default parity. 0 = none, 'e' = even, 'o' = odd, 'm' = mark, 's' = space. Set by Group 3 module. Used by ckcmai.c to initialize parity variable.char *dftty; Default communication device. Set by group 3 module. Used in many places. This variable should be initialized the the symbol CTTNAM, which is defined in ckcdeb.h, e.g. as "/dev/tty" for UNIX, "TT:" for VAX/VMS, etc. Example: char *dftty = CTTNAM;char *mtchs[]; *NEW* Array of string pointers to filenames that matched the most recent wildcard match, i.e. the most recent call to zxpand(). Used (at least) by command parsing package for partial filename completion.int tilde_expand; *NEW* Flag for whether to attempt to expand leading tildes in directory names (used in UNIX only, and then only when the symbol DTILDE is defined.int ttnproto; *NEW* The protocol being used to communicate over a network device. Values are defined in ckcnet.h. Example: NP_TELNET is network protocol "telnet".int maxnam; *NEW* The maximum length for a filename, exclusive of any device or directory information, in the format of the host operating system.int maxpath; *NEW* The maximum length for a fully specified filename, including device designator, directory name, network node name, etc, in the format of the host operating system, and including all punctuation.int ttyfd; *NEW* File descriptor of the communication device. -1 if there is no open or usable connection, including when C-Kermit is in remote mode.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -