* Cleaned up commands.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1068 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-09-24 15:26:15 +00:00
parent 879a019757
commit 6385b995f3
17 changed files with 231 additions and 165 deletions
+5 -3
View File
@@ -38,6 +38,7 @@
#define RTORRENT_UTILS_COMMAND_HELPERS_H
#include "rpc/command_slot.h"
#include "rpc/command_function.h"
#include "rpc/parse_commands.h"
namespace rpc {
@@ -78,11 +79,9 @@ void initialize_commands();
void
add_variable(const char* getKey, const char* setKey, const char* defaultSetKey,
rpc::Command::generic_slot getSlot, rpc::Command::generic_slot setSlot,
rpc::Command::cleaned_slot getSlot, rpc::Command::cleaned_slot setSlot,
const torrent::Object& defaultObject);
extern torrent::Object cmd_call(const char* cmd, rpc::target_type target, const torrent::Object& rawArgs);
#define ADD_VARIABLE_BOOL(key, defaultValue) \
add_variable("get_" key, "set_" key, key, &rpc::CommandVariable::get_bool, &rpc::CommandVariable::set_bool, (int64_t)defaultValue);
@@ -207,4 +206,7 @@ add_variable(key, NULL, NULL, &rpc::CommandVariable::get_string, NULL, std::stri
#define CMD_D_VOID(key, slot) \
CMD_D_SLOT(key, call_unknown, rpc::object_fn(slot), "i:", "")
#define CMD_FUNC_SINGLE(key, command) \
rpc::commands.insert_type(key, new rpc::CommandFunction(command), &rpc::CommandFunction::call, rpc::CommandMap::flag_public_xmlrpc, NULL, NULL);
#endif