00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #include 
00020 #include 
00021 #include 
00022 #include 
00023 #include 
00024 #include 
00025 #include 
00026 #include 
00027 
00028 #include "nntpgrab_plugin_schedular.h"
00029 #include "schedular_plugin.h"
00030 
00031 static PluginSchedularImportedFuncs imported_funcs;
00032 
00033 void
00034 schedular_plugin_set_imported_funcs(PluginSchedularImportedFuncs funcs)
00035 {
00036     imported_funcs = funcs;
00037 }
00038 
00039 void
00040 imported_funcs_task_added (const NNTPCollection *collection, const NNTPFile *file)
00041 {
00042     imported_funcs.task_added(collection, file);
00043 }
00044 
00045 void
00046 imported_funcs_task_removed (const char *collection_name, const char *subject, guint64 total_file_size, guint64 total_file_size_remaining)
00047 {
00048     imported_funcs.task_removed(collection_name, subject, total_file_size, total_file_size_remaining);
00049 }
00050 
00051 void
00052 imported_funcs_task_state_changed (const char *collection_name, const char *subject, TaskState old_state, TaskState new_state)
00053 {
00054     imported_funcs.task_state_changed(collection_name, subject, old_state, new_state);
00055 }
00056 
00057 void
00058 imported_funcs_collection_added (const char *collection_name)
00059 {
00060     imported_funcs.collection_added(collection_name);
00061 }
00062 
00063 void
00064 imported_funcs_collection_removed (const char *collection_name)
00065 {
00066     imported_funcs.collection_removed(collection_name);
00067 }
00068 
00069 void
00070 imported_funcs_notify_schedular_state_changed (SchedularState new_state, const char *reason)
00071 {
00072     imported_funcs.notify_schedular_state_changed(new_state, reason);
00073 }
00074 
00075 GList *
00076 imported_funcs_config_get_avail_servers (void)
00077 {
00078     return imported_funcs.config_get_avail_servers();
00079 }
00080 
00081 ConfigServer *
00082 imported_funcs_config_get_server_info (const char *servername)
00083 {
00084     return imported_funcs.config_get_server_info(servername);
00085 }
00086 
00087 ConfigOpts
00088 imported_funcs_config_get_opts (void)
00089 {
00090     return imported_funcs.config_get_opts();
00091 }
00092 
00093 gpointer
00094 imported_funcs_nntp_connection_initialize (const char *servername, NNTPGrabErrCode *err)
00095 {
00096     return imported_funcs.nntp_connection_initialize(servername, err);
00097 }
00098 
00099 void
00100 imported_funcs_nntp_connection_destroy (gpointer obj)
00101 {
00102     imported_funcs.nntp_connection_destroy(obj);
00103 }
00104 
00105 NNTPGrabErrCode
00106 imported_funcs_nntp_connection_get_part (gpointer obj, const char *collection_name, const NNTPFile *file, const NNTPPart *part, char **reason)
00107 {
00108     return imported_funcs.nntp_connection_get_part(obj, collection_name, file, part, reason);
00109 }
00110 
00111 gboolean
00112 imported_funcs_decode_file (const char *collection_name, const NNTPFile *file, int *saved_errno)
00113 {
00114     return imported_funcs.decode_file(collection_name, file, saved_errno);
00115 }
00116 
00117 void
00118 imported_funcs_emit_fatal_error (const char *errmsg)
00119 {
00120     imported_funcs.emit_fatal_error(errmsg);
00121 }
00122 
00123 void
00124 imported_funcs_emit_part_download_complete (const char *servername, gpointer nntp_connection, const char *collection_name, const char *subject, int partnum, int size)
00125 {
00126     imported_funcs.emit_part_download_complete(servername, nntp_connection, collection_name, subject, partnum, size);
00127 }
00128 
00129 void
00130 imported_funcs_emit_part_download_failed (const char *servername, gpointer nntp_connection, const char *collection_name, const char *subject, int partnum, int size, gboolean all_servers_tried)
00131 {
00132     imported_funcs.emit_part_download_failed(servername, nntp_connection, collection_name, subject, partnum, size, all_servers_tried);
00133 }
00134 
00135 void
00136 imported_funcs_emit_task_moved (const char *orig_collection_name, const char *subject, const char *new_collection_name, int old_position, int new_position)
00137 {
00138     imported_funcs.emit_task_moved (orig_collection_name, subject, new_collection_name, old_position, new_position);
00139 }
00140 
00141 void
00142 imported_funcs_emit_collection_moved (const char *collection_name, int old_position, int new_position)
00143 {
00144     imported_funcs.emit_collection_moved (collection_name, old_position, new_position);
00145 }
00146 
00147 void
00148 imported_funcs_emit_file_download_state_update (const char *collection_name, const char *subject, int num_parts_total, int num_parts_done, int num_parts_failed, guint64 file_size, guint64 file_size_remaining, guint64 total_file_size, guint64 total_file_size_remaining)
00149 {
00150     imported_funcs.emit_file_download_state_update (collection_name, subject, num_parts_total, num_parts_done, num_parts_failed, file_size, file_size_remaining, total_file_size, total_file_size_remaining);
00151 }