MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / SIArray_FromBinary

Function SIArray_FromBinary

src/datatypes/array.c:187–202  ·  view source on GitHub ↗

creates an array from its binary representation this is the reverse of SIArray_ToBinary x = SIArray_FromBinary(SIArray_ToBinary(y)); x == y

Source from the content-addressed store, hash-verified

185// x = SIArray_FromBinary(SIArray_ToBinary(y));
186// x == y
187SIValue SIArray_FromBinary
188(
189 FILE *stream // stream containing binary representation of an array
190) {
191 // read number of elements
192 uint32_t n;
193 fread_assert(&n, sizeof(uint32_t), stream);
194
195 SIValue arr = SIArray_New(n);
196
197 for(uint32_t i = 0; i < n; i++) {
198 array_append(arr.array, SIValue_FromBinary(stream));
199 }
200
201 return arr;
202}
203
204void SIArray_Free(SIValue siarray) {
205 uint arrayLen = SIArray_Length(siarray);

Callers 1

SIValue_FromBinaryFunction · 0.85

Calls 2

SIArray_NewFunction · 0.85
SIValue_FromBinaryFunction · 0.85

Tested by

no test coverage detected