Lines Matching refs:a_buf

97     struct abbr_buf a_buf;  member
101 static void add_line_to_abbr_buf(struct abbr_buf *a_buf, char *linebuf, int linelen);
175 add_line_to_abbr_buf(&log_info->a_buf, line, len); in log_line()
216 static void init_abbr_buf(struct abbr_buf *a_buf) { in init_abbr_buf() argument
219 memset(a_buf, 0, sizeof(struct abbr_buf)); in init_abbr_buf()
222 a_buf->b_buf.buf = new_buf; in init_abbr_buf()
223 a_buf->b_buf.alloc_len = BEGINNING_BUF_SIZE; in init_abbr_buf()
224 a_buf->b_buf.buf_size = BEGINNING_BUF_SIZE - 1; in init_abbr_buf()
228 a_buf->e_buf.buf = new_buf; in init_abbr_buf()
229 a_buf->e_buf.alloc_len = ENDING_BUF_SIZE; in init_abbr_buf()
230 a_buf->e_buf.buf_size = ENDING_BUF_SIZE - 1; in init_abbr_buf()
234 static void free_abbr_buf(struct abbr_buf *a_buf) { in free_abbr_buf() argument
235 free(a_buf->b_buf.buf); in free_abbr_buf()
236 free(a_buf->e_buf.buf); in free_abbr_buf()
239 static void add_line_to_abbr_buf(struct abbr_buf *a_buf, char *linebuf, int linelen) { in add_line_to_abbr_buf() argument
240 if (!a_buf->beginning_buf_full) { in add_line_to_abbr_buf()
241 a_buf->beginning_buf_full = in add_line_to_abbr_buf()
242 add_line_to_linear_buf(&a_buf->b_buf, linebuf, linelen); in add_line_to_abbr_buf()
244 if (a_buf->beginning_buf_full) { in add_line_to_abbr_buf()
245 add_line_to_circular_buf(&a_buf->e_buf, linebuf, linelen); in add_line_to_abbr_buf()
250 struct abbr_buf *a_buf = &log_info->a_buf; in print_abbr_buf() local
253 if (a_buf->b_buf.alloc_len) { in print_abbr_buf()
254 print_buf_lines(log_info, a_buf->b_buf.buf, a_buf->b_buf.used_len); in print_abbr_buf()
260 if (a_buf->e_buf.used_len == a_buf->e_buf.buf_size) { in print_abbr_buf()
264 if (a_buf->e_buf.used_len == 0) { in print_abbr_buf()
271 if (a_buf->e_buf.read < a_buf->e_buf.write) { in print_abbr_buf()
273 print_buf_lines(log_info, a_buf->e_buf.buf + a_buf->e_buf.read, in print_abbr_buf()
274 a_buf->e_buf.used_len); in print_abbr_buf()
280 char * nbuf = malloc(a_buf->e_buf.alloc_len); in print_abbr_buf()
284 int first_chunk_len = a_buf->e_buf.buf_size - a_buf->e_buf.read; in print_abbr_buf()
285 memcpy(nbuf, a_buf->e_buf.buf + a_buf->e_buf.read, first_chunk_len); in print_abbr_buf()
287 memcpy(nbuf + first_chunk_len, a_buf->e_buf.buf, a_buf->e_buf.write); in print_abbr_buf()
288 print_buf_lines(log_info, nbuf, first_chunk_len + a_buf->e_buf.write); in print_abbr_buf()
324 init_abbr_buf(&log_info.a_buf); in parent()
467 free_abbr_buf(&log_info.a_buf); in parent()