MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / FileSystem_open

Function FileSystem_open

Tools/ToolsBootstrap.c:595–612  ·  view source on GitHub ↗

FileSystem functions

Source from the content-addressed store, hash-verified

593 // For StringBuilder, join is not typical, but perhaps split by sep and join
594 // Actually, looking at usage, it might not be needed, but implement as simple copy
595 char* result = (char*)malloc(sb->length + 1);
596 if (result) {
597 memcpy(result, sb->buffer, sb->length + 1);
598 }
599 return result;
600}
601
602char* String_duplicate(const char* str) {
603 if (!str) return NULL;
604 char* result = (char*)malloc(strlen(str) + 1);
605 if (result) strcpy(result, str);
606 return result;
607}
608
609char* String_concat3(const char* a, const char* b, const char* c) {
610 size_t lenA = strlen(a);
611 size_t lenB = strlen(b);
612 size_t lenC = strlen(c);
613 char* result = (char*)malloc(lenA + lenB + lenC + 1);
614 if (!result) return NULL;
615 memcpy(result, a, lenA);

Callers 1

parseDependenciesFunction · 0.85

Calls 1

Tested by

no test coverage detected