annotate src/cm.h @ 25440:0a1099580297

[emacs]: Handle character classes for multibyte chars: (ISBLANK, ISGRAPH, ISPRINT, ISALNUM, ISALPHA, ISLOWER) (ISPUNCT, ISSPACE, ISUPPER): New definitions for emacs only. (ISWORD): New macro. (re_opcode_t): Add 2 bytes of flag bits to charset and charset_not. (CHARSET_RANGE_TABLE): Update definition. (CHARSET_RANGE_TABLE_BITS): New macro. (print_partial_compiled_pattern): Skip charset's range table. (struct range_table_work_area): New field `bits'. (SET_RANGE_TABLE_WORK_AREA_BIT): New macro. (BIT_ALNUM, BIT_ALPHA, BIT_WORD, BIT_GRAPH, BIT_LOWER, BIT_PRINT) (BIT_PUNCT, BIT_SPACE, BIT_UPPER): New macros. (CLEAR_RANGE_TABLE_WORK_USED): Clear field `bits'. (RANGE_TABLE_WORK_BITS): New macro. (IS_CHAR_CLASS): Check for "word". (regex_compile): Set the `bits' field for some character classes. Handle the `word' class. Store the `bits' field into the range table. (re_compile_fastmap): Handle flag bits in range table. (re_match_2_internal): For charset and charset_not, handle flag bits in the range table.
author Richard M. Stallman <rms@gnu.org>
date Sun, 29 Aug 1999 20:38:11 +0000
parents 73d30d93f2b6
children 3a33e6b4847d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Cursor motion calculation definitions for GNU Emacs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 Copyright (C) 1985, 1989 Free Software Foundation, Inc.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
12244
ac7375e60931 Update GPL to version 2.
Karl Heuer <kwzh@gnu.org>
parents: 10438
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 12244
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 12244
diff changeset
19 Boston, MA 02111-1307, USA. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 /* Holds the minimum and maximum costs for the parametrized capabilities. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 struct parmcap
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 {
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 int mincost, maxcost;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 };
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 /* This structure holds everything needed to do cursor motion except the pad
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 character (PC) and the output speed of the terminal (ospeed), which
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 termcap wants in global variables. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 struct cm
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 {
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 /* Cursor position. -1 in *both* variables means the cursor
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 position is unknown, in order to force absolute cursor motion. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 int cm_curY; /* Current row */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 int cm_curX; /* Current column */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 /* Capabilities from termcap */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 char *cm_up; /* up (up) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 char *cm_down; /* down (do) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 char *cm_left; /* left (le) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 char *cm_right; /* right (nd) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 char *cm_home; /* home (ho) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 char *cm_cr; /* carriage return (cr) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 char *cm_ll; /* last line (ll) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 char *cm_tab; /* tab (ta) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 char *cm_backtab; /* backtab (bt) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 char *cm_abs; /* absolute (cm) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 char *cm_habs; /* horizontal absolute (ch) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 char *cm_vabs; /* vertical absolute (cv) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 #if 0
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 char *cm_ds; /* "don't send" string (ds) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 #endif
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 char *cm_multiup; /* multiple up (UP) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 char *cm_multidown; /* multiple down (DO) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 char *cm_multileft; /* multiple left (LE) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 char *cm_multiright; /* multiple right (RI) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 int cm_cols; /* number of cols on screen (co) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 int cm_rows; /* number of rows on screen (li) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 int cm_tabwidth; /* tab width (it) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 unsigned int cm_autowrap:1; /* autowrap flag (am) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 unsigned int cm_magicwrap:1; /* VT-100: cursor stays in last col but
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 will cm_wrap if next char is
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 printing (xn) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 unsigned int cm_usetabs:1; /* if set, use tabs */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 unsigned int cm_losewrap:1; /* if reach right margin, forget cursor
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 location */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 /* Parametrized capabilities. This needs to be a struct since
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 the costs are accessed through pointers. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 #if 0
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 struct parmcap cc_abs; /* absolute (cm) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 struct parmcap cc_habs; /* horizontal absolute (ch) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 struct parmcap cc_vabs; /* vertical absolute (cv) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 struct parmcap cc_multiup; /* multiple up (UP) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 struct parmcap cc_multidown; /* multiple down (DO) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 struct parmcap cc_multileft; /* multiple left (LE) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 struct parmcap cc_multiright; /* multiple right (RI) */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 #endif
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 /* Costs for the non-parametrized capabilities */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 int cc_up; /* cost for up */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 int cc_down; /* etc. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 int cc_left;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 int cc_right;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 int cc_home;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 int cc_cr;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 int cc_ll;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 int cc_tab;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 int cc_backtab;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 /* These are temporary, until the code is installed to use the
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 struct parmcap fields above. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 int cc_abs;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 int cc_habs;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 int cc_vabs;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 };
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 extern struct cm Wcm; /* Terminal capabilities */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 extern char PC; /* Pad character */
18659
b6ced5dad84b (ospeed): Declare as short unless HAVE_TERMIOS_H and LINUX.
Richard M. Stallman <rms@gnu.org>
parents: 18473
diff changeset
103
19023
f7a3c16c49cb [HAVE_LIBNCURSES]: Declare ospeed as short, unless NCURSES_OSPEED_T.
Richard M. Stallman <rms@gnu.org>
parents: 18808
diff changeset
104 #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
f7a3c16c49cb [HAVE_LIBNCURSES]: Declare ospeed as short, unless NCURSES_OSPEED_T.
Richard M. Stallman <rms@gnu.org>
parents: 18808
diff changeset
105 extern short ospeed;
f7a3c16c49cb [HAVE_LIBNCURSES]: Declare ospeed as short, unless NCURSES_OSPEED_T.
Richard M. Stallman <rms@gnu.org>
parents: 18808
diff changeset
106 #else
18808
a431fbda7f23 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18659
diff changeset
107 #if defined (HAVE_TERMIOS_H) && defined (LINUX)
16154
a9160d6d9ac7 [HAVE_TERMIOS_H]: Include termios.h.
Richard M. Stallman <rms@gnu.org>
parents: 15719
diff changeset
108 #include <termios.h>
18659
b6ced5dad84b (ospeed): Declare as short unless HAVE_TERMIOS_H and LINUX.
Richard M. Stallman <rms@gnu.org>
parents: 18473
diff changeset
109 /* HJL's version of libc is said to need this on the Alpha.
b6ced5dad84b (ospeed): Declare as short unless HAVE_TERMIOS_H and LINUX.
Richard M. Stallman <rms@gnu.org>
parents: 18473
diff changeset
110 On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */
18473
9e73857f8855 (ospeed): Always use `extern' in the declaration.
Richard M. Stallman <rms@gnu.org>
parents: 16154
diff changeset
111 extern speed_t ospeed;
16154
a9160d6d9ac7 [HAVE_TERMIOS_H]: Include termios.h.
Richard M. Stallman <rms@gnu.org>
parents: 15719
diff changeset
112 #else
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 extern short ospeed; /* Output speed (from sg_ospeed) */
16154
a9160d6d9ac7 [HAVE_TERMIOS_H]: Include termios.h.
Richard M. Stallman <rms@gnu.org>
parents: 15719
diff changeset
114 #endif
19023
f7a3c16c49cb [HAVE_LIBNCURSES]: Declare ospeed as short, unless NCURSES_OSPEED_T.
Richard M. Stallman <rms@gnu.org>
parents: 18808
diff changeset
115 #endif
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 /* Shorthand */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 #ifndef NoCMShortHand
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 #define curY Wcm.cm_curY
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 #define curX Wcm.cm_curX
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 #define Up Wcm.cm_up
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 #define Down Wcm.cm_down
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 #define Left Wcm.cm_left
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 #define Right Wcm.cm_right
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 #define Tab Wcm.cm_tab
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 #define BackTab Wcm.cm_backtab
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 #define TabWidth Wcm.cm_tabwidth
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 #define CR Wcm.cm_cr
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 #define Home Wcm.cm_home
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 #define LastLine Wcm.cm_ll
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 #define AbsPosition Wcm.cm_abs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 #define ColPosition Wcm.cm_habs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 #define RowPosition Wcm.cm_vabs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 #define MultiUp Wcm.cm_multiup
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 #define MultiDown Wcm.cm_multidown
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 #define MultiLeft Wcm.cm_multileft
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 #define MultiRight Wcm.cm_multiright
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 #define AutoWrap Wcm.cm_autowrap
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 #define MagicWrap Wcm.cm_magicwrap
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 #define UseTabs Wcm.cm_usetabs
776
a1d724d96f6b entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 486
diff changeset
141 #define FrameRows Wcm.cm_rows
a1d724d96f6b entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 486
diff changeset
142 #define FrameCols Wcm.cm_cols
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 #define UpCost Wcm.cc_up
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 #define DownCost Wcm.cc_down
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 #define LeftCost Wcm.cc_left
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 #define RightCost Wcm.cc_right
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 #define HomeCost Wcm.cc_home
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 #define CRCost Wcm.cc_cr
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 #define LastLineCost Wcm.cc_ll
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 #define TabCost Wcm.cc_tab
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 #define BackTabCost Wcm.cc_backtab
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 #define AbsPositionCost Wcm.cc_abs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 #define ColPositionCost Wcm.cc_habs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 #define RowPositionCost Wcm.cc_vabs
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 #define MultiUpCost Wcm.cc_multiup
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 #define MultiDownCost Wcm.cc_multidown
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 #define MultiLeftCost Wcm.cc_multileft
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 #define MultiRightCost Wcm.cc_multiright
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 #endif
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 #define cmat(row,col) (curY = (row), curX = (col))
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 #define cmplus(n) \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 { \
776
a1d724d96f6b entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 486
diff changeset
165 if ((curX += (n)) >= FrameCols && !MagicWrap) \
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 { \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 if (Wcm.cm_losewrap) losecursor (); \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 else if (AutoWrap) curX = 0, curY++; \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 else curX--; \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 } \
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 }
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 #define losecursor() (curX = -1, curY = -1)
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 extern int cost;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 extern int evalcost ();
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177
10438
9e090c50cead Declare checkmagic.
Karl Heuer <kwzh@gnu.org>
parents: 8986
diff changeset
178 extern void cmcheckmagic ();
8986
331db4842ffb (cmputc): Return int rather than void.
Richard M. Stallman <rms@gnu.org>
parents: 776
diff changeset
179 extern int cmputc ();
21516
73d30d93f2b6 Update return types of declarations.
Andreas Schwab <schwab@suse.de>
parents: 19023
diff changeset
180 extern void cmcostinit ();
73d30d93f2b6 Update return types of declarations.
Andreas Schwab <schwab@suse.de>
parents: 19023
diff changeset
181 extern void cmgoto ();
73d30d93f2b6 Update return types of declarations.
Andreas Schwab <schwab@suse.de>
parents: 19023
diff changeset
182 extern void Wcm_clear ();
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 extern int Wcm_init ();