2
* Copyright (c) 2005-2009, Paul Mattes.
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are met:
7
* * Redistributions of source code must retain the above copyright
8
* notice, this list of conditions and the following disclaimer.
9
* * Redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution.
12
* * Neither the names of Paul Mattes nor the names of his contributors
13
* may be used to endorse or promote products derived from this software
14
* without specific prior written permission.
16
* THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS OR IMPLIED
17
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19
* EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
* Global declarations for ctlr.c.
34
PDS_OKAY_NO_OUTPUT = 0, /* command accepted, produced no output */
35
PDS_OKAY_OUTPUT = 1, /* command accepted, produced output */
36
PDS_BAD_CMD = -1, /* command rejected */
37
PDS_BAD_ADDR = -2 /* command contained a bad address */
40
void ctlr_aclear(int baddr, int count, int clear_ea);
41
void ctlr_add(int baddr, unsigned char c, unsigned char cs);
42
void ctlr_add_bg(int baddr, unsigned char color);
43
void ctlr_add_cs(int baddr, unsigned char cs);
44
void ctlr_add_fa(int baddr, unsigned char fa, unsigned char cs);
45
void ctlr_add_fg(int baddr, unsigned char color);
46
void ctlr_add_gr(int baddr, unsigned char gr);
47
void ctlr_altbuffer(Boolean alt);
48
Boolean ctlr_any_data(void);
49
void ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea);
50
void ctlr_changed(int bstart, int bend);
51
void ctlr_clear(Boolean can_snap);
52
void ctlr_erase(Boolean alt);
53
void ctlr_erase_all_unprotected(void);
54
void ctlr_init(unsigned cmask);
55
void ctlr_read_buffer(unsigned char aid_byte);
56
void ctlr_read_modified(unsigned char aid_byte, Boolean all);
57
void ctlr_reinit(unsigned cmask);
58
void ctlr_scroll(void);
59
void ctlr_shrink(void);
60
void ctlr_snap_buffer(void);
61
void ctlr_snap_buffer_sscp_lu(void);
62
Boolean ctlr_snap_modes(void);
63
void ctlr_wrapping_memmove(int baddr_to, int baddr_from, int count);
64
enum pds ctlr_write(unsigned char buf[], int buflen, Boolean erase);
65
void ctlr_write_sscp_lu(unsigned char buf[], int buflen);
66
struct ea *fa2ea(int baddr);
67
int find_field_attribute(int baddr);
68
unsigned char get_field_attribute(register int baddr);
69
Boolean get_bounded_field_attribute(register int baddr, register int bound,
70
unsigned char *fa_out);
71
void mdt_clear(int baddr);
72
void mdt_set(int baddr);
73
int next_unprotected(int baddr0);
74
enum pds process_ds(unsigned char *buf, int buflen);
75
void ps_process(void);
76
void set_rows_cols(int mn, int ovc, int ovr);
77
void ticking_start(Boolean anyway);
78
void toggle_nop(struct toggle *t, enum toggle_type tt);
79
void toggle_showTiming(struct toggle *t, enum toggle_type tt);
82
DBCS_NONE = 0, /* position is not DBCS */
83
DBCS_LEFT, /* position is left half of DBCS character */
84
DBCS_RIGHT, /* position is right half of DBCS character */
85
DBCS_SI, /* position is SI terminating DBCS subfield */
86
DBCS_SB, /* position is SBCS character after the SI */
87
DBCS_LEFT_WRAP, /* position is left half of split DBCS */
88
DBCS_RIGHT_WRAP, /* position is right half of split DBCS */
89
DBCS_DEAD /* position is dead left-half DBCS */
91
#define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP)
92
#define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP)
93
#define IS_DBCS(d) (IS_LEFT(d) || IS_RIGHT(d))
94
#define MAKE_LEFT(b) { \
95
if (((b) % COLS) == ((ROWS * COLS) - 1)) \
96
ea_buf[(b)].db = DBCS_LEFT_WRAP; \
98
ea_buf[(b)].db = DBCS_LEFT; \
100
#define MAKE_RIGHT(b) { \
102
ea_buf[(b)].db = DBCS_RIGHT_WRAP; \
104
ea_buf[(b)].db = DBCS_RIGHT; \
106
#define SOSI(c) (((c) == EBC_so)? EBC_si: EBC_so)
108
enum dbcs_why { DBCS_FIELD, DBCS_SUBFIELD, DBCS_ATTRIBUTE };
110
#if defined(X3270_DBCS) /*[*/
111
enum dbcs_state ctlr_dbcs_state(int baddr);
112
extern enum dbcs_state ctlr_lookleft_state(int baddr, enum dbcs_why *why);
113
int ctlr_dbcs_postprocess(void);
115
#define ctlr_dbcs_state(b) DBCS_NONE
116
#define ctlr_lookleft_state(b, w) DBCS_NONE
117
#define ctlr_dbcs_postprocess() 0