Lines Matching refs:linebuf

34 } linebuf;
131 linebuf.buf = (char *) ecalloc(LINEBUF_SIZE, sizeof(char));
132 linebuf.attr = (int *) ecalloc(LINEBUF_SIZE, sizeof(int));
149 char *new_buf = (char *) realloc(linebuf.buf, new_size);
150 int *new_attr = (int *) realloc(linebuf.attr, new_size*sizeof(int));
167 memcpy(new_buf, linebuf.buf, size_linebuf * sizeof(char));
168 memcpy(new_attr, linebuf.attr, size_linebuf * sizeof(int));
169 free(linebuf.attr);
170 free(linebuf.buf);
172 linebuf.buf = new_buf;
173 linebuf.attr = new_attr;
197 right_curr = linebuf.end;
208 linebuf.print = 6; /* big enough for longest UTF-8 sequence */
209 linebuf.pfx_end = 0;
210 for (linebuf.end = 0; linebuf.end < linebuf.print; linebuf.end++)
212 linebuf.buf[linebuf.end] = '\0';
213 linebuf.attr[linebuf.end] = 0;
237 linebuf.buf[n] = ch;
238 linebuf.attr[n] = attr;
250 set_linebuf(linebuf.end++, ch, attr);
263 linebuf.pfx[n] = ch;
264 linebuf.pfx_attr[n] = attr;
275 set_pfx(linebuf.pfx_end++, ch, attr);
295 * {{ Since forw_raw_line modifies linebuf, we must
296 * do this first, before storing anything in linebuf. }}
318 while (linebuf.pfx_end < status_col_width)
339 end_column = linebuf.pfx_end;
385 for (i = linebuf.print; i < linebuf.end; i++)
386 if (linebuf.attr[i] == AT_ANSI)
387 add_ansi(linebuf.buf[i]);
388 linebuf.end = linebuf.print;
389 end_column = linebuf.pfx_end;
502 if (linebuf.end > 0 && !is_at_equiv(linebuf.attr[linebuf.end-1], a))
503 w += attr_ewidth(linebuf.attr[linebuf.end-1]);
505 (linebuf.end == 0 || !is_at_equiv(linebuf.attr[linebuf.end-1], a)))
519 if (linebuf.end == 0)
521 p = &linebuf.buf[linebuf.end];
522 ch = step_char(&p, -1, linebuf.buf);
524 while (p > linebuf.buf)
528 linebuf.end = (int) (p - linebuf.buf);
529 prev_ch = step_char(&p, -1, linebuf.buf);
530 width = pwidth(ch, linebuf.attr[linebuf.end], prev_ch, linebuf.attr[linebuf.end-1]);
699 char *p = &linebuf.buf[linebuf.end];
700 LWCHAR prev_ch = (linebuf.end > 0) ? step_char(&p, -1, linebuf.buf) : 0;
701 int prev_a = (linebuf.end > 0) ? linebuf.attr[linebuf.end-1] : 0;
720 if (linebuf.end + replen >= size_linebuf-6)
747 if (linebuf.end > linebuf.print)
750 memcpy(&linebuf.buf[0], &linebuf.buf[replen], linebuf.print);
751 memcpy(&linebuf.attr[0], &linebuf.attr[replen], linebuf.print);
752 linebuf.end -= replen;
781 int to_tab = end_column - linebuf.pfx_end;
966 char *start = (cshift < hshift) ? shifted_ansi.buf : linebuf.buf;
967 int *end = (cshift < hshift) ? &shifted_ansi.end : &linebuf.end;
989 if (linebuf.end > 0 &&
990 ((linebuf.end <= linebuf.print && linebuf.buf[linebuf.end-1] == '\0') ||
991 (linebuf.end > 0 && linebuf.attr[linebuf.end - 1] & (AT_ANSI|AT_BINARY))))
1031 prev_ch = get_wchar(&linebuf.buf[linebuf.end]);
1034 prev_ch = (unsigned char) linebuf.buf[linebuf.end];
1036 a = linebuf.attr[linebuf.end];
1060 rep = &linebuf.buf[linebuf.end];
1069 || is_combining_char(get_wchar(&linebuf.buf[linebuf.end]), ch))
1168 linebuf.end = right_curr;
1223 set_linebuf(linebuf.end, '\0', AT_NORMAL);
1267 if (i < linebuf.pfx_end)
1269 *ap = linebuf.pfx_attr[i];
1270 return linebuf.pfx[i];
1272 i += linebuf.print - linebuf.pfx_end;
1273 *ap = linebuf.attr[i];
1274 return (linebuf.buf[i] & 0xFF);
1326 linebuf.buf[n++] = c;
1329 linebuf.buf[n] = '\0';
1331 *linep = linebuf.buf;
1356 linebuf.buf[--n] = '\0';
1394 * Shift the data to the end of the new linebuf.
1396 for (fm = linebuf.buf + old_size_linebuf - 1,
1397 to = linebuf.buf + size_linebuf - 1;
1398 fm >= linebuf.buf; fm--, to--)
1402 linebuf.buf[--n] = c;
1405 *linep = &linebuf.buf[n];