Lines Matching refs:buf
101 char *buf; in read_text_file() local
114 buf = NOFAIL(malloc(st.st_size + 1)); in read_text_file()
121 bytes_read = read(fd, buf, nbytes); in read_text_file()
129 buf[st.st_size] = '\0'; in read_text_file()
133 return buf; in read_text_file()
2139 void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf, in buf_printf() argument
2148 buf_write(buf, tmp, len); in buf_printf()
2152 void buf_write(struct buffer *buf, const char *s, int len) in buf_write() argument
2154 if (buf->size - buf->pos < len) { in buf_write()
2155 buf->size += len + SZ; in buf_write()
2156 buf->p = NOFAIL(realloc(buf->p, buf->size)); in buf_write()
2158 strncpy(buf->p + buf->pos, s, len); in buf_write()
2159 buf->pos += len; in buf_write()
2456 char *buf, *pos, *line; in read_dump() local
2458 buf = read_text_file(fname); in read_dump()
2459 if (!buf) in read_dump()
2463 pos = buf; in read_dump()
2497 free(buf); in read_dump()
2500 free(buf); in read_dump()
2506 struct buffer buf = { }; in write_dump() local
2516 buf_printf(&buf, "0x%08x\t%s\t%s\t%s\t%s\n", in write_dump()
2525 write_buf(&buf, fname); in write_dump()
2526 free(buf.p); in write_dump()
2560 struct buffer buf = { }; in main() local
2642 buf.pos = 0; in main()
2647 add_header(&buf, mod); in main()
2648 add_intree_flag(&buf, !external_module); in main()
2649 add_retpoline(&buf); in main()
2650 add_staging_flag(&buf, mod->name); in main()
2651 add_versions(&buf, mod); in main()
2652 add_depends(&buf, mod); in main()
2653 add_moddevtable(&buf, mod); in main()
2654 add_srcversion(&buf, mod); in main()
2655 add_scmversion(&buf); in main()
2658 write_if_changed(&buf, fname); in main()
2680 free(buf.p); in main()