⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ckcker.h

📁 C-Kermit源码。是使用串口/Modem和网络通讯的程序
💻 H
📖 第 1 页 / 共 3 页
字号:
#endif /* BIGBUFOK */#endif /* RBSIZ */#else  /* not DYNAMIC */#ifdef pdp11#define SBSIZ 3020#define RBSIZ 3020#else#ifndef SBSIZ#define SBSIZ (MAXSP * (MAXWS + 1))#endif /* SBSIZ */#ifndef RBSIZ#define RBSIZ (MAXRP * (MAXWS + 1))#endif /* RBSIZ */#endif /* pdp11 */#endif /* DYNAMIC */#ifdef BIGBUFOK#define PKTMSGLEN 1023#else#define PKTMSGLEN 80#endif /* BIGBUFOK *//* Kermit parameters and defaults */#define CTLQ	   '#'			/* Control char prefix I will use */#define MYEBQ	   '&'			/* 8th-Bit prefix char I will use */#define MYRPTQ	   '~'			/* Repeat count prefix I will use */#define MAXTRY	    10			/* Times to retry a packet */#define MYPADN	    0			/* How many padding chars I need */#define MYPADC	    '\0'		/* Which padding character I need */#define DMYTIM	    8			/* Initial timeout interval to use. */#define URTIME	    15			/* Timeout interval to use on me. */#define DSRVTIM     0			/* Default server cmd wait timeout. */#define DEFTRN	    0			/* Default line turnaround handshake */#define MYEOL	    CR			/* Incoming packet terminator. */#ifdef NEWDEFAULTS#define DRPSIZ	  4095			/* Default incoming packet size. */#define DFWSIZ      30			/* Default window size */#define DFBCT        3			/* Default block-check type */#else#define DRPSIZ	    90			/* Default incoming packet size. */#define DFWSIZ       1			/* Default window size */#define DFBCT        3			/* Default block-check type */#endif /* NEWDEFAULTS */#define DSPSIZ	    90			/* Default outbound packet size. */#define DDELAY      1			/* Default delay. */#define DSPEED	    9600		/* Default line speed. */#ifdef OS2				/* Default CONNECT-mode */#define DFESC 29			/* escape character */#else#ifdef NEXT				/* Ctrl-] for PC and NeXT */#define DFESC 29#else#ifdef GEMDOS				/* And Atari ST */#define DFESC 29#else#define DFESC 28			/* Ctrl-backslash for others */#endif /* GEMDOS */#endif /* NEXT */#endif /* OS2 */#ifdef NOPUSH				/* NOPUSH implies NOJC */#ifndef NOJC				/* (no job control) */#define NOJC#endif /* NOJC */#endif /* NOPUSH */#ifdef UNIX				/* Default for SET SUSPEND */#ifdef NOJC				/* UNIX but job control disabled */#define DFSUSP      0#else					/* UNIX, job control enabled. */#define DFSUSP      1#endif /* NOJC */#else#define DFSUSP      0#endif /* UNIX */#ifndef DFCDMSG#ifdef UNIXOROSK#define DFCDMSG "{{./.readme}{README.TXT}{READ.ME}}"#else#define DFCDMSG "{{README.TXT}{READ.ME}}"#endif /* UNIXOROSK */#endif /* DFCDMSG *//* Files */#define ZCTERM      0	    	/* Console terminal */#define ZSTDIO      1		/* Standard input/output */#define ZIFILE	    2		/* Current input file (SEND, etc) (in) */#define ZOFILE      3	    	/* Current output file (RECEIVE, GET) (out) */#define ZDFILE      4	    	/* Current debugging log file (out) */#define ZTFILE      5	    	/* Current transaction log file (out) */#define ZPFILE      6	    	/* Current packet log file (out) */#define ZSFILE      7		/* Current session log file (out) */#define ZSYSFN	    8		/* Input/Output from a system function */#define ZRFILE      9           /* Local file for READ (in) */#define ZWFILE     10           /* Local file for WRITE (out) */#define ZMFILE     11		/* Miscellaneous file, e.g. for XLATE */#define ZDIFIL     12		/* DIAL log */#define ZNFILS     13	    	/* How many defined file numbers */#ifdef CKCHANNELIO/* File modes */#define FM_REA      1			/* Read */#define FM_WRI      2			/* Write */#define FM_APP      4			/* Append */#define FM_RWA      7			/* Read/Write/Append mask */#define FM_BIN      8			/* Binary */#define FM_RWB     15			/* Read/Write/Append/Binary mask */#define FM_CMD     16			/* Command */#define FM_EOF     64			/* (status) At EOF *//* File errors */#define FX_NER      0			/* No error */#define FX_SYS     -1			/* System error */#define FX_EOF     -2			/* End of file */#define FX_NOP     -3			/* Channel not open */#define FX_CHN     -4			/* Channel out of range */#define FX_RNG     -5			/* Argument range error */#define FX_FNF     -6			/* File not found */#define FX_BFN     -7			/* Bad or missing filename */#define FX_NMF     -8			/* No more files */#define FX_FOP     -9			/* Forbidden operation */#define FX_ACC    -10			/* Access denied */#define FX_BOM    -11			/* Bad combination of open modes */#define FX_OFL    -12			/* Buffer overflow */#define FX_LNU    -13			/* Current line number unknown */#define FX_NYI    -99			/* Feature not implemented yet */#define FX_UNK   -999			/* Unknown error */_PROTOTYP( int z_open, (char *, int) );_PROTOTYP( int z_close, (int) );_PROTOTYP( int z_out, (int, char *, int, int) );_PROTOTYP( int z_in, (int, char *, int, int, int) );_PROTOTYP( int z_flush, (int) );_PROTOTYP( int z_seek, (int, long) );_PROTOTYP( int z_line, (int, long) );_PROTOTYP( int z_getmode, (int) );_PROTOTYP( int z_getfnum, (int) );_PROTOTYP( long z_getpos, (int) );_PROTOTYP( long z_getline, (int) );_PROTOTYP( long z_count, (int, int) );_PROTOTYP( char * z_getname, (int) );_PROTOTYP( char * ckferror, (int) );#endif /* CKCHANNELIO *//*  Buffered file i/o ...  */#ifdef OS2				/* K-95 */#define INBUFSIZE 32768#define OBUFSIZE 32768#else#ifdef pdp11#define INBUFSIZE 512#define OBUFSIZE 512#else/* In VMS, allow for longest possible RMS record */#ifdef VMS#define INBUFSIZE 32768			/* File input buffer size */#define OBUFSIZE 32768			/* File output buffer size */#else  /* Not VMS */#ifdef STRATUS#ifdef DYNAMIC#define INBUFSIZE 32767			/* File input buffer size */#define OBUFSIZE 32767			/* File output buffer size */#else /* STRATUS, not DYNAMIC */#define INBUFSIZE 4096			/* File input buffer size */#define OBUFSIZE 4096			/* File output buffer size */#endif /* DYNAMIC */#else /* not STRATUS */#ifdef BIGBUFOK				/* Systems where memory is */#define INBUFSIZE 32768			/* not a problem... */#define OBUFSIZE 32768#else /* Not BIGBUFOK */#define INBUFSIZE 1024#define OBUFSIZE 1024#endif /* STRATUS */#endif /* BIGBUFOK */#endif /* VMS */#endif /* pdp11 */#endif /* OS2 *//* File-transfer character in/out macros for buffered i/o *//* Get the next file byte */#ifndef CKCMAI#ifndef NOXFERextern char ** sndarray;#endif /* NOXFER */#endif /* CKCMAI */#ifdef NOSPL#define zminchar() (((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill())#else#ifdef NOXFER#define zminchar() (((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill())#else#define zminchar() \(sndarray?agnbyte():(((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill()))#endif /* NOXFER */#endif /* NOSPL *//* Stuff a character into the input buffer */#define zmstuff(c) zinptr--, *zinptr = c, zincnt++/* Put a character to a file */#define zmchout(c) \((*zoutptr++=(char)(c)),(((++zoutcnt)>=zobufsize)?zoutdump():0))/* Screen functions */#ifdef NODISPLAY#define xxscreen(a,b,c,d)#define ckscreen(a,b,c,d)#else_PROTOTYP( VOID ckscreen, (int, char, long, char *) );#ifdef VMS#define xxscreen(a,b,c,d) \if (local && fdispla != XYFD_N) \ckscreen((int)a,(char)b,(long)c,(char *)d)#else#define xxscreen(a,b,c,d) \if (local && !backgrd && fdispla != XYFD_N) \ckscreen((int)a,(char)b,(long)c,(char *)d)#endif /* VMS */#endif /* NODISPLAY */#define SCR_FN 1    	/* filename */#define SCR_AN 2    	/* as-name */#define SCR_FS 3 	/* file-size */#define SCR_XD 4    	/* x-packet data */#define SCR_ST 5      	/* File status: */#define   ST_OK   0   	/*  Transferred OK */#define   ST_DISC 1 	/*  Discarded */#define   ST_INT  2     /*  Interrupted */#define   ST_SKIP 3 	/*  Skipped */#define   ST_ERR  4 	/*  Fatal Error */#define   ST_REFU 5     /*  Refused (use Attribute codes for reason) */#define   ST_INC  6	/*  Incompletely received */#define   ST_MSG  7	/*  Informational message */#define SCR_PN 6    	/* packet number */#define SCR_PT 7    	/* packet type or pseudotype */#define SCR_TC 8    	/* transaction complete */#define SCR_EM 9    	/* error message */#define SCR_WM 10   	/* warning message */#define SCR_TU 11	/* arbitrary undelimited text */#define SCR_TN 12   	/* arbitrary new text, delimited at beginning */#define SCR_TZ 13   	/* arbitrary text, delimited at end */#define SCR_QE 14	/* quantity equals (e.g. "foo: 7") */#define SCR_CW 15	/* close screen window */#define SCR_CD 16       /* display current directory *//* Macros */#ifndef CKCMAIextern int tcp_incoming;		/* Used by ENABLE macro */#endif /* CKCMAI */#ifndef TCPSOCKET/*  ENABLED tells whether a server-side service is enabled.  0 = disabled, 1 = local, 2 = remote.  A "set host *" connection is technically local but logically remote*/#define ENABLED(x) ((local && (x & 1)) || (!local && (x & 2)))#else#define ENABLED(x) (((local && !tcp_incoming) && (x & 1)) || \((!local || tcp_incoming) && (x&2)))#endif /* TCPSOCKET *//* These are from the book */#define tochar(ch)  (((ch) + SP ) & 0xFF )	/* Number to character */#define xunchar(ch) (((ch) - SP ) & 0xFF )	/* Character to number */#define ctl(ch)     (((ch) ^ 64 ) & 0xFF )	/* Control/Uncontrol toggle */#define unpar(ch)   (((ch) & 127) & 0xFF )	/* Clear parity bit *//* Modem and dialing definitions */#ifndef NODIAL/* Modem capabilities (bit values) */#define CKD_AT   1			/* Hayes AT commands and responses */#define CKD_V25  2			/* V.25bis commands and responses */#define CKD_SB   4			/* Speed buffering */#define CKD_EC   8			/* Error correction */#define CKD_DC  16			/* Data compression */#define CKD_HW  32			/* Hardware flow control */#define CKD_SW  64			/* (Local) software flow control */#define CKD_KS 128			/* Kermit spoofing */#define CKD_TB 256			/* Made by Telebit *//* DIAL command result codes */#define DIA_UNK   -1			/* No DIAL command given yet */#define DIA_OK     0			/* DIAL succeeded */#define DIA_NOMO   1			/* Modem type not specified */#define DIA_NOLI   2			/* Communication line not spec'd */#define DIA_OPEN   3			/* Line can't be opened */#define DIA_NOSP   4			/* Speed not specified */#define DIA_HANG   5			/* Hangup failure */#define DIA_IE     6			/* Internal error (malloc, etc) */#define DIA_IO     7			/* I/O error */#define DIA_TIMO   8			/* Dial timeout expired */#define DIA_INTR   9			/* Dialing interrupted by user */#define DIA_NRDY  10			/* Modem not ready */#define DIA_PART  11			/* Partial dial command OK */#define DIA_DIR   12			/* Dialing directory error */#define DIA_HUP   13			/* Modem was hung up OK */#define DIA_ERR   20			/* Modem command error */#define DIA_NOIN  21			/* Failure to initialize modem */#define DIA_BUSY  22			/* Phone busy */#define DIA_NOCA  23			/* No carrier */#define DIA_NODT  24			/* No dialtone */#define DIA_RING  25			/* Ring, incoming call */#define DIA_NOAN  26			/* No answer */#define DIA_DISC  27			/* Disconnected */#define DIA_VOIC  28			/* Answered by voice */#define DIA_NOAC  29			/* Access denied, forbidden call */#define DIA_BLCK  30			/* Blacklisted */#define DIA_DELA  31			/* Delayed */#define DIA_FAX   32			/* Fax */#define DIA_DIGI  33                    /* Digital Line */#define DIA_TAPI  34			/* TAPI dialing failure */#define DIA_UERR  98			/* Unknown error */#define DIA_UNSP  99		/* Unspecified failure detected by modem */#define MDMINF	struct mdminfMDMINF {			/* Structure for modem-specific information */    char * name;		/* Descriptive name */    char * pulse;		/* Command to force pulse dialing */    char * tone;		/* Command to force tone dialing */    int    dial_time;		/* Time modem allows for dialing (secs) */    char * pause_chars;		/* Character(s) to tell modem to pause */    int	   pause_time;		/* Time associated with pause chars (secs) */    char * wake_str;		/* String to wakeup modem & put in cmd mode */    int	   wake_rate;		/* Delay between wake_str characters (msecs) */    char * wake_prompt;		/* String prompt after wake_str */    char * dmode_str;		/* String to put modem in dialing mode */    char * dmode_prompt;	/* String prompt for dialing mode */    char * dial_str;		/* Dialing string, with "%s" for number */    int    dial_rate;		/* Interchar delay to modem (msec) */    int    esc_time;		/* Escape sequence guard time (msec) */    int    esc_char;		/* Escape character */    char * hup_str;		/* Hangup string */    char * hwfc_str;		/* Hardware flow control string */    char * swfc_str;		/* Software flow control string */    char * nofc_str;		/* No flow control string */    char * ec_on_str;		/* Error correction on string */    char * ec_off_str;		/* Error correction off string */    char * dc_on_str;		/* Data compression on string */    char * dc_off_str;		/* Data compression off string */    char * aa_on_str;		/* Autoanswer on string */    char * aa_off_str;		/* Autoanswer off string */    char * sb_on_str;		/* Speed buffering on string */    char * sb_off_str;		/* Speed buffering off string */    char * sp_on_str;		/* Speaker on string */    char * sp_off_str;		/* Speaker off string */    char * vol1_str;		/* Volume low string */    char * vol2_str;		/* Volume med string */    char * vol3_str;		/* Volume high string */    char * ignoredt;		/* Ignore dialtone string */    char * ini2;		/* Last-minute init string */    long   max_speed;		/* Maximum interface speed */    long   capas;		/* Capability bits */    /* function to read modem's response string to a non-dialing command */    _PROTOTYP( int (*ok_fn), (int,int) );};#endif /* NODIAL *//* Symbols for File Attributes */#define AT_XALL  0			/* All of them */#define AT_ALLY  1			/* All of them on (Yes) */#define AT_ALLN  2			/* All of them off (no) */#define AT_LENK  3			/* Length in K */#define AT_FTYP  4			/* File Type */#define AT_DATE  5			/* Creation date */#define AT_CREA  6			/* Creator */#define AT_ACCT  7			/* Account */#define AT_AREA  8			/* Area */#define AT_PSWD  9			/* Password for area */#define AT_BLKS 10			/* Blocksize */#define AT_ACCE 11			/* Access */#define AT_ENCO 12			/* Encoding */#define AT_DISP 13			/* Disposition */#define AT_LPRO 14			/* Local Protection */#define AT_GPRO 15			/* Generic Protection */#define AT_SYSI 16			/* System ID */#define AT_RECF 17			/* Record Format */#define AT_SYSP 18			/* System-Dependent Parameters */#define AT_LENB 19			/* Length in Bytes */#define AT_EOA  20			/* End of Attributes */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -