summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-08 14:24:25 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-08 14:24:25 +0000
commit070688006ac7cea1639f38c0bb270c191f7dc38f (patch)
tree258fbf88a6f28a86bef83553e2430e950d972793 /src/util.c
parentf74c398577f66488cf5c420f5df318ab801117cc (diff)
a torrent add dialog based off Transmission GTK (different bencode+action implementation) which allows you to set file priorities, torrent priority, directory in advance. probably needs a little more work.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 6cb6e11..cd7e9f2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -35,6 +35,24 @@
#include "util.h"
#include "dispatch.h"
+void add_file_id_to_array(JsonObject * args, gchar * key, gint index)
+{
+ JsonArray *array;
+ if (json_object_has_member(args, key)) {
+ array = json_object_get_array_member(args, key);
+ } else {
+ array = json_array_new();
+ json_object_set_array_member(args, key, array);
+ }
+ json_array_add_int_element(array, index);
+}
+
+void g_str_slist_free(GSList * list)
+{
+ g_slist_foreach( list, (GFunc)g_free, NULL );
+ g_slist_free(list);
+}
+
GRegex *trg_uri_host_regex_new(void)
{
return g_regex_new("^[^:/?#]+:?//([^/?#]*)", G_REGEX_OPTIMIZE, 0,