📄 externs.h
字号:
/* Copyright (c) 1988, 1990, 1993 *//* The Regents of the University of California. All rights reserved. *//* *//* Redistribution and use in source and binary forms, with or without *//* modification, are permitted provided that the following conditions *//* are met: *//* 1. Redistributions of source code must retain the above copyright *//* notice, this list of conditions and the following disclaimer. *//* 2. Redistributions in binary form must reproduce the above copyright *//* notice, this list of conditions and the following disclaimer in the *//* documentation and/or other materials provided with the distribution. *//* 3. All advertising materials mentioning features or use of this *//* software must display the following acknowledgement: *//* This product includes software developed by the University of *//* California, Berkeley and its contributors. *//* 4. Neither the name of the University nor the names of its contributors *//* may be used to endorse or promote products derived from this software *//* without specific prior written permission. *//* *//* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND *//* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *//* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *//* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE *//* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *//* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF *//* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *//* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN *//* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *//* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF *//* THE POSSIBILITY OF SUCH DAMAGE. */#include "config.h"#if defined(sun) && !defined(__svr4__)#ifdef HAVE_SYS_TERMIOS_H#undef HAVE_SYS_IOCTL_H#endif#endif#include "includes.h"#undef P#include "defs.h"#include "protos.h"#include "socks.h"#if defined(__alpha__) || (defined(sun) && defined(__svr4__))#undef BSD#endif#ifndef BSD#define BSD 43#endif#ifndef HAVE_VFORK#define vfork fork#endif#ifndef HAVE_STRCHR#ifndef strchr#define strchr index#endif#endif#ifndef HAVE_STRRCHR#ifndef strrchr#define strrchr rindex#endif#endif#if defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H) || defined(HAVE_TERMIOS_H) || defined(HAVE_SYS_TERMIOS_H) || BSD > 43#define USE_TERMIO#endif#if (defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H)) && !(defined(HAVE_TERMIOS_H) || defined(HAVE_SYS_TERMIOS_H))#define SYSV_TERMIO#endif#include <setjmp.h>#ifdef HAVE_SYS_FILIO_H#include <sys/filio.h>#endif#if defined(CRAY) && !defined(NO_BSD_SETJMP)#include <bsdsetjmp.h>#endif#if defined(USE_TERMIO) && !defined(VINTR)# ifdef SYSV_TERMIO# ifdef HAVE_SYS_TERMIO_H# include <sys/termio.h>#elif defined(HAVE_TERMIO_H)# include <termio.h># endif# else# ifdef HAVE_SYS_TERMIOS_H# include <sys/termios.h>#elif defined(HAVE_TERMIOS_H)# include <termios.h># endif# endif#endif#ifndef SYSV_TERMIO#define termio termios#endif#if defined(NO_CC_T) || !defined(USE_TERMIO)#ifndef USE_TERMIOtypedef char cc_t;#elsetypedef unsigned char cc_t;#endif#endif#ifndef _POSIX_VDISABLE# ifdef VDISABLE# define _POSIX_VDISABLE VDISABLE# else# define _POSIX_VDISABLE ((cc_t)'\377')# endif#endif#define SUBBUFSIZE 256#ifndef CRAYextern int errno; /* outside this world */#endif extern int autologin, /* Autologin enabled */ skiprc, /* Don't process the ~/.telnetrc file */ eight, /* use eight bit mode (binary in and/or out */ flushout, /* flush output */ connected, /* Are we connected to the other side? */ globalmode, /* Mode tty should be in */ In3270, /* Are we in 3270 mode? */ telnetport, /* Are we connected to the telnet port? */ localflow, /* Flow control handled locally */ restartany, /* If flow control, restart output on any character */ localchars, /* we recognize interrupt/quit */ donelclchars, /* the user has set "localchars" */ showoptions, net, /* Network file descriptor */ tin, /* Terminal input file descriptor */ tout, /* Terminal output file descriptor */ crlf, /* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */ autoflush, /* flush output when interrupting? */ autosynch, /* send interrupt characters with SYNCH? */ SYNCHing, /* Is the stream in telnet SYNCH mode? */ donebinarytoggle, /* the user has put us in binary */ dontlecho, /* do we suppress local echoing right now? */ crmod, netdata, /* Print out network data flow */ prettydump, /* Print "netdata" output in user readable format */#ifdef TN3270 cursesdata, /* Print out curses data flow */ apitrace, /* Trace API transactions */#endif /* defined(TN3270) */ termdata, /* Print out terminal data flow */ debug; /* Debug level */extern cc_t escape; /* Escape to command mode */extern cc_t rlogin; /* Rlogin mode escape character */#ifdef KLUDGELINEMODEextern cc_t echoc; /* Toggle local echoing */#endifextern char *prompt; /* Prompt for command. */extern char doopt[], dont[], will[], wont[], options[], /* All the little options */ *hostname; /* Who are we connected to? *//* * We keep track of each side of the option negotiation. */#define MY_STATE_WILL 0x01#define MY_WANT_STATE_WILL 0x02#define MY_STATE_DO 0x04#define MY_WANT_STATE_DO 0x08/* * Macros to check the current state of things */#define my_state_is_do(opt) (options[opt]&MY_STATE_DO)#define my_state_is_will(opt) (options[opt]&MY_STATE_WILL)#define my_want_state_is_do(opt) (options[opt]&MY_WANT_STATE_DO)#define my_want_state_is_will(opt) (options[opt]&MY_WANT_STATE_WILL)#define my_state_is_dont(opt) (!my_state_is_do(opt))#define my_state_is_wont(opt) (!my_state_is_will(opt))#define my_want_state_is_dont(opt) (!my_want_state_is_do(opt))#define my_want_state_is_wont(opt) (!my_want_state_is_will(opt))#define set_my_state_do(opt) {options[opt] |= MY_STATE_DO;}#define set_my_state_will(opt) {options[opt] |= MY_STATE_WILL;}#define set_my_want_state_do(opt) {options[opt] |= MY_WANT_STATE_DO;}#define set_my_want_state_will(opt) {options[opt] |= MY_WANT_STATE_WILL;}#define set_my_state_dont(opt) {options[opt] &= ~MY_STATE_DO;}#define set_my_state_wont(opt) {options[opt] &= ~MY_STATE_WILL;}#define set_my_want_state_dont(opt) {options[opt] &= ~MY_WANT_STATE_DO;}#define set_my_want_state_wont(opt) {options[opt] &= ~MY_WANT_STATE_WILL;}/* * Make everything symetrical */#define HIS_STATE_WILL MY_STATE_DO#define HIS_WANT_STATE_WILL MY_WANT_STATE_DO#define HIS_STATE_DO MY_STATE_WILL#define HIS_WANT_STATE_DO MY_WANT_STATE_WILL#define his_state_is_do my_state_is_will#define his_state_is_will my_state_is_do#define his_want_state_is_do my_want_state_is_will#define his_want_state_is_will my_want_state_is_do#define his_state_is_dont my_state_is_wont#define his_state_is_wont my_state_is_dont#define his_want_state_is_dont my_want_state_is_wont#define his_want_state_is_wont my_want_state_is_dont#define set_his_state_do set_my_state_will#define set_his_state_will set_my_state_do#define set_his_want_state_do set_my_want_state_will#define set_his_want_state_will set_my_want_state_do#define set_his_state_dont set_my_state_wont#define set_his_state_wont set_my_state_dont#define set_his_want_state_dont set_my_want_state_wont#define set_his_want_state_wont set_my_want_state_dontextern FILE *NetTrace; /* Where debugging output goes */extern unsigned char NetTraceFile[]; /* Name of file where debugging output goes */extern void SetNetTrace P((char *)); /* Function to change where debugging goes */extern jmp_buf peerdied, toplevel; /* For error conditions. */extern void command P((int, char *, int)), Dump P((char, unsigned char *, int)), init_3270 P((void)), printoption P((char *, int, int)), printsub P((char, unsigned char *, int)), sendnaws P((void)), setconnmode P((int)), setcommandmode P((void)), setneturg P((void)), set_escape_char P((char *)), sys_telnet_init P((void)), telnet P((char *)), tel_enter_binary P((int)),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -