MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / string_append

Function string_append

StereoKitC/libraries/stref.cpp:32–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30///////////////////////////////////////////
31
32char *string_append(char *aBase, uint32_t aCount, ...) {
33 size_t baseSize = aBase == nullptr? 0 : strlen(aBase);
34
35 size_t addSize = 0;
36 va_list args;
37 va_start(args, aCount);
38 for (uint32_t i = 0; i < aCount; i++) {
39 addSize += strlen(va_arg(args, char *));
40 }
41 va_end(args);
42
43 char *result = (char*)STR_REALLOC(aBase, baseSize + addSize + 1);
44 char *curr = result + baseSize;
45 va_start(args, aCount);
46 for (uint32_t i = 0; i < aCount; i++) {
47 char *arg = va_arg(args, char *);
48 size_t len = strlen(arg);
49 memcpy(curr, arg, len + 1);
50 curr += len;
51 }
52 va_end(args);
53
54 return result;
55}
56
57///////////////////////////////////////////
58

Callers 8

platform_append_filterFunction · 0.85
platform_file_picker_szFunction · 0.85
shader_create_fileFunction · 0.85
font_update_textureFunction · 0.85
platform_push_path_newFunction · 0.85
platform_pop_path_newFunction · 0.85
platform_iterate_dirFunction · 0.85
anchor_stage_shutdownFunction · 0.85

Calls 1

strlenFunction · 0.85

Tested by

no test coverage detected