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

Function SIValue_StringJoinLen

src/value.c:411–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411size_t SIValue_StringJoinLen(SIValue *strings, unsigned int string_count, const char *delimiter) {
412 size_t length = 0;
413 size_t elem_len;
414 size_t delimiter_len = strlen(delimiter);
415 /* Compute length. */
416 for(int i = 0; i < string_count; i ++) {
417 /* String elements representing bytes size strings,
418 * for all other SIValue types 64 bytes should be enough. */
419 elem_len = (strings[i].type == T_STRING) ? strlen(strings[i].stringval) + delimiter_len : 64;
420 length += elem_len;
421 }
422
423 /* Account for NULL terminating byte. */
424 length++;
425 return length;
426}
427
428void SIValue_StringJoin(SIValue *strings, unsigned int string_count, const char *delimiter,
429 char **buf, size_t *buf_len, size_t *bytesWritten) {

Callers 2

AR_TOSTRINGFunction · 0.85
Record_ToStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected