MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / re_addc

Function re_addc

extern/editline/src/refresh.c:127–157  ·  view source on GitHub ↗

re_addc(): * Draw c, expanding tabs, control chars etc. */

Source from the content-addressed store, hash-verified

125 * Draw c, expanding tabs, control chars etc.
126 */
127private void
128re_addc(EditLine *el, Int c)
129{
130 switch (ct_chr_class((Char)c)) {
131 case CHTYPE_TAB: /* expand the tab */
132 for (;;) {
133 re_putc(el, ' ', 1);
134 if ((el->el_refresh.r_cursor.h & 07) == 0)
135 break; /* go until tab stop */
136 }
137 break;
138 case CHTYPE_NL: {
139 int oldv = el->el_refresh.r_cursor.v;
140 re_putc(el, '\0', 0); /* assure end of line */
141 if (oldv == el->el_refresh.r_cursor.v) /* XXX */
142 re_nextline(el);
143 break;
144 }
145 case CHTYPE_PRINT:
146 re_putc(el, c, 1);
147 break;
148 default: {
149 Char visbuf[VISUAL_WIDTH_MAX];
150 ssize_t i, n =
151 ct_visual_char(visbuf, VISUAL_WIDTH_MAX, (Char)c);
152 for (i = 0; n-- > 0; ++i)
153 re_putc(el, visbuf[i], 1);
154 break;
155 }
156 }
157}
158
159
160/* re_putc():

Callers 1

re_refreshFunction · 0.85

Calls 4

ct_chr_classFunction · 0.85
re_putcFunction · 0.85
re_nextlineFunction · 0.85
ct_visual_charFunction · 0.85

Tested by

no test coverage detected