MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_memory_stream_init

Function hc_memory_stream_init

stream1/stream1.c:157–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157struct hc_memory_stream *hc_memory_stream_init(struct hc_memory_stream *s,
158 struct hc_malloc *malloc) {
159 s->stream = (struct hc_stream){
160 .read = memory_read,
161 .write = memory_write,
162 .deinit = memory_deinit,
163 };
164
165 hc_vector_init(&s->data, malloc, 1);
166 s->rpos = 0;
167 return s;
168}
169
170const char *hc_memory_stream_string(struct hc_memory_stream *s) {
171 if (!s->data.length || (*(s->data.end-1))) {

Callers 5

eval_testsFunction · 0.85
hc_read_idFunction · 0.85
dsl_benchmarksFunction · 0.85
stream1_testsFunction · 0.85
slog_testsFunction · 0.85

Calls 1

hc_vector_initFunction · 0.85

Tested by 3

eval_testsFunction · 0.68
stream1_testsFunction · 0.68
slog_testsFunction · 0.68