2008-05-12 00:41:55 +00:00
|
|
|
/*
|
2014-01-19 01:09:44 +00:00
|
|
|
* This file Copyright (C) 2008-2014 Mnemosyne LLC
|
2008-05-12 00:41:55 +00:00
|
|
|
*
|
2014-01-19 01:09:44 +00:00
|
|
|
* It may be used under the GNU Public License v2 or v3 licenses,
|
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2008-05-12 00:41:55 +00:00
|
|
|
*
|
2008-05-28 17:17:12 +00:00
|
|
|
* $Id$
|
2008-05-12 00:41:55 +00:00
|
|
|
*/
|
|
|
|
|
2008-05-12 23:51:17 +00:00
|
|
|
#ifndef TR_RPC_H
|
|
|
|
#define TR_RPC_H
|
2008-05-12 00:41:55 +00:00
|
|
|
|
2009-03-25 00:15:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-12-14 04:34:42 +00:00
|
|
|
#include "transmission.h"
|
|
|
|
#include "variant.h"
|
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
/***
|
|
|
|
**** RPC processing
|
|
|
|
***/
|
|
|
|
|
2010-12-20 02:07:51 +00:00
|
|
|
struct evbuffer;
|
2008-05-12 00:41:55 +00:00
|
|
|
|
2013-01-21 00:00:00 +00:00
|
|
|
typedef void (*tr_rpc_response_func)(tr_session * session,
|
|
|
|
struct evbuffer * response,
|
|
|
|
void * user_data);
|
2008-05-13 12:52:58 +00:00
|
|
|
/* http://www.json.org/ */
|
2012-12-05 17:29:46 +00:00
|
|
|
void tr_rpc_request_exec_json (tr_session * session,
|
2009-01-18 15:24:26 +00:00
|
|
|
const void * request_json,
|
2009-01-19 14:05:43 +00:00
|
|
|
int request_len,
|
2009-01-18 15:24:26 +00:00
|
|
|
tr_rpc_response_func callback,
|
2012-12-05 17:29:46 +00:00
|
|
|
void * callback_user_data);
|
2008-05-13 12:52:58 +00:00
|
|
|
|
2008-05-18 16:44:30 +00:00
|
|
|
/* see the RPC spec's "Request URI Notation" section */
|
2012-12-05 17:29:46 +00:00
|
|
|
void tr_rpc_request_exec_uri (tr_session * session,
|
2009-01-18 15:24:26 +00:00
|
|
|
const void * request_uri,
|
2009-01-19 14:05:43 +00:00
|
|
|
int request_len,
|
2009-01-18 15:24:26 +00:00
|
|
|
tr_rpc_response_func callback,
|
2012-12-05 17:29:46 +00:00
|
|
|
void * callback_user_data);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-14 04:34:42 +00:00
|
|
|
void tr_rpc_parse_list_str (tr_variant * setme,
|
|
|
|
const char * list_str,
|
|
|
|
int list_str_len);
|
2008-05-24 18:22:16 +00:00
|
|
|
|
2009-03-25 00:15:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2008-06-16 03:47:50 +00:00
|
|
|
|
2009-03-25 18:41:48 +00:00
|
|
|
#endif /* TR_RPC_H */
|