MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / FindChild

Function FindChild

src/filesystem/vfs/vfs.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38auto FindChild(Dentry* parent, const char* name) -> Dentry* {
39 if (parent == nullptr || name == nullptr) {
40 return nullptr;
41 }
42
43 Dentry* child = parent->children;
44 while (child != nullptr) {
45 if (strcmp(child->name, name) == 0) {
46 return child;
47 }
48 child = child->next_sibling;
49 }
50 return nullptr;
51}
52
53auto AddChild(Dentry* parent, Dentry* child) -> void {
54 if (parent == nullptr || child == nullptr) {

Callers 4

UnlinkFunction · 0.85
LookupFunction · 0.85
MkDirFunction · 0.85
RmDirFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected