1: /* Cursor motion calculation definitions for GNU Emacs
   2:    Copyright (C) 1985 Richard M. Stallman.
   3: 
   4: This file is part of GNU Emacs.
   5: 
   6: GNU Emacs is distributed in the hope that it will be useful,
   7: but WITHOUT ANY WARRANTY.  No author or distributor
   8: accepts responsibility to anyone for the consequences of using it
   9: or for whether it serves any particular purpose or works at all,
  10: unless he says so in writing.  Refer to the GNU Emacs General Public
  11: License for full details.
  12: 
  13: Everyone is granted permission to copy, modify and redistribute
  14: GNU Emacs, but only under the conditions described in the
  15: GNU Emacs General Public License.   A copy of this license is
  16: supposed to have been given to you along with GNU Emacs so you
  17: can know your rights and responsibilities.  It should be in a
  18: file named COPYING.  Among other things, the copyright notice
  19: and this notice must be preserved on all copies.  */
  20: 
  21: 
  22: /* This structure holds everything needed to do cursor motion except the pad
  23:    character (PC) and the output speed of the terminal (ospeed), which
  24:    termcap wants in global variables. */
  25: 
  26: extern struct cm {
  27:     /* Cursor position */
  28:     int cm_curY,    /* current row */
  29:         cm_curX;    /* current column */
  30:                 /* -1 in either one means position unknown */
  31:     /* Capabilities from termcap(5) (including extensions) */
  32:     char    *cm_up,     /* up (up) */
  33:         *cm_down,   /* down (do) */
  34:         *cm_left,   /* left (bs) */
  35:         *cm_right,  /* right (nd) */
  36:         *cm_home,   /* home (ho) */
  37:         *cm_cr,     /* carriage return (cr) */
  38:         *cm_ll,     /* last line (ll) */
  39:         *cm_abs,    /* absolute (cm) */
  40:         *cm_habs,   /* horizontal absolute (ch) */
  41:         *cm_vabs,   /* vertical absolute (cv) */
  42:         *cm_ds,     /* "don't send" string (ds) */
  43:         *cm_tab;    /* tab (ta) */
  44:     int cm_tabwidth,    /* tab width (tw) */
  45:         cm_cols,    /* Number of cols on screen (co) */
  46:         cm_rows,    /* Number of rows on screen (li) */
  47:         cm_autowrap:1,  /* autowrap flag (am) */
  48:         cm_magicwrap:1, /* vt100s: cursor stays in last col but
  49: 				   will wrap if next char is printing (xn) */
  50:         cm_usetabs:1,   /* if set, use tabs */
  51:         cm_autolf:1,    /* \r performs a \r\n (rn) */
  52:         cm_losewrap:1;  /* if reach right margin, forget cursor location */
  53:     /* Costs */
  54:     int cc_up,      /* cost for up */
  55:         cc_down,    /* etc */
  56:         cc_left,
  57:         cc_right,
  58:         cc_home,
  59:         cc_cr,
  60:         cc_ll,
  61:         cc_abs,     /* abs costs are actually min costs */
  62:         cc_habs,
  63:         cc_vabs,
  64:         cc_tab;
  65: } Wcm;
  66: 
  67: extern char PC;         /* Pad character */
  68: extern short ospeed;        /* Output speed (from sg_ospeed) */
  69: 
  70: /* Shorthand */
  71: #ifndef NoCMShortHand
  72: #define curY        Wcm.cm_curY
  73: #define curX        Wcm.cm_curX
  74: #define Up      Wcm.cm_up
  75: #define Down        Wcm.cm_down
  76: #define Left        Wcm.cm_left
  77: #define Right       Wcm.cm_right
  78: #define Home        Wcm.cm_home
  79: #define CR      Wcm.cm_cr
  80: #define LastLine    Wcm.cm_ll
  81: #define Tab     Wcm.cm_tab
  82: #define TabWidth    Wcm.cm_tabwidth
  83: #define DontSend    Wcm.cm_ds
  84: #define AbsPosition Wcm.cm_abs
  85: #define ColPosition Wcm.cm_habs
  86: #define RowPosition Wcm.cm_vabs
  87: #define AutoWrap    Wcm.cm_autowrap
  88: #define MagicWrap   Wcm.cm_magicwrap
  89: #define UseTabs     Wcm.cm_usetabs
  90: #define AutoLF      Wcm.cm_autolf
  91: #define ScreenRows  Wcm.cm_rows
  92: #define ScreenCols  Wcm.cm_cols
  93: 
  94: #define cmat(row,col)   (curY = (row), curX = (col))
  95: #define cmplus(n)   {if ((curX += (n)) >= ScreenCols && !MagicWrap)\
  96:                {if (Wcm.cm_losewrap) curY = -1; \
  97:                   else if (AutoWrap) curX = 0, curY++; else curX--;}}
  98: 
  99: extern void cmputc ();
 100: 
 101: #endif

Defined struct's

cm defined in line 26; used 2 times

Defined macros

AbsPosition defined in line 84; used 1 times
AutoLF defined in line 90; never used
AutoWrap defined in line 87; used 3 times
CR defined in line 79; used 2 times
ColPosition defined in line 85; used 1 times
DontSend defined in line 83; never used
Down defined in line 75; used 5 times
Home defined in line 78; used 1 times
LastLine defined in line 80; used 1 times
Left defined in line 76; used 5 times
MagicWrap defined in line 88; used 2 times
Right defined in line 77; used 1 times
RowPosition defined in line 86; used 1 times
ScreenCols defined in line 92; used 2 times
ScreenRows defined in line 91; used 1 times
Tab defined in line 81; used 4 times
TabWidth defined in line 82; used 4 times
Up defined in line 74; used 1 times
UseTabs defined in line 89; used 1 times
cmat defined in line 94; used 1 times
cmplus defined in line 95; used 4 times
curX defined in line 73; used 30 times
curY defined in line 72; used 46 times

Usage of this include

Last modified: 1985-11-23
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1064
Valid CSS Valid XHTML 1.0 Strict