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

Function EffectsBufferBlock_WriteBytes

src/effects/effects.c:69–90  ·  view source on GitHub ↗

write n bytes from ptr into block returns actual number of bytes written if buffer isn't large enough only a portion of the bytes will be written

Source from the content-addressed store, hash-verified

67// returns actual number of bytes written
68// if buffer isn't large enough only a portion of the bytes will be written
69static size_t EffectsBufferBlock_WriteBytes
70(
71 const unsigned char *ptr, // data to write
72 size_t n, // number of bytes to write
73 struct EffectsBufferBlock *b // block to write to
74) {
75 // validations
76 ASSERT(n > 0);
77 ASSERT(b != NULL);
78 ASSERT(ptr != NULL);
79
80 // determine number of bytes we can write
81 n = MIN(n, BLOCK_AVAILABLE_SPACE(b));
82
83 // write n bytes to buffer
84 memcpy(b->offset, ptr, n);
85
86 // update offset
87 b->offset += n;
88
89 return n;
90}
91
92// write n bytes from ptr into effects-buffer
93static void EffectsBuffer_WriteBytes

Callers 1

EffectsBuffer_WriteBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected