BSD 4_3_Tahoe release
[unix-history] / usr / src / ucb / window / ww.h
index fafa421..60a0275 100644 (file)
@@ -1,11 +1,20 @@
 /*
 /*
- * @(#)ww.h    3.37 5/2/86     
- */
-
-/*
- * Copyright (c) 1983 Regents of the University of California,
- * All rights reserved.  Redistribution permitted subject to
- * the terms of the Berkeley Software License Agreement.
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)ww.h        3.49 (Berkeley) 6/29/88
  */
 
 #include <sgtty.h>
  */
 
 #include <sgtty.h>
@@ -77,6 +86,7 @@ struct ww {
        char ww_id;             /* the user window id */
        char ww_center;         /* center the label */
        char ww_hasframe;       /* frame it */
        char ww_id;             /* the user window id */
        char ww_center;         /* center the label */
        char ww_hasframe;       /* frame it */
+       char ww_keepopen;       /* keep it open after the process dies */
        char *ww_label;         /* the user supplied label */
        struct ww_dim ww_alt;   /* alternate position and size */
 };
        char *ww_label;         /* the user supplied label */
        struct ww_dim ww_alt;   /* alternate position and size */
 };
@@ -94,7 +104,7 @@ struct ww_tty {
 union ww_char {
        short c_w;              /* as a word */
        struct {
 union ww_char {
        short c_w;              /* as a word */
        struct {
-#ifndef mc68000
+#if defined(vax) || defined(MIPSEL)
                char C_c;       /* the character part */
                char C_m;       /* the mode part */
 #else
                char C_c;       /* the character part */
                char C_m;       /* the mode part */
 #else
@@ -116,8 +126,9 @@ union ww_char {
 #define WWM_BLK                0x02    /* blinking */
 #define WWM_UL         0x04    /* underlined */
 #define WWM_GRP                0x08    /* graphics */
 #define WWM_BLK                0x02    /* blinking */
 #define WWM_UL         0x04    /* underlined */
 #define WWM_GRP                0x08    /* graphics */
-#define WWM_USR                0x10    /* user specified mode */
-#define WWM_GLS                0x40    /* window only, glass, i.e. transparent */
+#define WWM_DIM                0x10    /* half intensity */
+#define WWM_USR                0x20    /* user specified mode */
+#define WWM_GLS                0x40    /* window only, glass, i.e., transparent */
 
        /* ww_state values */
 #define WWS_INITIAL    0       /* just opened */
 
        /* ww_state values */
 #define WWS_INITIAL    0       /* just opened */
@@ -168,8 +179,6 @@ struct ww_tty wwnewtty;             /* the new (current) terminal settings */
 struct ww_tty wwwintty;                /* the terminal settings for windows */
 char *wwterm;                  /* the terminal name */
 char wwtermcap[1024];          /* place for the termcap */
 struct ww_tty wwwintty;                /* the terminal settings for windows */
 char *wwterm;                  /* the terminal name */
 char wwtermcap[1024];          /* place for the termcap */
-char wwkeys[512];              /* termcap fields for the function keys */
-char wwwintermcap[1024];       /* termcap for windows */
 
        /* generally useful variables */
 int wwnrow, wwncol;            /* the screen size */
 
        /* generally useful variables */
 int wwnrow, wwncol;            /* the screen size */
@@ -181,7 +190,7 @@ char **wwsmap;                      /* the screen map */
 union ww_char **wwos;          /* the old (current) screen */
 union ww_char **wwns;          /* the new (desired) screen */
 char *wwtouched;               /* wwns changed flags */
 union ww_char **wwos;          /* the old (current) screen */
 union ww_char **wwns;          /* the new (desired) screen */
 char *wwtouched;               /* wwns changed flags */
-int wwbaudmap[];               /* maps stty() baud rate code into number */
+extern int wwbaudmap[];                /* maps stty() baud rate code into number */
 int wwbaud;                    /* wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed] */
 int wwcursorrow, wwcursorcol;  /* where we want the cursor to be */
 int wwerrno;                   /* error number */
 int wwbaud;                    /* wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed] */
 int wwcursorrow, wwcursorcol;  /* where we want the cursor to be */
 int wwerrno;                   /* error number */
@@ -205,8 +214,6 @@ int wwnselect, wwnselecte, wwnselectz;
        /* things for handling input */
 int wwrint();          /* interrupt handler */
 struct ww *wwcurwin;   /* window to copy input into */
        /* things for handling input */
 int wwrint();          /* interrupt handler */
 struct ww *wwcurwin;   /* window to copy input into */
-char wwsetjmp;         /* want a longjmp() from wwrint() */
-jmp_buf wwjmpbuf;      /* jmpbuf for above */
 char *wwib;            /* input (keyboard) buffer */
 char *wwibe;           /* wwib + sizeof buffer */
 char *wwibp;           /* current read position in buffer */
 char *wwib;            /* input (keyboard) buffer */
 char *wwibe;           /* wwib + sizeof buffer */
 char *wwibp;           /* current read position in buffer */
@@ -214,19 +221,32 @@ char *wwibq;              /* current write position in buffer */
 #define wwgetc()       (wwibp < wwibq ? *wwibp++ & 0x7f : -1)
 #define wwpeekc()      (wwibp < wwibq ? *wwibp & 0x7f : -1)
 #define wwungetc(c)    (wwibp > wwib ? *--wwibp = (c) : -1)
 #define wwgetc()       (wwibp < wwibq ? *wwibp++ & 0x7f : -1)
 #define wwpeekc()      (wwibp < wwibq ? *wwibp & 0x7f : -1)
 #define wwungetc(c)    (wwibp > wwib ? *--wwibp = (c) : -1)
-#define wwinterrupt()  (wwibp < wwibq)
+
+       /* things for short circuiting wwiomux() */
+char wwintr;           /* interrupting */
+char wwsetjmp;         /* want a longjmp() from wwrint() and wwchild() */
+jmp_buf wwjmpbuf;      /* jmpbuf for above */
+#define wwinterrupt()  wwintr
+#define wwsetintr()    (wwintr = 1, wwsetjmp ? longjmp(wwjmpbuf, 1) : 0)
+#define wwclrintr()    (wwintr = 0)
 
        /* the window virtual terminal */
 
        /* the window virtual terminal */
-#define WWT_TERM       "TERM=window"
-#define WWT_TERMCAP    "WW|window|window package:\
-       :cr=^M:nl=^J:bl=^G:\
-       :al=\\EL:am:le=^H:bs:cd=\\EJ:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :\
-       :da:db:dc=\\EN:dl=\\EM:do=\\EB:ei=\\EO:ho=\\EH:im=\\E@:mi:\
-       :nd=\\EC:ta=^I:pt:up=\\EA:"
-#define WWT_REV                "se=\\Eq:so=\\Ep:"
-#define WWT_UL         "ue=\\Es:us=\\Er:"
-#define WWT_GRP                "ae=\\EG:as=\\EF:"
-#define WWT_USR                "XE=\\EQ:XS=\\EP:"
+#define WWT_TERM       "window-v2"
+#define WWT_TERMCAP    "WW|window-v2|window program version 2:\
+       :am:bs:da:db:ms:pt:cr=^M:nl=^J:bl=^G:ta=^I:\
+       :cm=\\EY%+ %+ :le=^H:nd=\\EC:up=\\EA:do=\\EB:ho=\\EH:\
+       :cd=\\EJ:ce=\\EK:cl=\\EE:me=\\Er^?:"
+#define WWT_REV                "se=\\ErA:so=\\EsA:mr=\\EsA:"
+#define WWT_BLK                "BE=\\ErB:BS=\\EsB:mb=\\EsB:"
+#define WWT_UL         "ue=\\ErD:us=\\EsD:"
+#define WWT_GRP                "ae=\\ErH:as=\\EsH:"
+#define WWT_DIM                "HE=\\ErP:HS=\\EsP:mh=\\EsP:"
+#define WWT_USR                "XE=\\Er`:XS=\\Es`:"
+#define WWT_ALDL       "al=\\EL:dl=\\EM:"
+#define WWT_IMEI       "im=\\E@:ei=\\EO:mi:"
+#define WWT_DC         "dc=\\EN:"
+char wwwintermcap[1024];       /* terminal-specific but window-independent
+                                  part of the window termcap */
 
        /* our functions */
 struct ww *wwopen();
 
        /* our functions */
 struct ww *wwopen();
@@ -243,7 +263,6 @@ char *tgetstr();
 char *rindex();
 char *strcpy();
 char *strcat();
 char *rindex();
 char *strcpy();
 char *strcat();
-char *sprintf();
 
 #undef MIN
 #undef MAX
 
 #undef MIN
 #undef MAX