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

Function re_putc

extern/editline/src/refresh.c:163–190  ·  view source on GitHub ↗

re_putc(): * Draw the character given */

Source from the content-addressed store, hash-verified

161 * Draw the character given
162 */
163protected void
164re_putc(EditLine *el, Int c, int shift)
165{
166 int i, w = Width(c);
167 ELRE_DEBUG(1, (__F, "printing %5x '%c'\r\n", c, c));
168
169 while (shift && (el->el_refresh.r_cursor.h + w > el->el_terminal.t_size.h))
170 re_putc(el, ' ', 1);
171
172 el->el_vdisplay[el->el_refresh.r_cursor.v]
173 [el->el_refresh.r_cursor.h] = c;
174 /* assumes !shift is only used for single-column chars */
175 i = w;
176 while (--i > 0)
177 el->el_vdisplay[el->el_refresh.r_cursor.v]
178 [el->el_refresh.r_cursor.h + i] = MB_FILL_CHAR;
179
180 if (!shift)
181 return;
182
183 el->el_refresh.r_cursor.h += w; /* advance to next place */
184 if (el->el_refresh.r_cursor.h >= el->el_terminal.t_size.h) {
185 /* assure end of line */
186 el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_terminal.t_size.h]
187 = '\0';
188 re_nextline(el);
189 }
190}
191
192
193/* re_refresh():

Callers 3

prompt_printFunction · 0.85
re_addcFunction · 0.85
re_refreshFunction · 0.85

Calls 2

WidthFunction · 0.85
re_nextlineFunction · 0.85

Tested by

no test coverage detected