Lines Matching refs:b
517 char *b; member
525 struct buffer *b = MALLOC(1, struct buffer); in init_buffer() local
526 b->b = MALLOC(MIN_ALLOCATE, char); in init_buffer()
527 b->allocated = MIN_ALLOCATE; in init_buffer()
528 b->length = 0; in init_buffer()
529 return b; in init_buffer()
533 get_buffer(b) in get_buffer() argument
534 struct buffer *b; in get_buffer()
536 return b->b;
540 size_buffer(b) in size_buffer() argument
541 struct buffer *b; in size_buffer()
543 return b->length;
546 static void resize_buffer P_((struct buffer *b, size_t newlen));
548 resize_buffer(b, newlen) in resize_buffer() argument
549 struct buffer *b; in resize_buffer()
553 size_t alen = b->allocated;
559 try = realloc(b->b, alen); /* Note: *not* the REALLOC() macro! */
563 try = REALLOC(b->b, alen, char);
565 b->allocated = alen;
566 b->b = try;
570 add_buffer(b, p, n) in add_buffer() argument
571 struct buffer *b; in add_buffer()
576 if (b->allocated - b->length < n)
577 resize_buffer(b, b->length+n);
578 result = memcpy(b->b + b->length, p, n);
579 b->length += n;
584 add1_buffer(b, c) in add1_buffer() argument
585 struct buffer *b; in add1_buffer()
597 if (b->allocated - b->length < 1)
598 resize_buffer(b, b->length+1);
599 result = b->b + b->length++;
608 free_buffer(b) in free_buffer() argument
609 struct buffer *b; in free_buffer()
611 if (b)
612 FREE(b->b);
613 FREE(b);