tip.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* tip - terminal interface program
*/
#ifdef USG
#include <fcntl.h> /* for O_RDWR, etc. */
#include <unistd.h> /* for R_OK, etc. */
#else
#endif
#include <signal.h>
#include <stdio.h>
#include <pwd.h>
#include <ctype.h>
#include <setjmp.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#define _CTRL(c) (c&037)
#ifdef USG
#endif
typedef void (*sig_handler_t)(); /* works on BSD and SV */
/*
* Remote host attributes
*/
char *DV; /* UNIX device(s) to open */
char *EL; /* chars marking an EOL */
char *CM; /* initial connection message */
char *IE; /* EOT to expect on input */
char *OE; /* EOT to send to complete FT */
char *CU; /* call unit if making a phone call */
char *AT; /* acu type */
char *PN; /* phone number(s) */
char *DI; /* disconnect string */
char *PA; /* parity to be generated */
char *PH; /* phone number file */
char *RM; /* remote file name */
char *HO; /* host name */
int BR; /* line speed for conversation */
int FS; /* frame size for transfers */
signed char DU; /* this host is dialed up */
char *ES; /* escape character */
char *EX; /* exceptions */
char *FO; /* force (literal next) char */
char *RC; /* raise character */
char *RE; /* script record file */
char *PR; /* remote prompt */
int DL; /* line delay for file transfers to remote */
int CL; /* char delay for file transfers to remote */
int ET; /* echocheck timeout */
int DB; /* dialback - ignore hangup */
/*
* String value table
*/
typedef
struct {
char *v_name; /* whose name is it */
char v_type; /* for interpreting set's */
char v_access; /* protection of touchy ones */
char *v_abrev; /* possible abreviation */
char *v_value; /* casted to a union later */
}
#define TRUE 1
#define FALSE 0
#define TMASK 017
/*
* Definition of ACU line description
*/
typedef
struct {
char *acu_name;
int (*acu_dialer)();
int (*acu_disconnect)();
int (*acu_abort)();
}
/*
* variable manipulation stuff --
* if we defined the value entry in value_t, then we couldn't
* initialize it in vars.c, so we cast it as needed to keep lint
* happy.
*/
typedef
union {
int zz_number;
int *zz_address;
#if defined(_LITTLE_ENDIAN)
short zz_boolean;
char zz_character;
#endif
#if defined(_BIG_ENDIAN)
int zz_boolean;
int zz_character;
#endif
}
/*
* Escape command table definitions --
* lookup in this table is performed when ``escapec'' is recognized
* at the begining of a line (as defined by the eolmarks variable).
*/
typedef
struct {
char e_char; /* char to match on */
char e_flags; /* experimental, priviledged */
char *e_help; /* help string */
int (*e_func)(); /* command */
}
#define NORM 00 /* normal protection, execute anyone */
extern int vflag; /* verbose during reading of .tiprc file */
extern int noparity;
#ifndef ACULOG
#define logent(a, b, c, d)
#define loginit()
#endif
/*
* Definition of indices into variable table so
* value(DEFINE) turns into a static address.
*/
#define BEAUTIFY 0
#define BAUDRATE 1
#define DIALTIMEOUT 2
#define EOFREAD 3
#define EOFWRITE 4
#define EOL 5
#define ESCAPE 6
#define EXCEPTIONS 7
#define FORCE 8
#define FRAMESIZE 9
#define HOST 10
#define LOG 11
#define PHONES 12
#define PROMPT 13
#define RAISE 14
#define RAISECHAR 15
#define RECORD 16
#define REMOTE 17
#define SCRIPT 18
#define TABEXPAND 19
#define VERBOSE 20
#define SHELL 21
#define HOME 22
#define ECHOCHECK 23
#define DISCONNECT 24
#define TAND 25
#define LDELAY 26
#define CDELAY 27
#define ETIMEOUT 28
#define RAWFTP 29
#define HALFDUPLEX 30
#define LECHO 31
#define PARITY 32
#define HARDWAREFLOW 33
int FD; /* open file descriptor to remote host */
int AC; /* open file descriptor to dialer (v831 only) */
int vflag; /* print .tiprc initialization sequence */
int sfd; /* for ~< operation */
int pid; /* pid of tipout */
int stoprompt; /* for interrupting a prompt session */
int timedout; /* ~> transfer timedout */
int cumode; /* simulating the "cu" program */
char ccc; /* synchronization character */
char ch; /* for tipout */
char *uucplock; /* name of lock file for uucp's */
extern int trusted_device;
extern char *ctrl();
extern char *ctime();
extern char *getlogin();
extern char *vinterp();
extern char *getenv();
extern char *malloc();
extern char *connect();