2019-04-01 20:15:12 +00:00
|
|
|
#include "webfuse/adapter/impl/jsonrpc/method.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
struct wf_impl_jsonrpc_method * wf_impl_jsonrpc_method_create(
|
2019-04-01 20:15:12 +00:00
|
|
|
char const * method_name,
|
2019-03-26 22:04:53 +00:00
|
|
|
wf_impl_jsonrpc_method_invoke_fn * invoke,
|
|
|
|
void * user_data)
|
|
|
|
{
|
|
|
|
struct wf_impl_jsonrpc_method * method = malloc(sizeof(struct wf_impl_jsonrpc_method));
|
|
|
|
if (NULL != method)
|
|
|
|
{
|
|
|
|
method->next = NULL;
|
2019-04-01 20:15:12 +00:00
|
|
|
method->name = strdup(method_name);
|
2019-03-26 22:04:53 +00:00
|
|
|
method->invoke = invoke;
|
|
|
|
method->user_data = user_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
return method;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wf_impl_jsonrpc_method_dispose(
|
|
|
|
struct wf_impl_jsonrpc_method * method)
|
|
|
|
{
|
|
|
|
free(method->name);
|
|
|
|
free(method);
|
|
|
|
}
|