Home | History | Annotate | Line # | Download | only in telnet
externs.h revision 1.13
      1  1.13  christos /*	$NetBSD: externs.h,v 1.13 1998/12/20 14:48:33 christos Exp $	*/
      2   1.8   thorpej 
      3   1.1       cgd /*
      4   1.3       cgd  * Copyright (c) 1988, 1990, 1993
      5   1.3       cgd  *	The Regents of the University of California.  All rights reserved.
      6   1.1       cgd  *
      7   1.1       cgd  * Redistribution and use in source and binary forms, with or without
      8   1.1       cgd  * modification, are permitted provided that the following conditions
      9   1.1       cgd  * are met:
     10   1.1       cgd  * 1. Redistributions of source code must retain the above copyright
     11   1.1       cgd  *    notice, this list of conditions and the following disclaimer.
     12   1.1       cgd  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1       cgd  *    notice, this list of conditions and the following disclaimer in the
     14   1.1       cgd  *    documentation and/or other materials provided with the distribution.
     15   1.1       cgd  * 3. All advertising materials mentioning features or use of this software
     16   1.1       cgd  *    must display the following acknowledgement:
     17   1.1       cgd  *	This product includes software developed by the University of
     18   1.1       cgd  *	California, Berkeley and its contributors.
     19   1.1       cgd  * 4. Neither the name of the University nor the names of its contributors
     20   1.1       cgd  *    may be used to endorse or promote products derived from this software
     21   1.1       cgd  *    without specific prior written permission.
     22   1.1       cgd  *
     23   1.1       cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24   1.1       cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25   1.1       cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26   1.1       cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27   1.1       cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28   1.1       cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29   1.1       cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30   1.1       cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31   1.1       cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32   1.1       cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33   1.1       cgd  * SUCH DAMAGE.
     34   1.1       cgd  *
     35   1.6       jtk  *	from: @(#)externs.h	8.3 (Berkeley) 5/30/95
     36   1.1       cgd  */
     37   1.1       cgd 
     38   1.1       cgd #ifndef	BSD
     39   1.1       cgd # define BSD 43
     40   1.1       cgd #endif
     41   1.1       cgd 
     42   1.3       cgd /*
     43   1.3       cgd  * ucb stdio.h defines BSD as something wierd
     44   1.3       cgd  */
     45  1.12  christos #if defined(sun) && defined(__svr4__) && !defined(BSD)
     46   1.3       cgd #define BSD 43
     47   1.3       cgd #endif
     48   1.3       cgd 
     49   1.3       cgd #ifndef	USE_TERMIO
     50   1.3       cgd # if BSD > 43 || defined(SYSV_TERMIO)
     51   1.3       cgd #  define USE_TERMIO
     52   1.3       cgd # endif
     53   1.1       cgd #endif
     54   1.1       cgd 
     55   1.1       cgd #include <stdio.h>
     56   1.4       cgd #include <stdlib.h>
     57   1.1       cgd #include <setjmp.h>
     58   1.3       cgd #if defined(CRAY) && !defined(NO_BSD_SETJMP)
     59   1.3       cgd #include <bsdsetjmp.h>
     60   1.3       cgd #endif
     61   1.1       cgd #ifndef	FILIO_H
     62   1.1       cgd #include <sys/ioctl.h>
     63   1.1       cgd #else
     64   1.1       cgd #include <sys/filio.h>
     65   1.1       cgd #endif
     66   1.3       cgd #ifdef CRAY
     67   1.3       cgd # include <errno.h>
     68   1.3       cgd #endif /* CRAY */
     69   1.1       cgd #ifdef	USE_TERMIO
     70   1.1       cgd # ifndef	VINTR
     71   1.1       cgd #  ifdef SYSV_TERMIO
     72   1.1       cgd #   include <sys/termio.h>
     73   1.1       cgd #  else
     74   1.1       cgd #   include <sys/termios.h>
     75  1.13  christos #   define termio termios
     76  1.13  christos #  endif
     77  1.13  christos # else
     78  1.13  christos #  if defined(TCSANOW)
     79   1.1       cgd #   define termio termios
     80   1.1       cgd #  endif
     81   1.1       cgd # endif
     82   1.1       cgd #endif
     83   1.1       cgd #if defined(NO_CC_T) || !defined(USE_TERMIO)
     84   1.1       cgd # if !defined(USE_TERMIO)
     85   1.1       cgd typedef char cc_t;
     86   1.1       cgd # else
     87   1.1       cgd typedef unsigned char cc_t;
     88   1.1       cgd # endif
     89   1.1       cgd #endif
     90   1.1       cgd 
     91   1.1       cgd #ifndef	NO_STRING_H
     92   1.1       cgd #include <string.h>
     93   1.6       jtk #else
     94   1.6       jtk #include <strings.h>
     95   1.1       cgd #endif
     96   1.1       cgd 
     97   1.1       cgd #ifndef	_POSIX_VDISABLE
     98   1.1       cgd # ifdef sun
     99   1.1       cgd #  include <sys/param.h>	/* pick up VDISABLE definition, mayby */
    100   1.1       cgd # endif
    101   1.1       cgd # ifdef VDISABLE
    102   1.1       cgd #  define _POSIX_VDISABLE VDISABLE
    103   1.1       cgd # else
    104   1.1       cgd #  define _POSIX_VDISABLE ((cc_t)'\377')
    105   1.1       cgd # endif
    106   1.1       cgd #endif
    107   1.1       cgd 
    108   1.1       cgd #define	SUBBUFSIZE	256
    109   1.1       cgd 
    110   1.3       cgd #ifndef CRAY
    111   1.1       cgd extern int errno;		/* outside this world */
    112   1.3       cgd #endif /* !CRAY */
    113   1.1       cgd 
    114   1.6       jtk #include <sys/cdefs.h>
    115   1.6       jtk #define P __P
    116   1.1       cgd 
    117   1.1       cgd extern int
    118   1.1       cgd     autologin,		/* Autologin enabled */
    119   1.1       cgd     skiprc,		/* Don't process the ~/.telnetrc file */
    120   1.1       cgd     eight,		/* use eight bit mode (binary in and/or out */
    121   1.1       cgd     flushout,		/* flush output */
    122   1.1       cgd     connected,		/* Are we connected to the other side? */
    123   1.1       cgd     globalmode,		/* Mode tty should be in */
    124   1.6       jtk     In3270,		/* Are we in 3270 mode? */
    125   1.1       cgd     telnetport,		/* Are we connected to the telnet port? */
    126   1.1       cgd     localflow,		/* Flow control handled locally */
    127   1.3       cgd     restartany,		/* If flow control, restart output on any character */
    128   1.1       cgd     localchars,		/* we recognize interrupt/quit */
    129   1.6       jtk     donelclchars,	/* the user has set "localchars" */
    130   1.1       cgd     showoptions,
    131   1.1       cgd     net,		/* Network file descriptor */
    132   1.1       cgd     tin,		/* Terminal input file descriptor */
    133   1.1       cgd     tout,		/* Terminal output file descriptor */
    134   1.1       cgd     crlf,		/* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */
    135   1.1       cgd     autoflush,		/* flush output when interrupting? */
    136   1.1       cgd     autosynch,		/* send interrupt characters with SYNCH? */
    137   1.1       cgd     SYNCHing,		/* Is the stream in telnet SYNCH mode? */
    138   1.1       cgd     donebinarytoggle,	/* the user has put us in binary */
    139   1.1       cgd     dontlecho,		/* do we suppress local echoing right now? */
    140   1.1       cgd     crmod,
    141   1.1       cgd     netdata,		/* Print out network data flow */
    142   1.1       cgd     prettydump,		/* Print "netdata" output in user readable format */
    143   1.1       cgd #if	defined(unix)
    144   1.1       cgd #if	defined(TN3270)
    145   1.1       cgd     cursesdata,		/* Print out curses data flow */
    146   1.1       cgd     apitrace,		/* Trace API transactions */
    147   1.1       cgd #endif	/* defined(TN3270) */
    148   1.1       cgd     termdata,		/* Print out terminal data flow */
    149   1.1       cgd #endif	/* defined(unix) */
    150   1.7       jtk     debug,		/* Debug level */
    151   1.7       jtk     clienteof;		/* Client received EOF */
    152   1.1       cgd 
    153   1.1       cgd extern cc_t escape;	/* Escape to command mode */
    154   1.1       cgd extern cc_t rlogin;	/* Rlogin mode escape character */
    155   1.1       cgd #ifdef	KLUDGELINEMODE
    156   1.1       cgd extern cc_t echoc;	/* Toggle local echoing */
    157   1.1       cgd #endif
    158   1.1       cgd 
    159   1.1       cgd extern char
    160   1.1       cgd     *prompt;		/* Prompt for command. */
    161   1.1       cgd 
    162   1.1       cgd extern char
    163   1.1       cgd     doopt[],
    164   1.1       cgd     dont[],
    165   1.1       cgd     will[],
    166   1.1       cgd     wont[],
    167   1.1       cgd     options[],		/* All the little options */
    168   1.1       cgd     *hostname;		/* Who are we connected to? */
    169   1.1       cgd 
    170   1.1       cgd /*
    171   1.1       cgd  * We keep track of each side of the option negotiation.
    172   1.1       cgd  */
    173   1.1       cgd 
    174   1.1       cgd #define	MY_STATE_WILL		0x01
    175   1.1       cgd #define	MY_WANT_STATE_WILL	0x02
    176   1.1       cgd #define	MY_STATE_DO		0x04
    177   1.1       cgd #define	MY_WANT_STATE_DO	0x08
    178   1.1       cgd 
    179   1.1       cgd /*
    180   1.1       cgd  * Macros to check the current state of things
    181   1.1       cgd  */
    182   1.1       cgd 
    183   1.1       cgd #define	my_state_is_do(opt)		(options[opt]&MY_STATE_DO)
    184   1.1       cgd #define	my_state_is_will(opt)		(options[opt]&MY_STATE_WILL)
    185   1.1       cgd #define my_want_state_is_do(opt)	(options[opt]&MY_WANT_STATE_DO)
    186   1.1       cgd #define my_want_state_is_will(opt)	(options[opt]&MY_WANT_STATE_WILL)
    187   1.1       cgd 
    188   1.1       cgd #define	my_state_is_dont(opt)		(!my_state_is_do(opt))
    189   1.1       cgd #define	my_state_is_wont(opt)		(!my_state_is_will(opt))
    190   1.1       cgd #define my_want_state_is_dont(opt)	(!my_want_state_is_do(opt))
    191   1.1       cgd #define my_want_state_is_wont(opt)	(!my_want_state_is_will(opt))
    192   1.1       cgd 
    193   1.1       cgd #define	set_my_state_do(opt)		{options[opt] |= MY_STATE_DO;}
    194   1.1       cgd #define	set_my_state_will(opt)		{options[opt] |= MY_STATE_WILL;}
    195   1.1       cgd #define	set_my_want_state_do(opt)	{options[opt] |= MY_WANT_STATE_DO;}
    196   1.1       cgd #define	set_my_want_state_will(opt)	{options[opt] |= MY_WANT_STATE_WILL;}
    197   1.1       cgd 
    198   1.1       cgd #define	set_my_state_dont(opt)		{options[opt] &= ~MY_STATE_DO;}
    199   1.1       cgd #define	set_my_state_wont(opt)		{options[opt] &= ~MY_STATE_WILL;}
    200   1.1       cgd #define	set_my_want_state_dont(opt)	{options[opt] &= ~MY_WANT_STATE_DO;}
    201   1.1       cgd #define	set_my_want_state_wont(opt)	{options[opt] &= ~MY_WANT_STATE_WILL;}
    202   1.1       cgd 
    203   1.1       cgd /*
    204   1.1       cgd  * Make everything symetrical
    205   1.1       cgd  */
    206   1.1       cgd 
    207   1.1       cgd #define	HIS_STATE_WILL			MY_STATE_DO
    208   1.1       cgd #define	HIS_WANT_STATE_WILL		MY_WANT_STATE_DO
    209   1.1       cgd #define HIS_STATE_DO			MY_STATE_WILL
    210   1.1       cgd #define HIS_WANT_STATE_DO		MY_WANT_STATE_WILL
    211   1.1       cgd 
    212   1.1       cgd #define	his_state_is_do			my_state_is_will
    213   1.1       cgd #define	his_state_is_will		my_state_is_do
    214   1.1       cgd #define his_want_state_is_do		my_want_state_is_will
    215   1.1       cgd #define his_want_state_is_will		my_want_state_is_do
    216   1.1       cgd 
    217   1.1       cgd #define	his_state_is_dont		my_state_is_wont
    218   1.1       cgd #define	his_state_is_wont		my_state_is_dont
    219   1.1       cgd #define his_want_state_is_dont		my_want_state_is_wont
    220   1.1       cgd #define his_want_state_is_wont		my_want_state_is_dont
    221   1.1       cgd 
    222   1.1       cgd #define	set_his_state_do		set_my_state_will
    223   1.1       cgd #define	set_his_state_will		set_my_state_do
    224   1.1       cgd #define	set_his_want_state_do		set_my_want_state_will
    225   1.1       cgd #define	set_his_want_state_will		set_my_want_state_do
    226   1.1       cgd 
    227   1.1       cgd #define	set_his_state_dont		set_my_state_wont
    228   1.1       cgd #define	set_his_state_wont		set_my_state_dont
    229   1.1       cgd #define	set_his_want_state_dont		set_my_want_state_wont
    230   1.1       cgd #define	set_his_want_state_wont		set_my_want_state_dont
    231   1.1       cgd 
    232   1.1       cgd 
    233   1.1       cgd extern FILE
    234   1.1       cgd     *NetTrace;		/* Where debugging output goes */
    235   1.1       cgd extern unsigned char
    236   1.1       cgd     NetTraceFile[];	/* Name of file where debugging output goes */
    237   1.1       cgd 
    238   1.1       cgd extern jmp_buf
    239   1.1       cgd     peerdied,
    240   1.1       cgd     toplevel;		/* For error conditions. */
    241   1.1       cgd 
    242   1.1       cgd 
    243   1.9  christos /* authenc.c */
    244   1.9  christos int net_write P((unsigned char *, int));
    245   1.9  christos void net_encrypt P((void));
    246   1.9  christos int telnet_spin P((void));
    247   1.9  christos char *telnet_getenv P((char *));
    248   1.9  christos char *telnet_gets P((char *, char *, int, int));
    249   1.9  christos 
    250   1.9  christos /* commands.c */
    251   1.9  christos int send_tncmd P((void (*)(int, int), char *, char *));
    252   1.9  christos void _setlist_init P((void));
    253   1.9  christos void set_escape_char P((char *));
    254   1.9  christos int set_mode P((int));
    255   1.9  christos int clear_mode P((int));
    256   1.9  christos int modehelp P((int));
    257   1.9  christos int suspend P((int, char *[]));
    258   1.9  christos int shell P((int, char *[]));
    259   1.9  christos int quit P((int, char *[]));
    260   1.9  christos int logout P((int, char *[]));
    261   1.9  christos int env_cmd P((int, char *[]));
    262   1.9  christos struct env_lst *env_find P((unsigned char *));
    263   1.9  christos void env_init P((void));
    264   1.9  christos struct env_lst *env_define P((unsigned char *, unsigned char *));
    265   1.9  christos struct env_lst *env_undefine P((unsigned char *, unsigned char *));
    266   1.9  christos struct env_lst *env_export P((unsigned char *, unsigned char *));
    267   1.9  christos struct env_lst *env_unexport P((unsigned char *, unsigned char *));
    268   1.9  christos struct env_lst *env_send P((unsigned char *, unsigned char *));
    269   1.9  christos struct env_lst *env_list P((unsigned char *, unsigned char *));
    270   1.9  christos unsigned char *env_default P((int, int ));
    271   1.9  christos unsigned char *env_getvalue P((unsigned char *));
    272   1.9  christos void env_varval P((unsigned char *));
    273   1.9  christos int auth_cmd P((int, char *[]));
    274   1.9  christos int ayt_status P((void));
    275   1.9  christos int tn P((int, char *[]));
    276   1.9  christos void command P((int, char *, int));
    277  1.11   mycroft void cmdrc P((const char *, const char *));
    278   1.9  christos unsigned long sourceroute P((char *, char **, unsigned long *));
    279   1.9  christos 
    280   1.9  christos /* main.c */
    281   1.9  christos void tninit P((void));
    282   1.9  christos void usage P((void));
    283   1.9  christos 
    284   1.9  christos /* network.c */
    285   1.9  christos void init_network P((void));
    286   1.9  christos int stilloob P((void));
    287   1.9  christos void setneturg P((void));
    288   1.9  christos int netflush P((void));
    289   1.9  christos 
    290   1.9  christos /* sys_bsd.c */
    291   1.9  christos void init_sys P((void));
    292   1.9  christos int TerminalWrite P((char *, int));
    293   1.9  christos int TerminalRead P((unsigned char *, int));
    294   1.9  christos int TerminalAutoFlush P((void));
    295   1.9  christos int TerminalSpecialChars P((int));
    296   1.9  christos void TerminalFlushOutput P((void));
    297   1.9  christos void TerminalSaveState P((void));
    298   1.9  christos cc_t *tcval P((int));
    299   1.9  christos void TerminalDefaultChars P((void));
    300   1.9  christos void TerminalRestoreState P((void));
    301   1.9  christos void TerminalNewMode P((int));
    302   1.9  christos void TerminalSpeeds P((long *, long *));
    303   1.9  christos int TerminalWindowSize P((long *, long *));
    304   1.9  christos int NetClose P((int));
    305   1.9  christos void NetNonblockingIO P((int, int));
    306   1.9  christos void NetSigIO P((int, int));
    307   1.9  christos void NetSetPgrp P((int));
    308   1.9  christos void sys_telnet_init P((void));
    309   1.9  christos int process_rings P((int , int , int , int , int , int));
    310   1.9  christos 
    311   1.9  christos /* telnet.c */
    312   1.9  christos void init_telnet P((void));
    313   1.9  christos void send_do P((int, int ));
    314   1.9  christos void send_dont P((int, int ));
    315   1.9  christos void send_will P((int, int ));
    316   1.9  christos void send_wont P((int, int ));
    317   1.9  christos void willoption P((int));
    318   1.9  christos void wontoption P((int));
    319   1.9  christos char **mklist P((char *, char *));
    320   1.9  christos int is_unique P((char *, char **, char **));
    321  1.12  christos int setup_term P((char *, int, int *));
    322   1.9  christos char *gettermname P((void));
    323   1.9  christos void lm_will P((unsigned char *, int));
    324   1.9  christos void lm_wont P((unsigned char *, int));
    325   1.9  christos void lm_do P((unsigned char *, int));
    326   1.9  christos void lm_dont P((unsigned char *, int));
    327   1.9  christos void lm_mode P((unsigned char *, int, int ));
    328   1.9  christos void slc_init P((void));
    329   1.9  christos void slcstate P((void));
    330   1.9  christos void slc_mode_export P((int));
    331   1.9  christos void slc_mode_import P((int));
    332   1.9  christos void slc_import P((int));
    333   1.9  christos void slc_export P((void));
    334   1.9  christos void slc P((unsigned char *, int));
    335   1.9  christos void slc_check P((void));
    336   1.9  christos void slc_start_reply P((void));
    337   1.9  christos void slc_add_reply P((unsigned int, unsigned int, cc_t));
    338   1.9  christos void slc_end_reply P((void));
    339   1.9  christos int slc_update P((void));
    340   1.9  christos void env_opt P((unsigned char *, int));
    341   1.9  christos void env_opt_start P((void));
    342   1.9  christos void env_opt_start_info P((void));
    343   1.9  christos void env_opt_add P((unsigned char *));
    344   1.9  christos int opt_welldefined P((char *));
    345   1.9  christos void env_opt_end P((int));
    346   1.9  christos int telrcv P((void));
    347   1.9  christos int rlogin_susp P((void));
    348   1.9  christos int Scheduler P((int));
    349  1.11   mycroft void telnet P((const char *));
    350   1.9  christos void xmitAO P((void));
    351   1.9  christos void xmitEL P((void));
    352   1.9  christos void xmitEC P((void));
    353   1.9  christos int dosynch P((char *));
    354   1.9  christos int get_status P((char *));
    355   1.9  christos void intp P((void));
    356   1.9  christos void sendbrk P((void));
    357   1.9  christos void sendabort P((void));
    358   1.9  christos void sendsusp P((void));
    359   1.9  christos void sendeof P((void));
    360   1.9  christos void sendayt P((void));
    361   1.9  christos void sendnaws P((void));
    362   1.9  christos void tel_enter_binary P((int));
    363   1.9  christos void tel_leave_binary P((int));
    364   1.9  christos 
    365   1.9  christos /* terminal.c */
    366   1.9  christos void init_terminal P((void));
    367   1.9  christos int ttyflush P((int));
    368   1.9  christos int getconnmode P((void));
    369   1.9  christos void setconnmode P((int));
    370   1.9  christos void setcommandmode P((void));
    371   1.9  christos 
    372   1.9  christos /* utilities.c */
    373   1.9  christos void upcase P((char *));
    374   1.9  christos int SetSockOpt P((int, int , int , int ));
    375   1.9  christos void SetNetTrace P((char *));
    376   1.9  christos void Dump P((int, unsigned char *, int));
    377   1.9  christos void printoption P((char *, int, int ));
    378   1.9  christos void optionstatus P((void));
    379   1.9  christos void printsub P((int, unsigned char *, int));
    380   1.9  christos void EmptyTerminal P((void));
    381   1.9  christos void SetForExit P((void));
    382   1.9  christos void Exit P((int)) __attribute__((__noreturn__));
    383   1.9  christos void ExitString P((char *, int)) __attribute__((__noreturn__));
    384   1.1       cgd 
    385   1.1       cgd #ifndef	USE_TERMIO
    386   1.1       cgd 
    387   1.1       cgd extern struct	tchars ntc;
    388   1.1       cgd extern struct	ltchars nltc;
    389   1.1       cgd extern struct	sgttyb nttyb;
    390   1.1       cgd 
    391   1.1       cgd # define termEofChar		ntc.t_eofc
    392   1.1       cgd # define termEraseChar		nttyb.sg_erase
    393   1.1       cgd # define termFlushChar		nltc.t_flushc
    394   1.1       cgd # define termIntChar		ntc.t_intrc
    395   1.1       cgd # define termKillChar		nttyb.sg_kill
    396   1.1       cgd # define termLiteralNextChar	nltc.t_lnextc
    397   1.1       cgd # define termQuitChar		ntc.t_quitc
    398   1.1       cgd # define termSuspChar		nltc.t_suspc
    399   1.1       cgd # define termRprntChar		nltc.t_rprntc
    400   1.1       cgd # define termWerasChar		nltc.t_werasc
    401   1.1       cgd # define termStartChar		ntc.t_startc
    402   1.1       cgd # define termStopChar		ntc.t_stopc
    403   1.1       cgd # define termForw1Char		ntc.t_brkc
    404   1.1       cgd extern cc_t termForw2Char;
    405   1.1       cgd extern cc_t termAytChar;
    406   1.1       cgd 
    407   1.1       cgd # define termEofCharp		(cc_t *)&ntc.t_eofc
    408   1.1       cgd # define termEraseCharp		(cc_t *)&nttyb.sg_erase
    409   1.1       cgd # define termFlushCharp		(cc_t *)&nltc.t_flushc
    410   1.1       cgd # define termIntCharp		(cc_t *)&ntc.t_intrc
    411   1.1       cgd # define termKillCharp		(cc_t *)&nttyb.sg_kill
    412   1.1       cgd # define termLiteralNextCharp	(cc_t *)&nltc.t_lnextc
    413   1.1       cgd # define termQuitCharp		(cc_t *)&ntc.t_quitc
    414   1.1       cgd # define termSuspCharp		(cc_t *)&nltc.t_suspc
    415   1.1       cgd # define termRprntCharp		(cc_t *)&nltc.t_rprntc
    416   1.1       cgd # define termWerasCharp		(cc_t *)&nltc.t_werasc
    417   1.1       cgd # define termStartCharp		(cc_t *)&ntc.t_startc
    418   1.1       cgd # define termStopCharp		(cc_t *)&ntc.t_stopc
    419   1.1       cgd # define termForw1Charp		(cc_t *)&ntc.t_brkc
    420   1.1       cgd # define termForw2Charp		(cc_t *)&termForw2Char
    421   1.1       cgd # define termAytCharp		(cc_t *)&termAytChar
    422   1.1       cgd 
    423   1.1       cgd # else
    424   1.1       cgd 
    425   1.1       cgd extern struct	termio new_tc;
    426   1.1       cgd 
    427   1.1       cgd # define termEofChar		new_tc.c_cc[VEOF]
    428   1.1       cgd # define termEraseChar		new_tc.c_cc[VERASE]
    429   1.1       cgd # define termIntChar		new_tc.c_cc[VINTR]
    430   1.1       cgd # define termKillChar		new_tc.c_cc[VKILL]
    431   1.1       cgd # define termQuitChar		new_tc.c_cc[VQUIT]
    432   1.1       cgd 
    433   1.1       cgd # ifndef	VSUSP
    434   1.1       cgd extern cc_t termSuspChar;
    435   1.1       cgd # else
    436   1.1       cgd #  define termSuspChar		new_tc.c_cc[VSUSP]
    437   1.1       cgd # endif
    438   1.1       cgd # if	defined(VFLUSHO) && !defined(VDISCARD)
    439   1.1       cgd #  define VDISCARD VFLUSHO
    440   1.1       cgd # endif
    441   1.1       cgd # ifndef	VDISCARD
    442   1.1       cgd extern cc_t termFlushChar;
    443   1.1       cgd # else
    444   1.1       cgd #  define termFlushChar		new_tc.c_cc[VDISCARD]
    445   1.1       cgd # endif
    446   1.1       cgd # ifndef VWERASE
    447   1.1       cgd extern cc_t termWerasChar;
    448   1.1       cgd # else
    449   1.1       cgd #  define termWerasChar		new_tc.c_cc[VWERASE]
    450   1.1       cgd # endif
    451   1.1       cgd # ifndef	VREPRINT
    452   1.1       cgd extern cc_t termRprntChar;
    453   1.1       cgd # else
    454   1.1       cgd #  define termRprntChar		new_tc.c_cc[VREPRINT]
    455   1.1       cgd # endif
    456   1.1       cgd # ifndef	VLNEXT
    457   1.1       cgd extern cc_t termLiteralNextChar;
    458   1.1       cgd # else
    459   1.1       cgd #  define termLiteralNextChar	new_tc.c_cc[VLNEXT]
    460   1.1       cgd # endif
    461   1.1       cgd # ifndef	VSTART
    462   1.1       cgd extern cc_t termStartChar;
    463   1.1       cgd # else
    464   1.1       cgd #  define termStartChar		new_tc.c_cc[VSTART]
    465   1.1       cgd # endif
    466   1.1       cgd # ifndef	VSTOP
    467   1.1       cgd extern cc_t termStopChar;
    468   1.1       cgd # else
    469   1.1       cgd #  define termStopChar		new_tc.c_cc[VSTOP]
    470   1.1       cgd # endif
    471   1.1       cgd # ifndef	VEOL
    472   1.1       cgd extern cc_t termForw1Char;
    473   1.1       cgd # else
    474   1.1       cgd #  define termForw1Char		new_tc.c_cc[VEOL]
    475   1.1       cgd # endif
    476   1.1       cgd # ifndef	VEOL2
    477   1.1       cgd extern cc_t termForw2Char;
    478   1.1       cgd # else
    479   1.1       cgd #  define termForw2Char		new_tc.c_cc[VEOL]
    480   1.1       cgd # endif
    481   1.1       cgd # ifndef	VSTATUS
    482   1.1       cgd extern cc_t termAytChar;
    483   1.1       cgd #else
    484   1.1       cgd #  define termAytChar		new_tc.c_cc[VSTATUS]
    485   1.1       cgd #endif
    486   1.1       cgd 
    487   1.1       cgd # if !defined(CRAY) || defined(__STDC__)
    488   1.1       cgd #  define termEofCharp		&termEofChar
    489   1.1       cgd #  define termEraseCharp	&termEraseChar
    490   1.1       cgd #  define termIntCharp		&termIntChar
    491   1.1       cgd #  define termKillCharp		&termKillChar
    492   1.1       cgd #  define termQuitCharp		&termQuitChar
    493   1.1       cgd #  define termSuspCharp		&termSuspChar
    494   1.1       cgd #  define termFlushCharp	&termFlushChar
    495   1.1       cgd #  define termWerasCharp	&termWerasChar
    496   1.1       cgd #  define termRprntCharp	&termRprntChar
    497   1.1       cgd #  define termLiteralNextCharp	&termLiteralNextChar
    498   1.1       cgd #  define termStartCharp	&termStartChar
    499   1.1       cgd #  define termStopCharp		&termStopChar
    500   1.1       cgd #  define termForw1Charp	&termForw1Char
    501   1.1       cgd #  define termForw2Charp	&termForw2Char
    502   1.1       cgd #  define termAytCharp		&termAytChar
    503   1.1       cgd # else
    504   1.1       cgd 	/* Work around a compiler bug */
    505   1.1       cgd #  define termEofCharp		0
    506   1.1       cgd #  define termEraseCharp	0
    507   1.1       cgd #  define termIntCharp		0
    508   1.1       cgd #  define termKillCharp		0
    509   1.1       cgd #  define termQuitCharp		0
    510   1.1       cgd #  define termSuspCharp		0
    511   1.1       cgd #  define termFlushCharp	0
    512   1.1       cgd #  define termWerasCharp	0
    513   1.1       cgd #  define termRprntCharp	0
    514   1.1       cgd #  define termLiteralNextCharp	0
    515   1.1       cgd #  define termStartCharp	0
    516   1.1       cgd #  define termStopCharp		0
    517   1.1       cgd #  define termForw1Charp	0
    518   1.1       cgd #  define termForw2Charp	0
    519   1.1       cgd #  define termAytCharp		0
    520   1.1       cgd # endif
    521   1.1       cgd #endif
    522   1.1       cgd 
    523   1.1       cgd 
    524   1.1       cgd /* Tn3270 section */
    525   1.1       cgd #if	defined(TN3270)
    526   1.1       cgd 
    527   1.1       cgd extern int
    528   1.1       cgd     HaveInput,		/* Whether an asynchronous I/O indication came in */
    529   1.1       cgd     noasynchtty,	/* Don't do signals on I/O (SIGURG, SIGIO) */
    530   1.1       cgd     noasynchnet,	/* Don't do signals on I/O (SIGURG, SIGIO) */
    531   1.1       cgd     sigiocount,		/* Count of SIGIO receptions */
    532   1.1       cgd     shell_active;	/* Subshell is active */
    533   1.1       cgd 
    534   1.1       cgd extern char
    535   1.1       cgd     *Ibackp,		/* Oldest byte of 3270 data */
    536   1.1       cgd     Ibuf[],		/* 3270 buffer */
    537   1.1       cgd     *Ifrontp,		/* Where next 3270 byte goes */
    538   1.1       cgd     tline[],
    539   1.1       cgd     *transcom;		/* Transparent command */
    540   1.1       cgd 
    541   1.9  christos /* tn3270.c */
    542   1.9  christos void init_3270 P((void));
    543   1.9  christos int DataToNetwork P((char *, int, int));
    544   1.9  christos void inputAvailable P((int));
    545   1.9  christos void outputPurge P((void));
    546   1.9  christos int DataToTerminal P((char *, int));
    547   1.9  christos int Push3270 P((void));
    548   1.9  christos void Finish3270 P((void));
    549   1.9  christos void StringToTerminal P((char *));
    550   1.9  christos void _putchar P((int));
    551   1.9  christos void SetIn3270 P((void));
    552   1.9  christos int tn3270_ttype P((void));
    553   1.9  christos int settranscom P((int, char *[]));
    554  1.10  christos int shell_continue P((void));
    555  1.10  christos int DataFromTerminal __P((char *, int));
    556  1.10  christos int DataFromNetwork __P((char *, int, int));
    557  1.10  christos void ConnectScreen __P((void));
    558  1.10  christos int DoTerminalOutput __P((void));
    559   1.1       cgd 
    560   1.1       cgd #endif	/* defined(TN3270) */
    561