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
682 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>
2019-03-24 17:02:28 +00:00
struct wsfs_impl_jsonrpc_method * wsfs_impl_jsonrpc_method_create(
2019-02-09 02:08:02 +00:00
char const * name,
2019-03-24 17:02:28 +00:00
wsfs_impl_jsonrpc_method_invoke_fn * invoke,
2019-02-09 02:08:02 +00:00
void * user_data)
{
2019-03-24 17:02:28 +00:00
struct wsfs_impl_jsonrpc_method * method = malloc(sizeof(struct wsfs_impl_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;
}
2019-03-24 17:02:28 +00:00
void wsfs_impl_jsonrpc_method_dispose(
struct wsfs_impl_jsonrpc_method * method)
2019-02-09 02:08:02 +00:00
{
free(method->name);
free(method);
}