Like sdsjoin, but joins an array of SDS strings. */
| 1104 | |
| 1105 | /* Like sdsjoin, but joins an array of SDS strings. */ |
| 1106 | sds sdsjoinsds(sds *argv, int argc, const char *sep, size_t seplen) { |
| 1107 | sds join = sdsempty(); |
| 1108 | int j; |
| 1109 | |
| 1110 | for (j = 0; j < argc; j++) { |
| 1111 | join = sdscatsds(join, argv[j]); |
| 1112 | if (j != argc-1) join = sdscatlen(join,sep,seplen); |
| 1113 | } |
| 1114 | return join; |
| 1115 | } |
| 1116 | |
| 1117 | /* Wrappers to the allocators used by SDS. Note that SDS will actually |
| 1118 | * just use the macros defined into sdsalloc.h in order to avoid to pay |