Lines Matching refs:a_buf

100     struct abbr_buf a_buf;  member
104 static void add_line_to_abbr_buf(struct abbr_buf* a_buf, char* linebuf, int linelen);
174 add_line_to_abbr_buf(&log_info->a_buf, line, len); in log_line()
214 static void init_abbr_buf(struct abbr_buf* a_buf) { in init_abbr_buf() argument
217 memset(a_buf, 0, sizeof(struct abbr_buf)); in init_abbr_buf()
220 a_buf->b_buf.buf = new_buf; in init_abbr_buf()
221 a_buf->b_buf.alloc_len = BEGINNING_BUF_SIZE; in init_abbr_buf()
222 a_buf->b_buf.buf_size = BEGINNING_BUF_SIZE - 1; in init_abbr_buf()
226 a_buf->e_buf.buf = new_buf; in init_abbr_buf()
227 a_buf->e_buf.alloc_len = ENDING_BUF_SIZE; in init_abbr_buf()
228 a_buf->e_buf.buf_size = ENDING_BUF_SIZE - 1; in init_abbr_buf()
232 static void free_abbr_buf(struct abbr_buf* a_buf) { in free_abbr_buf() argument
233 free(a_buf->b_buf.buf); in free_abbr_buf()
234 free(a_buf->e_buf.buf); in free_abbr_buf()
237 static void add_line_to_abbr_buf(struct abbr_buf* a_buf, char* linebuf, int linelen) { in add_line_to_abbr_buf() argument
238 if (!a_buf->beginning_buf_full) { in add_line_to_abbr_buf()
239 a_buf->beginning_buf_full = add_line_to_linear_buf(&a_buf->b_buf, linebuf, linelen); in add_line_to_abbr_buf()
241 if (a_buf->beginning_buf_full) { in add_line_to_abbr_buf()
242 add_line_to_circular_buf(&a_buf->e_buf, linebuf, linelen); in add_line_to_abbr_buf()
247 struct abbr_buf* a_buf = &log_info->a_buf; in print_abbr_buf() local
250 if (a_buf->b_buf.alloc_len) { in print_abbr_buf()
251 print_buf_lines(log_info, a_buf->b_buf.buf, a_buf->b_buf.used_len); in print_abbr_buf()
257 if (a_buf->e_buf.used_len == a_buf->e_buf.buf_size) { in print_abbr_buf()
261 if (a_buf->e_buf.used_len == 0) { in print_abbr_buf()
268 if (a_buf->e_buf.read < a_buf->e_buf.write) { in print_abbr_buf()
270 print_buf_lines(log_info, a_buf->e_buf.buf + a_buf->e_buf.read, a_buf->e_buf.used_len); in print_abbr_buf()
276 char* nbuf = static_cast<char*>(malloc(a_buf->e_buf.alloc_len)); in print_abbr_buf()
280 int first_chunk_len = a_buf->e_buf.buf_size - a_buf->e_buf.read; in print_abbr_buf()
281 memcpy(nbuf, a_buf->e_buf.buf + a_buf->e_buf.read, first_chunk_len); in print_abbr_buf()
283 memcpy(nbuf + first_chunk_len, a_buf->e_buf.buf, a_buf->e_buf.write); in print_abbr_buf()
284 print_buf_lines(log_info, nbuf, first_chunk_len + a_buf->e_buf.write); in print_abbr_buf()
363 init_abbr_buf(&log_info.a_buf); in parent()
517 free_abbr_buf(&log_info.a_buf); in parent()