19 |
|
|
20 |
#define _GNU_SOURCE |
#define _GNU_SOURCE |
21 |
|
|
22 |
|
#include <config.h> |
23 |
|
|
24 |
#include "stream.h" |
#include "stream.h" |
25 |
|
|
26 |
#include <stdarg.h> |
#include <stdarg.h> |
61 |
} |
} |
62 |
|
|
63 |
if (new_capacity != stream->capacity) { |
if (new_capacity != stream->capacity) { |
64 |
stream->data = xrealloc(stream->data, stream->capacity); |
stream->data = xrealloc(stream->data, new_capacity); |
65 |
stream->capacity = new_capacity; |
stream->capacity = new_capacity; |
66 |
} |
} |
67 |
|
|
105 |
free(stream->data); |
free(stream->data); |
106 |
free(stream); |
free(stream); |
107 |
} |
} |
108 |
|
|
109 |
|
void Stream_reset(Stream * stream) { |
110 |
|
stream->length = 0; |
111 |
|
} |