* Fix the use of strlcpy.

* Allow lists as arguments in commands by using '{' and '}'. The list
will be recursed and all '$' will be called, while '~' will only be
expanded when in the first element in the list. E.g "execute =
touch,{~/tmp/,$get_client_version=}"

* Added rak::path_expand that works on char buffers.

* Fixed RequestList::calculate_pipe_size so it doesn't request too
many pieces from fast peers.

* Added 'execute_log' for logging the result of calls to 'execute'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@952 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-08-12 13:41:50 +00:00
parent 781e1ca7dc
commit 788b496241
9 changed files with 207 additions and 78 deletions
+10 -2
View File
@@ -54,10 +54,13 @@ inline bool parse_is_escape(const char c) { return c == '\\'; }
inline bool parse_is_seperator(const char c) { return c == ','; }
inline bool parse_is_space(const char c) { return c == ' ' || c == '\t'; }
inline bool parse_is_delim_default(const char c) { return parse_is_seperator(c) || std::isspace(c); }
inline bool parse_is_delim_list(const char c) { return parse_is_seperator(c) || c == '}' || std::isspace(c); }
const char* parse_skip_wspace(const char* first);
const char* parse_skip_wspace(const char* first, const char* last);
const char* parse_string(const char* first, const char* last, std::string* dest);
const char* parse_string(const char* first, const char* last, std::string* dest, bool (*delim)(const char) = &parse_is_delim_default);
void parse_whole_string(const char* first, const char* last, std::string* dest);
const char* parse_value(const char* src, int64_t* value, int base = 0, int unit = 1);
@@ -66,7 +69,8 @@ const char* parse_value_nothrow(const char* src, int64_t* value, int base = 0, i
void parse_whole_value(const char* src, int64_t* value, int base = 0, int unit = 1);
bool parse_whole_value_nothrow(const char* src, int64_t* value, int base = 0, int unit = 1);
const char* parse_list(const char* first, const char* last, torrent::Object* dest);
const char* parse_object(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
const char* parse_list(const char* first, const char* last, torrent::Object* dest, bool (*delim)(const char) = &parse_is_delim_default);
const char* parse_whole_list(const char* first, const char* last, torrent::Object* dest);
std::string convert_list_to_string(const torrent::Object& src);
@@ -84,6 +88,10 @@ convert_to_single_argument(const torrent::Object& args) {
return args;
}
static const int print_expand_tilde = 0x1;
char* print_object(char* first, char* last, const torrent::Object* src, int flags);
}
#endif