rename_data->newname = g_strdup (newname);
rename_data->file_data = data;
rename_data->path_string = g_strdup (path_string);
- tr_torrentRenamePath (tor, oldpath->str, newname, (tr_torrent_rename_done_func*)on_rename_done, rename_data);
+ tr_torrentRenamePath (tor, oldpath->str, newname, (tr_torrent_rename_done_func)on_rename_done, rename_data);
/* cleanup */
g_string_free (oldpath, TRUE);
}
tr_scrape_response;
-typedef void tr_scrape_response_func (const tr_scrape_response * response,
- void * user_data);
+typedef void (*tr_scrape_response_func) (const tr_scrape_response * response,
+ void * user_data);
void tr_tracker_http_scrape (tr_session * session,
const tr_scrape_request * req,
}
tr_announce_response;
-typedef void tr_announce_response_func (const tr_announce_response * response,
- void * userdata);
+typedef void (*tr_announce_response_func) (const tr_announce_response * response,
+ void * userdata);
void tr_tracker_http_announce (tr_session * session,
const tr_announce_request * req,
struct announce_data
{
tr_announce_response response;
- tr_announce_response_func * response_func;
+ tr_announce_response_func response_func;
void * response_func_user_data;
char log_name[128];
};
struct scrape_data
{
tr_scrape_response response;
- tr_scrape_response_func * response_func;
+ tr_scrape_response_func response_func;
void * response_func_user_data;
char log_name[128];
};
tau_transaction_t transaction_id;
tr_scrape_response response;
- tr_scrape_response_func * callback;
+ tr_scrape_response_func callback;
void * user_data;
};
tau_transaction_t transaction_id;
tr_announce_response response;
- tr_announce_response_func * callback;
+ tr_announce_response_func callback;
void * user_data;
};
}
tr_tracker_event;
-typedef void tr_tracker_callback (tr_torrent * tor,
- const tr_tracker_event * event,
- void * client_data);
+typedef void (*tr_tracker_callback) (tr_torrent * tor,
+ const tr_tracker_event * event,
+ void * client_data);
/**
*** Session ctor/dtor
**/
struct tr_torrent_tiers * tr_announcerAddTorrent (tr_torrent * torrent,
- tr_tracker_callback * cb,
+ tr_tracker_callback cb,
void * cbdata);
bool tr_announcerHasBacklog (const struct tr_announcer *);
extern const tr_peer_event TR_PEER_EVENT_INIT;
-typedef void tr_peer_callback (struct tr_peer * peer,
- const tr_peer_event * event,
- void * client_data);
+typedef void (*tr_peer_callback) (struct tr_peer * peer,
+ const tr_peer_event * event,
+ void * client_data);
/***
****
tr_peerMsgs* tr_peerMsgsNew (struct tr_torrent * torrent,
struct tr_peerIo * io,
- tr_peer_callback * callback,
+ tr_peer_callback callback,
void * callback_data);
bool tr_peerMsgsIsPeerChoked (const tr_peerMsgs * msgs);
struct tr_fdInfo;
struct tr_device_info;
-typedef void (tr_web_config_func)(tr_session * session, void * curl_pointer, const char * url, void * user_data);
-
struct tr_turtle_info
{
/* TR_UP and TR_DOWN speed limits */
tr_sched_day days;
/* called when isEnabled changes */
- tr_altSpeedFunc * callback;
+ tr_altSpeedFunc callback;
/* the callback's user_data argument */
void * callbackUserData;
struct remove_data
{
- tr_torrent * tor;
- bool deleteFlag;
- tr_fileFunc * deleteFunc;
+ tr_torrent * tor;
+ bool deleteFlag;
+ tr_fileFunc deleteFunc;
};
static void tr_torrentDeleteLocalData (tr_torrent *, tr_fileFunc);
tr_torrent * tor;
char * oldpath;
char * newname;
- tr_torrent_rename_done_func * callback;
+ tr_torrent_rename_done_func callback;
void * callback_user_data;
};
int queuePosition;
- tr_torrent_metadata_func * metadata_func;
+ tr_torrent_metadata_func metadata_func;
void * metadata_func_user_data;
- tr_torrent_completeness_func * completeness_func;
- void * completeness_func_user_data;
+ tr_torrent_completeness_func completeness_func;
+ void * completeness_func_user_data;
- tr_torrent_ratio_limit_hit_func * ratio_limit_hit_func;
+ tr_torrent_ratio_limit_hit_func ratio_limit_hit_func;
void * ratio_limit_hit_func_user_data;
- tr_torrent_idle_limit_hit_func * idle_limit_hit_func;
+ tr_torrent_idle_limit_hit_func idle_limit_hit_func;
void * idle_limit_hit_func_user_data;
void * queue_started_user_data;
void tr_sessionSetAltSpeedDay (tr_session *, tr_sched_day day);
tr_sched_day tr_sessionGetAltSpeedDay (const tr_session *);
-typedef void (tr_altSpeedFunc)(tr_session *,
+typedef void (*tr_altSpeedFunc)(tr_session *,
bool active,
bool userDriven,
void *);
void tr_sessionClearAltSpeedFunc (tr_session *);
-void tr_sessionSetAltSpeedFunc (tr_session *, tr_altSpeedFunc *, void *);
+void tr_sessionSetAltSpeedFunc (tr_session *, tr_altSpeedFunc, void *);
bool tr_sessionGetActiveSpeedLimit_KBps (const tr_session * session,
/** @addtogroup tr_torrent Torrents
@{ */
-typedef int tr_fileFunc (const char * filename);
+typedef int (*tr_fileFunc) (const char * filename);
/** @brief Removes our .torrent and .resume files for this torrent */
void tr_torrentRemove (tr_torrent * torrent,
void tr_torrentStop (tr_torrent * torrent);
-typedef void (tr_torrent_rename_done_func)(tr_torrent * torrent,
- const char * oldpath,
- const char * newname,
- int error,
- void * user_data);
+typedef void (*tr_torrent_rename_done_func)(tr_torrent * torrent,
+ const char * oldpath,
+ const char * newname,
+ int error,
+ void * user_data);
/**
* @brief Rename a file or directory in a torrent.
* @param wasRunning whether or not the torrent was running when
* it changed its completeness state
*/
-typedef void (tr_torrent_completeness_func)(tr_torrent * torrent,
- tr_completeness completeness,
- bool wasRunning,
- void * user_data);
+typedef void (*tr_torrent_completeness_func)(tr_torrent * torrent,
+ tr_completeness completeness,
+ bool wasRunning,
+ void * user_data);
-typedef void (tr_torrent_ratio_limit_hit_func)(tr_torrent * torrent,
- void * user_data);
+typedef void (*tr_torrent_ratio_limit_hit_func)(tr_torrent * torrent,
+ void * user_data);
-typedef void (tr_torrent_idle_limit_hit_func)(tr_torrent * torrent,
- void * user_data);
+typedef void (*tr_torrent_idle_limit_hit_func)(tr_torrent * torrent,
+ void * user_data);
/**
-typedef void (tr_torrent_metadata_func)(tr_torrent * torrent,
- void * user_data);
+typedef void (*tr_torrent_metadata_func)(tr_torrent * torrent,
+ void * user_data);
/**
* Register to be notified whenever a torrent changes from
* having incomplete metadata to having complete metadata.
char * range;
char * cookies;
tr_session * session;
- tr_web_done_func * done_func;
+ tr_web_done_func done_func;
void * done_func_user_data;
CURL * curl_easy;
struct tr_web_task * next;
void tr_webClose (tr_session * session, tr_web_close_mode close_mode);
-typedef void (tr_web_done_func)(tr_session * session,
- bool timeout_flag,
- bool did_connect_flag,
- long response_code,
- const void * response,
- size_t response_byte_count,
- void * user_data);
+typedef void (*tr_web_done_func)(tr_session * session,
+ bool timeout_flag,
+ bool did_connect_flag,
+ long response_code,
+ const void * response,
+ size_t response_byte_count,
+ void * user_data);
const char * tr_webGetResponseStr (long response_code);
tr_peer parent;
tr_bandwidth bandwidth;
tr_session * session;
- tr_peer_callback * callback;
+ tr_peer_callback callback;
void * callback_data;
tr_list * tasks;
struct event * timer;
tr_webseed*
tr_webseedNew (struct tr_torrent * tor,
const char * url,
- tr_peer_callback * callback,
+ tr_peer_callback callback,
void * callback_data)
{
tr_webseed * w = tr_new0 (tr_webseed, 1);
tr_webseed* tr_webseedNew (struct tr_torrent * torrent,
const char * url,
- tr_peer_callback * callback,
+ tr_peer_callback callback,
void * callback_data);
#endif