1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-09-29 20:10:45 +00:00
falk-werner_webfuse-provider/lib/webfuse/core/jsonrpc/method.c

25 lines
582 B
C
Raw Normal View History

#include "webfuse/core/jsonrpc/method.h"
2019-03-26 22:04:53 +00:00
#include <stdlib.h>
#include <string.h>
struct wf_jsonrpc_method * wf_jsonrpc_method_create(
char const * method_name,
2020-03-01 15:55:58 +00:00
wf_jsonrpc_method_invoke_fn * invoke,
2019-03-26 22:04:53 +00:00
void * user_data)
{
2020-03-01 15:55:58 +00:00
struct wf_jsonrpc_method * method = malloc(sizeof(struct wf_jsonrpc_method));
method->next = NULL;
method->name = strdup(method_name);
method->invoke = invoke;
method->user_data = user_data;
2019-03-26 22:04:53 +00:00
return method;
}
void wf_jsonrpc_method_dispose(
2020-03-01 15:55:58 +00:00
struct wf_jsonrpc_method * method)
2019-03-26 22:04:53 +00:00
{
free(method->name);
free(method);
}