1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/wsfs/adapter/impl/jsonrpc/method.c

29 lines
612 B
C
Raw Normal View History

#include "wsfs/adapter/impl/jsonrpc/method_intern.h"
2019-02-09 02:08:02 +00:00
#include <stdlib.h>
#include <string.h>
struct jsonrpc_method * jsonrpc_method_create(
2019-02-09 02:08:02 +00:00
char const * name,
jsonrpc_method_invoke_fn * invoke,
2019-02-09 02:08:02 +00:00
void * user_data)
{
struct jsonrpc_method * method = malloc(sizeof(struct jsonrpc_method));
2019-02-09 02:08:02 +00:00
if (NULL != method)
{
method->next = NULL;
method->name = strdup(name);
method->invoke = invoke;
method->user_data = user_data;
}
return method;
}
void jsonrpc_method_dispose(
struct jsonrpc_method * method)
2019-02-09 02:08:02 +00:00
{
free(method->name);
free(method);
}