From 21208ecc1c6223cdfd2dbfeaff3bcfad8d0b8937 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 15 Jul 2020 18:13:49 +0200 Subject: Add torrent complete notification --- src/transmission.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/transmission.h') diff --git a/src/transmission.h b/src/transmission.h index cbb6c7c..c15d42b 100644 --- a/src/transmission.h +++ b/src/transmission.h @@ -6,13 +6,20 @@ struct TransmissionSession { char session_header[128]; }; +typedef void (*TorrentListCallback)(int id, const char *name, double percentage_done, void *userdata); + int transmission_connect(TransmissionSession *session); /* Returns 0 if the daemon is running, otherwise returns an error value */ int transmission_is_daemon_running(); int transmission_start_daemon(const char *download_dir); -/* The torrent name will be stored in @torrent_name, malloc'ed */ -int transmission_add_torrent(TransmissionSession *session, const char *url, char **torrent_name); +/* + The torrent id will be stored in @torrent_id, malloc'ed and + the torrent name will be stored in @torrent_name, malloc'ed. +*/ +int transmission_add_torrent(TransmissionSession *session, const char *url, int *torrent_id, char **torrent_name); + +int transmission_list_torrents(TransmissionSession *session, TorrentListCallback callback, void *userdata); #endif -- cgit v1.2.3