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

Method ResolveServiceName

Kernel/src/objects/service.cpp:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13long ServiceFS::ResolveServiceName(FancyRefPtr<Service>& ref, const char* name){
14 const char* separator = strchr(name, '/');
15
16 if(separator){
17 for(auto& svc : services){
18 if(strncmp(svc->GetName(), name, separator - name) == 0){
19 ref = svc;
20 return 0;
21 }
22 }
23 } else {
24 for(auto& svc : services){
25 if(strcmp(svc->GetName(), name) == 0){
26 ref = svc;
27 return 0;
28 }
29 }
30 }
31
32 //Log::Warning("Service %s not found!", name);
33 return 1;
34}
35
36FancyRefPtr<Service> ServiceFS::CreateService(const char* name){
37 auto svc = FancyRefPtr<Service>(new Service(name));

Callers 1

SysInterfaceConnectFunction · 0.80

Calls 4

strchrFunction · 0.85
strncmpFunction · 0.85
strcmpFunction · 0.85
GetNameMethod · 0.45

Tested by

no test coverage detected