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

Method CreateInterface

Kernel/src/objects/service.cpp:67–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67long Service::CreateInterface(FancyRefPtr<MessageInterface>& rInterface, const char* name, uint16_t msgSize){
68 if(strchr(name, '/')){
69 Log::Warning("Service::CreateInterface: Invalid name \"%s\", cannot contain '/'");
70 return -EINVAL;
71 }
72
73 for(auto& i : interfaces){
74 if(strcmp(name, i->name) == 0){
75 return -EEXIST;
76 }
77 }
78
79 rInterface = FancyRefPtr<MessageInterface>(new MessageInterface(name, msgSize));
80
81 interfaces.add_back(rInterface);
82
83 return 0;
84}
85
86long Service::ResolveInterface(FancyRefPtr<MessageInterface>& interface, const char* name){
87 for(auto& _if : interfaces){

Callers 1

SysCreateInterfaceFunction · 0.80

Calls 4

strchrFunction · 0.85
WarningFunction · 0.85
strcmpFunction · 0.85
add_backMethod · 0.45

Tested by

no test coverage detected