| 36 | } |
| 37 | |
| 38 | auto 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 | |
| 53 | auto AddChild(Dentry* parent, Dentry* child) -> void { |
| 54 | if (parent == nullptr || child == nullptr) { |