MCPcopy Create free account
hub / github.com/defold/defold / AddHandler

Function AddHandler

engine/dlib/src/dlib/webserver.cpp:210–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208 }
209
210 Result AddHandler(HServer server,
211 const char* prefix,
212 const HandlerParams* handler_params)
213 {
214 if (GetHandler(server, prefix))
215 {
216 return RESULT_HANDLER_ALREADY_REGISTRED;
217 }
218 if (server->m_Handlers.Full())
219 {
220 server->m_Handlers.OffsetCapacity(16);
221 }
222 HandlerData handler;
223 handler.m_Userdata = handler_params->m_Userdata;
224 handler.m_Handler = handler_params->m_Handler;
225 dmStrlCpy(handler.m_Prefix, prefix, sizeof(handler.m_Prefix));
226 server->m_Handlers.Push(handler);
227 return RESULT_OK;
228 }
229
230 Result RemoveHandler(HServer server, const char* prefix)
231 {

Callers 3

SetUpMethod · 0.85
InitMethod · 0.85
AddProfilerHandlerFunction · 0.85

Calls 5

GetHandlerFunction · 0.85
dmStrlCpyFunction · 0.85
FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by 1

SetUpMethod · 0.68