2019-02-25 19:17:13 +00:00
|
|
|
#include "wsfs/adapter/jsonrpc/method_intern.h"
|
2019-02-09 02:08:02 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
struct wsfs_jsonrpc_method * wsfs_jsonrpc_method_create(
|
|
|
|
char const * name,
|
|
|
|
wsfs_jsonrpc_method_invoke_fn * invoke,
|
|
|
|
void * user_data)
|
|
|
|
{
|
|
|
|
struct wsfs_jsonrpc_method * method = malloc(sizeof(struct wsfs_jsonrpc_method));
|
|
|
|
if (NULL != method)
|
|
|
|
{
|
|
|
|
method->next = NULL;
|
|
|
|
method->name = strdup(name);
|
|
|
|
method->invoke = invoke;
|
|
|
|
method->user_data = user_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
return method;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wsfs_jsonrpc_method_dispose(
|
|
|
|
struct wsfs_jsonrpc_method * method)
|
|
|
|
{
|
|
|
|
free(method->name);
|
|
|
|
free(method);
|
|
|
|
}
|