You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
582 B
25 lines
582 B
5 years ago
|
#include "webfuse/core/jsonrpc/method.h"
|
||
6 years ago
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
5 years ago
|
struct wf_jsonrpc_method * wf_jsonrpc_method_create(
|
||
6 years ago
|
char const * method_name,
|
||
5 years ago
|
wf_jsonrpc_method_invoke_fn * invoke,
|
||
6 years ago
|
void * user_data)
|
||
|
{
|
||
5 years ago
|
struct wf_jsonrpc_method * method = malloc(sizeof(struct wf_jsonrpc_method));
|
||
5 years ago
|
method->next = NULL;
|
||
|
method->name = strdup(method_name);
|
||
|
method->invoke = invoke;
|
||
|
method->user_data = user_data;
|
||
6 years ago
|
|
||
|
return method;
|
||
|
}
|
||
|
|
||
5 years ago
|
void wf_jsonrpc_method_dispose(
|
||
5 years ago
|
struct wf_jsonrpc_method * method)
|
||
6 years ago
|
{
|
||
|
free(method->name);
|
||
|
free(method);
|
||
|
}
|