mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 20:52:30 +00:00
* Finished the move over to object_storage, removing command_function.*.
* Added redirects for several commands. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1166 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+1
-2
@@ -3,8 +3,6 @@ noinst_LIBRARIES = libsub_rpc.a
|
||||
libsub_rpc_a_SOURCES = \
|
||||
command.h \
|
||||
command_impl.h \
|
||||
command_function.cc \
|
||||
command_function.h \
|
||||
command_map.cc \
|
||||
command_map.h \
|
||||
command_scheduler.cc \
|
||||
@@ -15,6 +13,7 @@ libsub_rpc_a_SOURCES = \
|
||||
command_new_slot.h \
|
||||
exec_file.cc \
|
||||
exec_file.h \
|
||||
fixed_key.h \
|
||||
object_storage.cc \
|
||||
object_storage.h \
|
||||
parse.cc \
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
// rTorrent - BitTorrent client
|
||||
// Copyright (C) 2005-2007, Jari Sundell
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// In addition, as a special exception, the copyright holders give
|
||||
// permission to link the code of portions of this program with the
|
||||
// OpenSSL library under certain conditions as described in each
|
||||
// individual source file, and distribute linked combinations
|
||||
// including the two.
|
||||
//
|
||||
// You must obey the GNU General Public License in all respects for
|
||||
// all of the code used other than OpenSSL. If you modify file(s)
|
||||
// with this exception, you may extend this exception to your version
|
||||
// of the file(s), but you are not obligated to do so. If you do not
|
||||
// wish to do so, delete this exception statement from your version.
|
||||
// If you delete this exception statement from all source files in the
|
||||
// program, then also delete it here.
|
||||
//
|
||||
// Contact: Jari Sundell <jaris@ifi.uio.no>
|
||||
//
|
||||
// Skomakerveien 33
|
||||
// 3185 Skoppum, NORWAY
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <rak/functional.h>
|
||||
|
||||
#include "parse.h"
|
||||
#include "parse_commands.h"
|
||||
#include "command_function.h"
|
||||
|
||||
namespace rpc {
|
||||
|
||||
// Temp until it can be moved somewhere better...
|
||||
const torrent::Object
|
||||
command_function_call(const torrent::raw_string& cmd, target_type target, const torrent::Object& args) {
|
||||
rpc::Command::stack_type stack;
|
||||
torrent::Object* last_stack;
|
||||
|
||||
if (args.is_list())
|
||||
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
|
||||
else if (args.type() != torrent::Object::TYPE_NONE)
|
||||
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
|
||||
else
|
||||
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
|
||||
|
||||
try {
|
||||
torrent::Object result = parse_command_multiple(target, cmd.begin(), cmd.end());
|
||||
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
return result;
|
||||
|
||||
} catch (torrent::bencode_error& e) {
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
const torrent::Object
|
||||
CommandFunctionList::call(Command* rawCommand, target_type target, const torrent::Object& args) {
|
||||
rpc::Command::stack_type stack;
|
||||
torrent::Object* last_stack;
|
||||
|
||||
if (args.is_list())
|
||||
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
|
||||
else if (args.type() != torrent::Object::TYPE_NONE)
|
||||
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
|
||||
else
|
||||
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
|
||||
|
||||
CommandFunctionList* command = reinterpret_cast<CommandFunctionList*>(rawCommand);
|
||||
|
||||
try {
|
||||
for (base_type::const_iterator itr = command->begin(), last = command->end(); itr != last; itr++)
|
||||
parse_command_multiple(target, itr->second.c_str(), itr->second.c_str() + itr->second.size());
|
||||
|
||||
} catch (torrent::bencode_error& e) {
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
throw e;
|
||||
}
|
||||
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
return torrent::Object();
|
||||
}
|
||||
|
||||
CommandFunctionList::const_iterator
|
||||
CommandFunctionList::find(const char* key) {
|
||||
base_type::iterator itr = std::find_if(begin(), end(), rak::less_equal(key, rak::mem_ref(&base_type::value_type::first)));
|
||||
|
||||
if (itr == end() || itr->first != key)
|
||||
return end();
|
||||
else
|
||||
return itr;
|
||||
}
|
||||
|
||||
void
|
||||
CommandFunctionList::insert(const std::string& key, const std::string& cmd) {
|
||||
base_type::iterator itr = std::find_if(begin(), end(), rak::less_equal(key, rak::mem_ref(&base_type::value_type::first)));
|
||||
|
||||
if (itr != end() && itr->first == key)
|
||||
itr->second = cmd;
|
||||
else
|
||||
base_type::insert(itr, base_type::value_type(key, cmd));
|
||||
}
|
||||
|
||||
void
|
||||
CommandFunctionList::erase(const std::string& key) {
|
||||
base_type::iterator itr = std::find_if(begin(), end(), rak::less_equal(key, rak::mem_ref(&base_type::value_type::first)));
|
||||
|
||||
if (itr != end() && itr->first == key)
|
||||
base_type::erase(itr);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
// rTorrent - BitTorrent client
|
||||
// Copyright (C) 2005-2007, Jari Sundell
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// In addition, as a special exception, the copyright holders give
|
||||
// permission to link the code of portions of this program with the
|
||||
// OpenSSL library under certain conditions as described in each
|
||||
// individual source file, and distribute linked combinations
|
||||
// including the two.
|
||||
//
|
||||
// You must obey the GNU General Public License in all respects for
|
||||
// all of the code used other than OpenSSL. If you modify file(s)
|
||||
// with this exception, you may extend this exception to your version
|
||||
// of the file(s), but you are not obligated to do so. If you do not
|
||||
// wish to do so, delete this exception statement from your version.
|
||||
// If you delete this exception statement from all source files in the
|
||||
// program, then also delete it here.
|
||||
//
|
||||
// Contact: Jari Sundell <jaris@ifi.uio.no>
|
||||
//
|
||||
// Skomakerveien 33
|
||||
// 3185 Skoppum, NORWAY
|
||||
|
||||
#ifndef RTORRENT_RPC_COMMAND_FUNCTION_H
|
||||
#define RTORRENT_RPC_COMMAND_FUNCTION_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include <inttypes.h>
|
||||
#include <torrent/object.h>
|
||||
|
||||
#include "command.h"
|
||||
|
||||
namespace rpc {
|
||||
|
||||
class CommandFunctionList : public Command,
|
||||
private std::vector<std::pair<std::string, std::string> > {
|
||||
public:
|
||||
typedef std::vector<std::pair<std::string, std::string> > base_type;
|
||||
|
||||
using Command::value_type;
|
||||
using base_type::iterator;
|
||||
using base_type::const_iterator;
|
||||
using base_type::begin;
|
||||
using base_type::end;
|
||||
|
||||
CommandFunctionList() {}
|
||||
|
||||
const_iterator find(const char* key);
|
||||
|
||||
void insert(const std::string& key, const std::string& cmd);
|
||||
void erase(const std::string& key);
|
||||
|
||||
static const torrent::Object call(Command* rawCommand, target_type target, const torrent::Object& args);
|
||||
};
|
||||
|
||||
// Temp until it can be moved somewhere better...
|
||||
const torrent::Object
|
||||
command_function_call(const torrent::raw_string& cmd, target_type target, const torrent::Object& args);
|
||||
|
||||
inline const torrent::Object
|
||||
command_function_call_str(const std::string& cmd, target_type target, const torrent::Object& args) {
|
||||
return command_function_call(torrent::raw_string::from_string(cmd), target, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
+39
-14
@@ -39,7 +39,7 @@
|
||||
#include "object_storage.h"
|
||||
|
||||
#include "parse.h"
|
||||
#include "command_function.h"
|
||||
#include "parse_commands.h"
|
||||
|
||||
namespace rpc {
|
||||
|
||||
@@ -69,6 +69,7 @@ object_storage::insert(const char* key_data, uint32_t key_size, const torrent::O
|
||||
case flag_value_type: object = convert_to_value(rawObject); break;
|
||||
case flag_string_type: object = convert_to_string(rawObject); break;
|
||||
case flag_function_type: object = convert_to_string(rawObject); break;
|
||||
case flag_multi_type: object = torrent::Object::create_map(); break;
|
||||
}
|
||||
|
||||
if (!(flags & mask_type))
|
||||
@@ -95,17 +96,6 @@ object_storage::get(const torrent::raw_string& key) {
|
||||
return itr->second.object;
|
||||
}
|
||||
|
||||
// const torrent::Object&
|
||||
// object_storage::set(const torrent::raw_string& key, const torrent::Object& object) {
|
||||
// local_iterator itr = find_local(key);
|
||||
|
||||
// if (itr == end(bucket_count()) || (itr->second.flags & mask_type) != flag_generic_type)
|
||||
// throw torrent::input_error("Key not found or wrong type.");
|
||||
|
||||
// return itr->second.object = object;
|
||||
// }
|
||||
|
||||
|
||||
const torrent::Object&
|
||||
object_storage::set_bool(const torrent::raw_string& key, int64_t object) {
|
||||
local_iterator itr = find_local(key);
|
||||
@@ -152,10 +142,45 @@ torrent::Object
|
||||
object_storage::call_function(const torrent::raw_string& key, target_type target, const torrent::Object& object) {
|
||||
local_iterator itr = find_local(key);
|
||||
|
||||
if (itr == end(bucket_count()) || !itr->second.object.is_string())
|
||||
if (itr == end(bucket_count()))
|
||||
throw torrent::input_error("Key not found or wrong type.");
|
||||
|
||||
return command_function_call_str(itr->second.object.as_string(), target, object);
|
||||
switch (itr->second.flags & mask_type) {
|
||||
case flag_function_type:
|
||||
return command_function_call_str(itr->second.object.as_string(), target, object);
|
||||
case flag_multi_type:
|
||||
return command_function_multi_call(itr->second.object.as_map(), target, object);
|
||||
default:
|
||||
throw torrent::input_error("Key not found or wrong type.");
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
object_storage::has_multi_key(const torrent::raw_string& key, const std::string& cmd_key) {
|
||||
local_iterator itr = find_local(key);
|
||||
|
||||
return itr != end(0) && (itr->second.flags & mask_type) == flag_multi_type &&
|
||||
itr->second.object.has_key(cmd_key);
|
||||
}
|
||||
|
||||
void
|
||||
object_storage::erase_multi_key(const torrent::raw_string& key, const std::string& cmd_key) {
|
||||
local_iterator itr = find_local(key);
|
||||
|
||||
if (itr != end(0) && (itr->second.flags & mask_type) == flag_multi_type)
|
||||
return;
|
||||
|
||||
itr->second.object.erase_key(cmd_key);
|
||||
}
|
||||
|
||||
void
|
||||
object_storage::set_multi_key(const torrent::raw_string& key, const std::string& cmd_key, const std::string& object) {
|
||||
local_iterator itr = find_local(key);
|
||||
|
||||
if (itr == end(0) || (itr->second.flags & mask_type) != flag_multi_type)
|
||||
throw torrent::input_error("Key not found or wrong type.");
|
||||
|
||||
itr->second.object.insert_key(cmd_key, object);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+35
-77
@@ -46,82 +46,10 @@
|
||||
#include <torrent/object.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "fixed_key.h"
|
||||
|
||||
namespace rpc {
|
||||
|
||||
// The key size should be such that the value type size which includes
|
||||
// the next-pointer.
|
||||
|
||||
template <size_t MaxSize>
|
||||
class fixed_key_type {
|
||||
public:
|
||||
typedef char value_type;
|
||||
typedef const char* iterator;
|
||||
typedef const char* const_iterator;
|
||||
typedef uint32_t size_type;
|
||||
|
||||
static const size_type max_size = MaxSize - 1;
|
||||
|
||||
fixed_key_type() : m_size(0) { m_data[0] = '\0'; }
|
||||
fixed_key_type(const fixed_key_type& k) : m_size(k.m_size) { std::memcpy(m_data, k.m_data, k.m_size + 1); }
|
||||
|
||||
fixed_key_type(const value_type* src_data, size_type src_size) { set_data(src_data, src_size); }
|
||||
|
||||
static fixed_key_type from_c_str(const char* str) { fixed_key_type k; k.set_c_str(str); return k; }
|
||||
static fixed_key_type from_string(const std::string& str) { fixed_key_type k; k.set_c_str(str.c_str(), str.size()); return k; }
|
||||
static fixed_key_type from_raw_string(const torrent::raw_string& str) { fixed_key_type k; k.set_data(str.data(), str.size()); return k; }
|
||||
|
||||
bool empty() const { return m_size == 0;; }
|
||||
size_type size() const { return m_size; }
|
||||
|
||||
iterator begin() const { return m_data; }
|
||||
iterator end() const { return m_data + m_size; }
|
||||
|
||||
value_type* data() { return m_data; }
|
||||
const value_type* data() const { return m_data; }
|
||||
const char* c_str() const { return m_data; }
|
||||
|
||||
void set_data(const value_type* src_data, size_type src_size);
|
||||
void set_c_str(const value_type* src_data);
|
||||
void set_c_str(const value_type* src_data, size_type src_size);
|
||||
|
||||
bool operator == (const fixed_key_type& rhs) const { return m_size == rhs.m_size && std::memcmp(m_data, rhs.m_data, m_size) == 0; }
|
||||
bool operator != (const fixed_key_type& rhs) const { return m_size != rhs.m_size || std::memcmp(m_data, rhs.m_data, m_size) != 0; }
|
||||
|
||||
bool operator == (const std::string& rhs) const { return m_size == rhs.size() && std::memcmp(m_data, rhs.data(), m_size) == 0; }
|
||||
|
||||
private:
|
||||
size_type m_size;
|
||||
char m_data[max_size];
|
||||
};
|
||||
|
||||
struct hash_fixed_key_type {
|
||||
template <size_t MaxSize>
|
||||
inline std::size_t operator () (const fixed_key_type<MaxSize>& p) const { return hash(p.data()); }
|
||||
|
||||
static inline std::size_t hash(const char* data) {
|
||||
std::size_t result = 0;
|
||||
|
||||
while (*data != '\0')
|
||||
result = (result * 131) + *data++;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline std::size_t hash(const char* data, uint32_t size) {
|
||||
std::size_t result = 0;
|
||||
|
||||
while (size--)
|
||||
result = (result * 131) + *data++;
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
struct object_storage_node {
|
||||
torrent::Object object;
|
||||
char flags;
|
||||
@@ -157,6 +85,7 @@ public:
|
||||
static const unsigned int flag_value_type = 0x3;
|
||||
static const unsigned int flag_string_type = 0x4;
|
||||
static const unsigned int flag_function_type = 0x5;
|
||||
static const unsigned int flag_multi_type = 0x6;
|
||||
|
||||
static const unsigned int mask_type = 0xf;
|
||||
|
||||
@@ -181,9 +110,6 @@ public:
|
||||
const torrent::Object& get_c_str(const char* str) { return get(torrent::raw_string(str, std::strlen(str))); }
|
||||
const torrent::Object& get_str(const std::string& str) { return get(torrent::raw_string(str.data(), str.size())); }
|
||||
|
||||
// const torrent::Object& set(const torrent::raw_string& key, const torrent::Object& object);
|
||||
// const torrent::Object& set_c_str(const char* str, const torrent::Object& object) { return set(torrent::raw_string(str, std::strlen(str)), object); }
|
||||
|
||||
const torrent::Object& set_bool(const torrent::raw_string& key, int64_t object);
|
||||
const torrent::Object& set_c_str_bool(const char* str, int64_t object) { return set_bool(torrent::raw_string::from_c_str(str), object); }
|
||||
const torrent::Object& set_str_bool(const std::string& str, int64_t object) { return set_bool(torrent::raw_string::from_string(str), object); }
|
||||
@@ -196,11 +122,23 @@ public:
|
||||
const torrent::Object& set_c_str_string(const char* str, const std::string& object) { return set_string(torrent::raw_string::from_c_str(str), object); }
|
||||
const torrent::Object& set_str_string(const std::string& str, const std::string& object) { return set_string(torrent::raw_string::from_string(str), object); }
|
||||
|
||||
// Functions callers:
|
||||
torrent::Object call_function(const torrent::raw_string& key, target_type target, const torrent::Object& object);
|
||||
torrent::Object call_function_str(const std::string& key, target_type target, const torrent::Object& object);
|
||||
|
||||
// Single-command function:
|
||||
|
||||
const torrent::Object& set_function(const torrent::raw_string& key, const std::string& object);
|
||||
const torrent::Object& set_str_function(const std::string& str, const std::string& object) { return set_function(torrent::raw_string::from_string(str), object); }
|
||||
const torrent::Object& set_str_function(const std::string& key, const std::string& object);
|
||||
|
||||
// Multi-command function:
|
||||
bool has_multi_key(const torrent::raw_string& key, const std::string& cmd_key);
|
||||
void erase_multi_key(const torrent::raw_string& key, const std::string& cmd_key);
|
||||
void set_multi_key(const torrent::raw_string& key, const std::string& cmd_key, const std::string& object);
|
||||
|
||||
bool has_str_multi_key(const std::string& key, const std::string& cmd_key);
|
||||
void erase_str_multi_key(const std::string& key, const std::string& cmd_key);
|
||||
void set_str_multi_key(const std::string& key, const std::string& cmd_key, const std::string& object);
|
||||
};
|
||||
|
||||
//
|
||||
@@ -262,6 +200,26 @@ object_storage::call_function_str(const std::string& key, target_type target, co
|
||||
return call_function(torrent::raw_string::from_string(key), target, object);
|
||||
}
|
||||
|
||||
inline const torrent::Object&
|
||||
object_storage::set_str_function(const std::string& key, const std::string& object) {
|
||||
return set_function(torrent::raw_string::from_string(key), object);
|
||||
}
|
||||
|
||||
inline bool
|
||||
object_storage::has_str_multi_key(const std::string& key, const std::string& cmd_key) {
|
||||
return has_multi_key(torrent::raw_string::from_string(key), cmd_key);
|
||||
}
|
||||
|
||||
inline void
|
||||
object_storage::erase_str_multi_key(const std::string& key, const std::string& cmd_key) {
|
||||
erase_multi_key(torrent::raw_string::from_string(key), cmd_key);
|
||||
}
|
||||
|
||||
inline void
|
||||
object_storage::set_str_multi_key(const std::string& key, const std::string& cmd_key, const std::string& object) {
|
||||
return set_multi_key(torrent::raw_string::from_string(key), cmd_key, object);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -223,4 +223,61 @@ parse_command_name(const char* first, const char* last, std::string* dest) {
|
||||
return first;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
// Temp until it can be moved somewhere better...
|
||||
const torrent::Object
|
||||
command_function_call(const torrent::raw_string& cmd, target_type target, const torrent::Object& args) {
|
||||
rpc::Command::stack_type stack;
|
||||
torrent::Object* last_stack;
|
||||
|
||||
if (args.is_list())
|
||||
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
|
||||
else if (args.type() != torrent::Object::TYPE_NONE)
|
||||
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
|
||||
else
|
||||
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
|
||||
|
||||
try {
|
||||
torrent::Object result = parse_command_multiple(target, cmd.begin(), cmd.end());
|
||||
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
return result;
|
||||
|
||||
} catch (torrent::bencode_error& e) {
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
const torrent::Object
|
||||
command_function_multi_call(const torrent::Object::map_type& cmd, target_type target, const torrent::Object& args) {
|
||||
rpc::Command::stack_type stack;
|
||||
torrent::Object* last_stack;
|
||||
|
||||
if (args.is_list())
|
||||
last_stack = rpc::Command::push_stack(args.as_list(), &stack);
|
||||
else if (args.type() != torrent::Object::TYPE_NONE)
|
||||
last_stack = rpc::Command::push_stack(&args, &args + 1, &stack);
|
||||
else
|
||||
last_stack = rpc::Command::push_stack(NULL, NULL, &stack);
|
||||
|
||||
try {
|
||||
for (torrent::Object::map_const_iterator itr = cmd.begin(), last = cmd.end(); itr != last; itr++) {
|
||||
const std::string& cmd_str = itr->second.as_string();
|
||||
parse_command_multiple(target, cmd_str.c_str(), cmd_str.c_str() + cmd_str.size());
|
||||
}
|
||||
|
||||
} catch (torrent::bencode_error& e) {
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
throw e;
|
||||
}
|
||||
|
||||
rpc::Command::pop_stack(&stack, last_stack);
|
||||
return torrent::Object();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -133,6 +133,21 @@ call_command_d_range(const char* key, core::Download* download, torrent::Object:
|
||||
return commands.call_command_d(key, download, rawArgs);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
// Temp until it can be moved somewhere better...
|
||||
const torrent::Object
|
||||
command_function_call(const torrent::raw_string& cmd, target_type target, const torrent::Object& args);
|
||||
const torrent::Object
|
||||
command_function_multi_call(const torrent::Object::map_type& cmd, target_type target, const torrent::Object& args);
|
||||
|
||||
inline const torrent::Object
|
||||
command_function_call_str(const std::string& cmd, target_type target, const torrent::Object& args) {
|
||||
return command_function_call(torrent::raw_string::from_string(cmd), target, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user