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

Function EffectsBuffer_WriteBytes

src/effects/effects.c:93–118  ·  view source on GitHub ↗

write n bytes from ptr into effects-buffer

Source from the content-addressed store, hash-verified

91
92// write n bytes from ptr into effects-buffer
93static void EffectsBuffer_WriteBytes
94(
95 const void *ptr, // data to write
96 size_t n, // number of bytes to write
97 EffectsBuffer *eb // effects-buffer
98) {
99 ASSERT(n > 0);
100 ASSERT(eb != NULL);
101 ASSERT(ptr != NULL);
102
103 while(n > 0) {
104 struct EffectsBufferBlock *b = eb->current;
105 size_t written = EffectsBufferBlock_WriteBytes(ptr, n, b);
106
107 // advance ptr
108 ptr += written;
109
110 if(written == 0) {
111 // no bytes written block is full, create a new block
112 EffectsBuffer_AddBlock(eb);
113 }
114
115 // update remaining bytes to write
116 n -= written;
117 }
118}
119
120static void EffectsBuffer_WriteString
121(

Calls 2

EffectsBuffer_AddBlockFunction · 0.85

Tested by

no test coverage detected