home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / tn3270 / ctlr / function.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  4.8 KB  |  167 lines

  1. /*-
  2.  * Copyright (c) 1988 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)function.h    4.2 (Berkeley) 4/26/91
  34.  */
  35.  
  36. /*
  37.  * The following are the various functions which the keyboard can ask
  38.  * the controller to perform.
  39.  *
  40.  * Note that this file (the following entries) are scanned by mkhit.c,
  41.  * and that the format must remain more-or-less consistent
  42.  * [ \t]*TOKEN
  43.  */
  44.  
  45. enum ctlrfcn {
  46.  
  47.     undefined = 0,            /* Not yet touched */
  48.  
  49.     FCN_NULL,              /* Illegal sequence */
  50.  
  51.     FCN_RESET,            /* unlock keyboard */
  52.     FCN_MAKE_SHIFT_LOCK,
  53.     FCN_BREAK_SHIFT_LOCK,
  54.  
  55.     FCN_MAKE_SHIFT,            /* shift key pressed DOWN */
  56.     FCN_BREAK_SHIFT,        /* shift key released */
  57.  
  58.     FCN_MAKE_ALT,            /* alt key pressed DOWN */
  59.     FCN_BREAK_ALT,            /* alt key released */
  60.  
  61.     FCN_MAKE_CTRL,
  62.  
  63.     FCN_CAPS_LOCK,
  64.  
  65.     FCN_MONOCASE,            /* DISPLAY in upper case */
  66.     FCN_DVCNL,
  67.  
  68.     FCN_CHARACTER,            /* Not one of the following, but ... */
  69.     FCN_VERTICAL_BAR,        /* EBCDIC solid vertical bar */
  70.     FCN_CENTSIGN,            /* EBCDIC cent sign */
  71.     FCN_SPACE,            /* EBCDIC space */
  72.     FCN_DP,                /* EBCDIC dup character */
  73.     FCN_FM,                /* EBCDIC field mark */
  74.  
  75.     FCN_AID,            /* Some AID key */
  76.     FCN_ATTN,
  77.     FCN_CURSEL,            /* Cursor select function (and aid) */
  78.     FCN_TEST,            /* Test function */
  79.  
  80.     FCN_EINP,            /* erase input (dangerous) */
  81.     FCN_EEOF,
  82.     FCN_DELETE,
  83.     FCN_INSRT,
  84.     FCN_TAB,
  85.     FCN_BTAB,
  86.     FCN_NL,
  87.     FCN_HOME,
  88.     FCN_UP,
  89.     FCN_DOWN,
  90.     FCN_RIGHT,
  91.     FCN_LEFT,
  92.     FCN_LEFT2,
  93.     FCN_RIGHT2,
  94.  
  95. #if    !defined(PURE3274)
  96.     /*
  97.      * Local editing functions
  98.      */
  99.     FCN_SETTAB,            /* set a column tab */
  100.     FCN_DELTAB,
  101.     FCN_COLTAB,
  102.     FCN_COLBAK,
  103.     FCN_INDENT,            /* more margin over one col tab */
  104.     FCN_UNDENT,
  105.     FCN_SETMRG,
  106.     FCN_SETHOM,
  107.     FCN_CLRTAB,
  108.     FCN_ERASE,            /* erase last character */
  109.     FCN_WERASE,
  110.     FCN_FERASE,
  111.     FCN_WORDTAB,            /* tab to start of next word */
  112.     FCN_WORDBACKTAB,
  113.     FCN_WORDEND,            /* find next end of word */
  114.     FCN_FIELDEND,            /* find next end of field */
  115.  
  116.     /*
  117.      * APL functions
  118.      */
  119.     FCN_APLON,            /* start using apl character set */
  120.     FCN_APLOFF,
  121.     FCN_APLEND,
  122.  
  123.     FCN_PCON,
  124.     FCN_PCOFF,
  125.     FCN_INIT,            /* re-init screen */
  126.     FCN_SYNCH,            /* synch up after line/control error */
  127.     FCN_FLINP,            /* flush input buffer */
  128.     FCN_RESHOW,            /* redraw screen */
  129.     FCN_MASTER_RESET,        /* FLINP, RESET, RESHOW, + more */
  130.  
  131.     FCN_DISC,            /* suspend application */
  132.     FCN_ESCAPE,            /* enter command mode */
  133.  
  134.     FCN_ALTK,            /* Dvorak keyboard */
  135.  
  136.     FCN_XOFF,            /* suspend output to screen */
  137.     FCN_XON,            /* resume output to screen */
  138.  
  139.     FCN_LPRT            /* print screen on printer */
  140. #endif    /* !defined(PURE3274) */
  141. };
  142. /*
  143.  * The following is the structure which defines what a 3270 keystroke
  144.  * can do.
  145.  */
  146.  
  147. struct hits {
  148.     unsigned char keynumber;
  149.     struct hit {
  150.     enum ctlrfcn ctlrfcn;
  151.     unsigned char code;    /* AID value or 3270 display code */
  152.     } hit[4];    /* plain, shifted, alted, shiftalted */
  153. };
  154.  
  155. extern struct hits hits[];
  156.  
  157. /*
  158.  * Definitions of the shift state (and the left/right shift key position).
  159.  */
  160.  
  161. #define    SHIFT_RIGHT    0x20    /* Right shift key is down */
  162. #define    SHIFT_LEFT    0x10    /* Left shift key is down */
  163. #define    SHIFT_CONTROL    0x08    /* Control shift state (unused) */
  164. #define    SHIFT_ALT    0x04    /* ALT shift state */
  165. #define    SHIFT_CAPS    0x02    /* Caps lock state */
  166. #define    SHIFT_UPSHIFT    0x01    /* Upshift state */
  167.