?? ckuins.txt
字號:
#include <stdio.h>char *getcwd(buf,size) char *buf; int size; {#ifndef NOPOPEN#ifdef DCLPOPEN FILE *popen();#endif FILE *pfp; if (!buf) return(NULL); if (!(pfp = popen("pwd","r"))) return(NULL); fgets(buf,size-2,pfp); pclose(pfp); buf[strlen(buf)-1] = '\0'; return((char *)buf);#else buf[0] = '\0'; return(NULL);#endif /* NOPOPEN */}#ifdef NOPOPENFILE *popen(s,t) char *s,*t; { return(NULL);}#endif /* NOPOPEN */ If you get complaints about NPROC having an invalid value, add a valid definition for it (depends on your system), as in the cray entry. If you get some symbol that's multiply defined, it probably means that a variable name used by Kermit is also used in one of your system libraries that Kermit is linked with. For example, under PC/IX some library has a variable or function called "data", and the variable "data" is also used extensively by Kermit. Rather than edit the Kermit source files, just put a -D in the make entry CFLAGS to change the Kermit symbol at compile time. In this example, it might be -Ddata=xdata. Some symbol is defined in your system's header files, but it produces conflicts with, or undesired results from, Kermit. Try undefining the symbol in the makefile target's CFLAGS, for example -UFIONREAD. Some well-known symbol is missing from your system header files. Try defining in the makefile target's CFLAGS, for example -DFREAD=1. You get many warnings about pointer mismatches. This probably means that Kermit is assuming an int type for signal() when it should be void, or vice-versa. Try adding -DSIG_I (for integer signal()) or -DSIG_V (for void) to CFLAGS. Or just include KFLAGS=-DSIG_V (or whatever) in your "make" command, for example:make bsd KFLAGS=-DSIG_V You get many messages about variables that are declared and/or set but never used. It is difficult to avoid these because of all the conditional compilation in the program. Ignore these messages. Some of C-Kermit's modules are so large, or contain so many character string constants, or are so offensive in some other way, that some C compilers give up and refuse to compile them. This is usually because the -O (optimize) option is included in the make entry. If this happens to you, you can (a) remove the -O option from the make entry, which will turn off the optimizer for ALL modules; or (b) compile the offending module(s) by hand, including all the switches from make entry except for -O, and then give the appropriate "make" command again; or (c) increase the value of the -Olimit option, if your compiler supports this option; or (d) change the [147]makefile target to first compile each offending module explicitly without optimization, then compile the others normally (with optimization), for example:#Fortune 32:16, For:Pro 2.1 (mostly like 4.1bsd)ft21: @echo 'Making C-Kermit $(CKVER) for Fortune 32:16 For:Pro 2.1...' $(MAKE) ckuusx.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \ -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" $(MAKE) ckuxla.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \ -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" $(MAKE) ckudia.$(EXT) "CFLAGS= -DNODEBUG -DBSD4 -DFT21 -DNOFILEH \ -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" $(MAKE) wermit "CFLAGS= -O -DNODEBUG -DBSD4 -DFT21 -DNOFILEH -SYM 800 \ -DDYNAMIC -DNOSETBUF -DCK_CURSES $(KFLAGS) -DPID_T=short" \ "LNKFLAGS= -n -s" "LIBS= -lcurses -ltermcap -lv -lnet" As an extreme example, some compilers (e.g. gcc on the DG AViiON) have been known to dump core when trying to compile ckwart.c with optimization. So just do this one "by hand":cc -o wart ckwart.c or:touch ckcpro.c and then give the "make" command again. Speaking of wart, it is unavoidable that some picky compilers might generate "statement unreachable" messages when compiling ckcpro.c. Unreachable statements can be generated by the wart program, which generates ckcpro.c automatically from [148]ckcpro.w, which translates lex-like state/input constructions into a big switch/case construction. Some function in Kermit wreaks havoc when it is called. Change all invocations of the function into a macro that evaluates to the appropriate return code that would have been returned by the function had it been called and failed, for example: -Dzkself()=0. Obviously not a good idea if the function is really needed. If you have just installed SunOS 4.1.2 or 4.1.3, you might find that C-Kermit (and any other C program) fails to link because of unresolved references from within libc. This is because of a mistake in Sun's /usr/lib/shlib.etc files for building the new libc. Change the libc Makefile so that the "ld" lines have "-ldl" at the end. Change the README file to say "mv xccs.multibyte. xccs.multibyte.o" and follow that instruction. __________________________________________________________________________5. INSTALLING THE KERMIT FILES [ [149]Top ] [ [150]Contents ] [ [151]Next ] [ [152]Previous ] SECTION CONTENTS5.1. [153]The C-Kermit Initialization File5.2. [154]Text Files5.3. [155]Installing the Kermit Files5.4. [156]The Makefile Install Target The C-Kermit executable does not need any external files to run. Unlike, say, the cu program, which on most platforms is useless unless you (as root) edit the /usr/spool/uucp/Systems and /usr/spool/uucp/Devices files to supply whatever obscure and undocumented syntax is required to match some supposedly user-friendly mnemonic to the real pathname of whatever device you want to use, Kermit runs on its own without needing any external configuration files, and lets you refer to device (and network hosts and services) by their own natural undisguised names. Nevertheless, a number of external files can be installed along with the C-Kermit executable if you wish. These include configuration and customization files that are read by Kermit as well as documentation files to be read by people. All of this material is (a) optional, and (b) available on the Kermit website:[157]http://www.columbia.edu/kermit/ and usually in a more pleasant form, perhaps also with updated content. So if your computer is on the Internet, there is no need to install anything but the Kermit executable if users know how to find the Kermit website (and if they don't, Kermit's "help" command tells them). 5.1. The C-Kermit Initialization File In C-Kermit 7.0 and earlier, the standard initialization file was a key C-Kermit component because: a. It "loaded" the dialing and network directories. b. It defined all the macros and variables for the services directory. c. It defined macros for quickly changing Kermit's file-transfer performance tuning. The standard initialization file is quite long (more than 600 lines) and requires noticeable processing time (the slower the computer, the more noticeable), yet few people actually use the services directory, whose definition takes up most of its bulk. Meanwhile, in C-Kermit 8.0, many of the remaining functions of the standard initialization file are now built in; for example, the FAST, CAUTIOUS, and ROBUST commands. More to the point, many of the settings that could be made only in the initialization and customization files can now be picked up from environment variables. The first group identifies initialization and directory files: CKERMIT_INI The path of your Kermit initialization file, if any. This overrides the built-in search for $HOME/.kermrc. K_CHARSET The character set used for encoding local text files. Equivalent to SET FILE CHARACTER-SET. K_DIAL_DIRECTORY The full pathname of one or more Kermit dialing directory files. Equivalent to SET DIAL DIRECTORY. K_NET_DIRECTORY The full pathname of one or more Kermit network directory files. Equivalent to SET NETWORK DIRECTORY. K_INFO_DIRECTORY K_INFO_DIR The full pathname of a directory containing Kermit (if any) containing ckubwr.txt and other Kermit text files. Overrides Kermit's built-in search for this directory. The next group is related to dialing modems: K_COUNTRYCODE The telephonic numeric country code for this location, e.g. 1 for North America or 39 for Italy. It is recommended that this one be set for all users, system-wide. Not only is it used to process portable-format dialing directory entries, but it is also compared against Kermit's built-in list of "tone countries" to see if tone dialing can be used. Equivalent to Kermit's SET DIAL COUNTRY-CODE command. K_AREACODE The telephonic numeric area code for this location, e.g. 212 for Manhattan, New York, USA. Recommend this one also be set system-wide, so shared portable-format dialing directories will work automatically for everybody. Equivalent to Kermit's SET DIAL AREA-CODE command. K_DIAL_METHOD TONE or PULSE. Equivalent to Kermit's SET DIAL METHOD command. If a dial method is not set explicitly (or implicitly from the country code), Kermit does not specify a dialing method, and uses the modem's default method, which tends to be pulse. K_INTL_PREFIX The telephonic numeric international dialing prefix for this location. Equivalent to Kermit's SET DIAL INTL-PREFIX command. K_LD_PREFIX The telephonic numeric long-distance dialing prefix for this location. Equivalent to Kermit's SET DIAL LD-PREFIX command. K_PBX_ICP The telephonic numeric PBX internal call prefix for this location. Equivalent to Kermit's SET DIAL PBX-INSIDE-PREFIX command. K_PBX_OCP The telephonic numeric PBX external call prefix for this location. Equivalent to Kermit's SET DIAL PBX-OUTSIDE-PREFIX command. K_PBX_XCH The telephonic numeric PBX exchange (first part of the subscriber number). Equivalent to Kermit's SET DIAL PBX-EXCHANGE command. K_TF_AREACODE A list of one or more telephonic numeric toll-free area codes. K_TF_PREFIX The telephonic numeric toll-free dialing prefix, in case it is different from the long-distance prefix. Equivalent to Kermit's SET DIAL TF-PREFIX command. The final group includes well-known environment variables that are also used by Kermit: CDPATH Where the CD command should look for relative directory names. SHELL The path of your Unix shell. Used by the RUN (!) command to choose the shell to execute its arguments. USER Your Unix username. EDITOR The name or path of your preferred editor (used by the EDIT command). Equivalent to SET EDITOR. BROWSER The name or path of your preferred web browser (used by the BROWSE command). Equivalent to Kermit's SET BROWSER command. Does this mean the initialization file can be abolished? I think so. Here's why: * Kermit already does everything most people want it to do without one. * Important site-specific customizations can be done with global environment variables. * There is no longer any need for everybody to have to use the standard initialization file. * This means that your initialization file, if you want one, can contain your own personal settings, definitions, and preferences, rather than 600 lines of "standard" setups. * If you still want the services directory, you can either TAKE the standard initialization file (which must be named anything other than $HOME/.kermrc to avoid being executed automatically every time you start Kermit), or you can make it a kerbang script and execute it "directly" (the [158]makefile install target does this
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -