Changeset 425

Show
Ignore:
Timestamp:
07/07/2005 09:18:05 AM (3 years ago)
Author:
jan
Message:

added a reset function to buffer_array

Location:
branches/lighttpd-1.3.x/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/src/buffer.c

    r366 r425  
    415415} 
    416416 
     417void buffer_array_reset(buffer_array *b) { 
     418        size_t i; 
     419         
     420        if (!b) return; 
     421         
     422        /* if they are too large, reduce them */ 
     423        for (i = 0; i < b->used; i++) { 
     424                buffer_reset(b->ptr[i]); 
     425        } 
     426         
     427        b->used = 0; 
     428} 
     429 
     430 
    417431/** 
    418432 * free the buffer_array  
     
    433447buffer *buffer_array_append_get_buffer(buffer_array *b) { 
    434448        size_t i; 
     449         
    435450        if (b->size == 0) { 
    436451                b->size = 16; 
  • branches/lighttpd-1.3.x/src/buffer.h

    r366 r425  
    3636buffer_array* buffer_array_init(void); 
    3737void buffer_array_free(buffer_array *b); 
     38void buffer_array_reset(buffer_array *b); 
    3839buffer *buffer_array_append_get_buffer(buffer_array *b); 
    3940