MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / ReadDir

Method ReadDir

Kernel/src/device.cpp:76–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 int ReadDir(DirectoryEntry* dirPtr, uint32_t index) final {
77 if(index >= devices.get_length() + 2){
78 return 0;
79 }
80
81 if(index == 0){
82 strcpy(dirPtr->name, ".");
83 dirPtr->flags = FS_NODE_DIRECTORY;
84
85 return 1;
86 } else if(index == 1){
87 strcpy(dirPtr->name, "..");
88 dirPtr->flags = FS_NODE_DIRECTORY;
89
90 return 1;
91 } else {
92 strcpy(dirPtr->name, devices[index - 2]->GetName());
93
94 return 1;
95 }
96 }
97
98 FsNode* FindDir(char* name) final {
99 if(!strcmp(name, ".")){

Callers

nothing calls this directly

Calls 3

strcpyFunction · 0.85
get_lengthMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected