Main Page | Class List | File List | Class Members | File Members

screen.h

Go to the documentation of this file.
00001 /* Copyright (c) 1993-2002
00002  *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
00003  *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
00004  * Copyright (c) 1987 Oliver Laumann
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program (see the file COPYING); if not, write to the
00018  * Free Software Foundation, Inc.,
00019  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  *
00021  ****************************************************************
00022  * $Id: screen.h,v 1.12 1994/05/31 12:32:54 mlschroe Exp $ FAU
00023  */
00024 
00025 #include "os.h"
00026 
00027 #if defined(__STDC__)
00028 # ifndef __P
00029 #  define __P(a) a
00030 # endif
00031 #else
00032 # ifndef __P
00033 #  define __P(a) ()
00034 # endif
00035 # define const
00036 #endif
00037 
00038 #include "osdef.h"
00039 
00040 #include "ansi.h"
00041 #include "sched.h"
00042 #include "acls.h"
00043 #include "comm.h"
00044 #include "layer.h"
00045 #include "term.h"
00046 
00047 
00048 #ifdef DEBUG
00049 # define STATIC         /* a function that the debugger should see */
00050 #else
00051 # define STATIC static
00052 #endif
00053 
00054 #ifdef DEBUG
00055 # define DEBUGDIR "/tmp/debug"
00056 # define debugf(a)       do {if(dfp){fprintf a;fflush(dfp);}} while (0)
00057 # define debug(x)        debugf((dfp,x))
00058 # define debug1(x,a)     debugf((dfp,x,a))
00059 # define debug2(x,a,b)   debugf((dfp,x,a,b))
00060 # define debug3(x,a,b,c) debugf((dfp,x,a,b,c))
00061   extern FILE *dfp;
00062 #else
00063 # define debugf(a)       do {} while (0)
00064 # define debug(x)        debugf(x)
00065 # define debug1(x,a)     debugf(x)
00066 # define debug2(x,a,b)   debugf(x)
00067 # define debug3(x,a,b,c) debugf(x)
00068 #endif
00069 
00070 #ifndef DEBUG
00071 # define NOASSERT
00072 #endif
00073 
00074 #ifndef NOASSERT
00075 # if defined(__STDC__)
00076 #  define ASSERT(lousy_cpp) do {if (!(lousy_cpp)) {if (!dfp) opendebug(0, 1);debug2("ASSERT("#lousy_cpp") failed file %s line %d\n", __FILE__, __LINE__);abort();}} while (0)
00077 # else
00078 #  define ASSERT(lousy_cpp) do {if (!(lousy_cpp)) {if (!dfp) opendebug(0, 1);debug2("ASSERT(lousy_cpp) failed file %s line %d\n", __FILE__, __LINE__);abort();}} while (0)
00079 # endif
00080 #else
00081 # define ASSERT(lousy_cpp) do {} while (0)
00082 #endif
00083 
00084 /* here comes my own Free: jw. */
00085 #define Free(a) {if ((a) == 0) abort(); else free((void *)(a)); (a)=0;}
00086 
00087 #define Ctrl(c) ((c)&037)
00088 
00089 #define MAXSTR          256
00090 #define MAXARGS         64
00091 #define MSGWAIT         5
00092 #define MSGMINWAIT      1
00093 #define SILENCEWAIT     30
00094 
00095 /*
00096  * if a nasty user really wants to try a history of 3000 lines on all 10
00097  * windows, he will allocate 8 MegaBytes of memory, which is quite enough.
00098  */
00099 #define MAXHISTHEIGHT           3000
00100 #define DEFAULTHISTHEIGHT       100
00101 #if defined(NAME_MAX) && NAME_MAX < 16
00102 # define DEFAULT_BUFFERFILE     "/tmp/screen-xchg"
00103 #else
00104 # define DEFAULT_BUFFERFILE     "/tmp/screen-exchange"
00105 #endif
00106 
00107 
00108 #if defined(hpux) && !(defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT))
00109 # define HPUX_LTCHARS_HACK
00110 #endif
00111 
00112 struct mode
00113 {
00114 #ifdef POSIX
00115   struct termios tio;
00116 # ifdef HPUX_LTCHARS_HACK
00117   struct ltchars m_ltchars;
00118 # endif /* HPUX_LTCHARS_HACK */
00119 #else /* POSIX */
00120 # ifdef TERMIO
00121   struct termio tio;
00122 #  ifdef CYTERMIO
00123   int m_mapkey;
00124   int m_mapscreen;
00125   int m_backspace;
00126 #  endif
00127 # else /* TERMIO */
00128   struct sgttyb m_ttyb;
00129   struct tchars m_tchars;
00130   struct ltchars m_ltchars;
00131   int m_ldisc;
00132   int m_lmode;
00133 # endif /* TERMIO */
00134 #endif /* POSIX */
00135 #if defined(KANJI) && defined(TIOCKSET)
00136   struct jtchars m_jtchars;
00137   int m_knjmode;
00138 #endif
00139 };
00140 
00141 
00142 /* #include "logfile.h" */      /* (requires stat.h) struct logfile */
00143 #include "image.h"
00144 #include "display.h"
00145 #include "window.h"
00146 
00147 /*
00148  * Parameters for the Detach() routine
00149  */
00150 #define D_DETACH        0
00151 #define D_STOP          1
00152 #define D_REMOTE        2
00153 #define D_POWER         3
00154 #define D_REMOTE_POWER  4
00155 #define D_LOCK          5
00156 #define D_HANGUP        6
00157 
00158 /*
00159  * Here are the messages the attacher sends to the backend
00160  */
00161 #define MSG_CREATE      0
00162 #define MSG_ERROR       1
00163 #define MSG_ATTACH      2
00164 #define MSG_CONT        3
00165 #define MSG_DETACH      4
00166 #define MSG_POW_DETACH  5
00167 #define MSG_WINCH       6
00168 #define MSG_HANGUP      7
00169 #define MSG_COMMAND     8
00170 
00171 /*
00172  * versions of struct msg:
00173  * 0:   screen version 3.6.6 (version count introduced)
00174  */
00175 #define MSG_VERSION     0       
00176 #define MSG_REVISION    (('m'<<24) | ('s'<<16) | ('g'<<8) | MSG_VERSION)
00177 struct msg
00178 {
00179   int protocol_revision;        /* reduce harm done by incompatible messages */
00180   int type;
00181   char m_tty[MAXPATHLEN];       /* ttyname */
00182   union
00183     {
00184       struct
00185         {
00186           int lflag;
00187           int aflag;
00188           int flowflag;
00189           int hheight;          /* size of scrollback buffer */
00190           int nargs;
00191           char line[MAXPATHLEN];
00192           char dir[MAXPATHLEN];
00193           char screenterm[20];  /* is screen really "screen" ? */
00194         }
00195       create;
00196       struct
00197         {
00198           char auser[20 + 1];   /* username */
00199           int apid;             /* pid of frontend */
00200           int adaptflag;        /* adapt window size? */
00201           int lines, columns;   /* display size */
00202           char preselect[20];
00203           int esc;              /* his new escape character unless -1 */
00204           int meta_esc;         /* his new meta esc character unless -1 */
00205           char envterm[20 + 1]; /* terminal type */
00206           int encoding;         /* encoding of display */
00207         }
00208       attach;
00209       struct 
00210         {
00211           char duser[20 + 1];   /* username */
00212           int dpid;             /* pid of frontend */
00213         }
00214       detach;
00215       struct 
00216         {
00217           char auser[20 + 1];   /* username */
00218           int nargs;
00219           char cmd[MAXPATHLEN]; /* command */
00220           int apid;             /* pid of frontend */
00221           char preselect[20];
00222         }
00223       command;
00224       char message[MAXPATHLEN * 2];
00225     } m;
00226 };
00227 
00228 /*
00229  * And the signals the attacher receives from the backend
00230  */
00231 #define SIG_BYE         SIGHUP
00232 #define SIG_POWER_BYE   SIGUSR1
00233 #define SIG_LOCK        SIGUSR2
00234 #define SIG_STOP        SIGTSTP
00235 #ifdef SIGIO
00236 #define SIG_NODEBUG     SIGIO           /* triggerd by command 'debug off' */
00237 #endif
00238 
00239 
00240 #define BELL            (Ctrl('g'))
00241 #define VBELLWAIT       1 /* No. of seconds a vbell will be displayed */
00242 
00243 #define BELL_ON         0 /* No bell has occurred in the window */
00244 #define BELL_FOUND      1 /* A bell has occurred, but user not yet notified */
00245 #define BELL_DONE       2 /* A bell has occured, user has been notified */
00246 
00247 #define BELL_VISUAL     3 /* A bell has occured in fore win, notify him visually */
00248 
00249 #define MON_OFF         0 /* Monitoring is off in the window */
00250 #define MON_ON          1 /* No activity has occurred in the window */
00251 #define MON_FOUND       2 /* Activity has occured, but user not yet notified */
00252 #define MON_DONE        3 /* Activity has occured, user has been notified */
00253 
00254 #define DUMP_TERMCAP    0 /* WriteFile() options */
00255 #define DUMP_HARDCOPY   1
00256 #define DUMP_EXCHANGE   2
00257 #define DUMP_SCROLLBACK 3
00258 
00259 #define SILENCE_OFF     0
00260 #define SILENCE_ON      1
00261 
00262 extern char strnomem[];
00263 
00264 /*
00265  * line modes used by Input()
00266  */
00267 #define INP_COOKED      0
00268 #define INP_NOECHO      1
00269 #define INP_RAW         2
00270 #define INP_EVERY       4
00271 
00272 
00273 #ifdef MULTIUSER
00274 struct acl
00275 {
00276   struct acl *next;
00277   char *name;
00278 };
00279 #endif
00280 
00281 /* register list */
00282 #define MAX_PLOP_DEFS 256
00283 
00284 struct baud_values
00285 {
00286   int idx;      /* the index in the bsd-is padding lookup table */
00287   int bps;      /* bits per seconds */
00288   int sym;      /* symbol defined in ttydev.h */
00289 };
00290 
00291 /*
00292  * windowlist orders
00293  */
00294 #define WLIST_NUM 0
00295 #define WLIST_MRU 1

Generated on Sat Jul 2 20:56:16 2005 for GNU Screen by  doxygen 1.4.3