util  Diff

Differences From Artifact [a88ca60244]:

To Artifact [0f8552f2fb]:


    32     32   			b->ptr = malloc(b->run);
    33     33   		} else {
    34     34   			b->ptr = realloc(b->ptr, b->run);
    35     35   		}
    36     36   	}
    37     37   	return (strp){b->sz, b->ptr};
    38     38   }
           39  +
           40  +strp buffer_str(buffer* b) {
           41  +	return (strp){b->sz, b->ptr};
           42  +}
    39     43   
    40     44   size_t buffer_pushs(buffer* b, char const* data) {
    41     45   	size_t len = strlen(data);
    42     46   	buffer_push(b, (strp){len, .cptr = data});
    43     47   	return len;
    44     48   }
    45     49   
    46     50   void buffer_clear(buffer* b) {
    47     51   	b -> sz = 0;
           52  +}
           53  +void buffer_del(buffer* b) {
           54  +	b -> sz = 0;
           55  +	b -> run = 0;
           56  +	free(b -> ptr);
    48     57   }