NNTPGrab Core library

NNTPGrab Core library

Synopsis

#define             NNTPGRAB_API_VERSION
typedef             NNTPGrabCore;
typedef             NNTPGrabCoreClass;
NNTPGrabCore *      nntpgrab_core_new                   (void);
void                nntpgrab_core_destroy               (NNTPGrabCore *obj);
NGList *            nntpgrab_core_config_get_avail_servers
                                                        (NNTPGrabCore *obj);
void                nntpgrab_core_config_free_avail_servers
                                                        (NNTPGrabCore *obj,
                                                         NGList *servers);
ngboolean           nntpgrab_core_config_get_server_info
                                                        (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         ConfigServer *server);
ngboolean           nntpgrab_core_config_add_server     (NNTPGrabCore *obj,
                                                         ConfigServer new_server,
                                                         char **errmsg);
ngboolean           nntpgrab_core_config_del_server     (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         char **errmsg);
ngboolean           nntpgrab_core_config_edit_server    (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         ConfigServer server,
                                                         char **errmsg);
ConfigOpts          nntpgrab_core_config_get_opts       (NNTPGrabCore *obj);
void                nntpgrab_core_config_set_opts       (NNTPGrabCore *obj,
                                                         ConfigOpts opts);
ngboolean           nntpgrab_core_schedular_start       (NNTPGrabCore *obj);
ngboolean           nntpgrab_core_schedular_stop        (NNTPGrabCore *obj,
                                                         ngboolean wait);
NGSchedularState    nntpgrab_core_schedular_get_state   (NNTPGrabCore *obj);
ngboolean           nntpgrab_core_schedular_add_task_to_queue
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         const char *poster,
                                                         time_t stamp,
                                                         nguint64 file_size,
                                                         NGList *groups,
                                                         NGList *parts,
                                                         char **errmsg);
ngboolean           nntpgrab_core_schedular_del_task_from_queue
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         char **errmsg);
ngboolean           nntpgrab_core_schedular_restart_task
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         char **errmsg);
ngboolean           nntpgrab_core_schedular_save_queue  (NNTPGrabCore *obj,
                                                         char **errmsg);
void                nntpgrab_core_schedular_foreach_task
                                                        (NNTPGrabCore *obj,
                                                         ForeachCollectionFunc collection_func,
                                                         ForeachFileFunc file_func,
                                                         ForeachGroupFunc group_func,
                                                         void *user_data);
ngboolean           nntpgrab_core_schedular_move_task   (NNTPGrabCore *obj,
                                                         const char *collection_name_src,
                                                         const char *subject_src,
                                                         const char *collection_name_dest,
                                                         int position_dest);
ngboolean           nntpgrab_core_schedular_move_collection
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         int new_position);
ngboolean           nntpgrab_core_schedular_mark_task_optional
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         ngboolean is_optional);
NGList *            nntpgrab_core_plugins_get_avail_plugins
                                                        (NNTPGrabCore *obj);
void                nntpgrab_core_plugins_free_avail_plugins
                                                        (NNTPGrabCore *obj,
                                                         NGList *plugins);
ngboolean           nntpgrab_core_plugins_get_plugin_info
                                                        (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         NNTPGrabPluginInfo *plugin_info);
ngboolean           nntpgrab_core_plugins_load_plugin   (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         char **errmsg);
ngboolean           nntpgrab_core_plugins_unload_plugin (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         char **errmsg);
ngboolean           nntpgrab_core_plugins_set_persistent
                                                        (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         ngboolean persistent);
ngboolean           nntpgrab_core_embedded_server_start (NNTPGrabCore *obj,
                                                         int port,
                                                         char **errmsg);

Object Hierarchy

  GObject
   +----NNTPGrabCore

Signals

  "all-downloads-completed"                        : Run Last / Has Details
  "collection-added"                               : Run Last / Has Details
  "collection-downloaded"                          : Run Last / Has Details
  "collection-modified"                            : Run Last / Has Details
  "collection-moved"                               : Run Last / Has Details
  "collection-removed"                             : Run Last / Has Details
  "config-changed"                                 : Run Last / Has Details
  "connection-connected"                           : Run Last / Has Details
  "connection-connecting"                          : Run Last / Has Details
  "connection-disconnect"                          : Run Last / Has Details
  "file-added"                                     : Run Last / Has Details
  "file-download-state-update"                     : Run Last / Has Details
  "file-removed"                                   : Run Last / Has Details
  "file-state-changed"                             : Run Last / Has Details
  "log-message"                                    : Run Last / Has Details
  "part-done"                                      : Run Last / Has Details
  "part-download-start"                            : Run Last / Has Details
  "part-failed"                                    : Run Last / Has Details
  "part-progress-update"                           : Run Last / Has Details
  "plugin-event"                                   : Run Last / Has Details
  "plugin-loaded"                                  : Run Last / Has Details
  "plugin-unloaded"                                : Run Last / Has Details
  "schedular-state-changed"                        : Run Last / Has Details
  "task-moved"                                     : Run Last / Has Details
  "traffic-monitor-update"                         : Run Last / Has Details

Description

Details

NNTPGRAB_API_VERSION

#define NNTPGRAB_API_VERSION    20100807

NNTPGrabCore

typedef struct NNTPGrabCore NNTPGrabCore;

NNTPGrabCoreClass

typedef struct NNTPGrabCoreClass NNTPGrabCoreClass;

nntpgrab_core_new ()

NNTPGrabCore *      nntpgrab_core_new                   (void);

Creates a new instance of the NNTPGrabCore object. This is required for all other NNTPGrab functions

Returns :

An instance of the NNTPGrabCore which need to be used for other NNTPGrab functions

nntpgrab_core_destroy ()

void                nntpgrab_core_destroy               (NNTPGrabCore *obj);

Cleanup the NNTPGrab Core library. After this function is called, the NNTPGrabCore instance can't be used anymore

obj :

An instance of the NNTPGrabCore

nntpgrab_core_config_get_avail_servers ()

NGList *            nntpgrab_core_config_get_avail_servers
                                                        (NNTPGrabCore *obj);

Retrieve a list of the available usenet servers

obj :

An instance of the NNTPGrabCore

Returns :

A list of all the available usenet servers. Needs to be freed using nntpgrab_config_free_avail_servers(). [transfer full][element-type utf8]

nntpgrab_core_config_free_avail_servers ()

void                nntpgrab_core_config_free_avail_servers
                                                        (NNTPGrabCore *obj,
                                                         NGList *servers);

Free the list of available usenet servers

obj :

An instance of the NNTPGrabCore

servers :

A list of the available usenet servers as returned from the function nntpgrab_config_get_avail_servers()

nntpgrab_core_config_get_server_info ()

ngboolean           nntpgrab_core_config_get_server_info
                                                        (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         ConfigServer *server);

Get the configuration details about a specific usenet server

obj :

An instance of the NNTPGrabCore

servername :

The name of the server whose details should be retrieved

server :

The address of a ConfigServer structure which will be used to fill in the configuration details. [out]

Returns :

TRUE on success (server will be filled in), FALSE if the server isn't known

nntpgrab_core_config_add_server ()

ngboolean           nntpgrab_core_config_add_server     (NNTPGrabCore *obj,
                                                         ConfigServer new_server,
                                                         char **errmsg);

Add a new usenet server to the NNTPGrab configuration

obj :

An instance of the NNTPGrabCore

new_server :

A structure containing the details about the new usenet server

errmsg :

Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none][out]

Returns :

TRUE when the server was successfully added. FALSE on failure (the reason will be placed in the errmsg field)

nntpgrab_core_config_del_server ()

ngboolean           nntpgrab_core_config_del_server     (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         char **errmsg);

Remove a usenet server from the NNTPGrab configuration

obj :

An instance of the NNTPGrabCore

servername :

The name of the server whose entry should be removed

errmsg :

Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none][out]

Returns :

TRUE when the server was successfully removed. FALSE on failure (the reason will be placed in the errmsg field)

nntpgrab_core_config_edit_server ()

ngboolean           nntpgrab_core_config_edit_server    (NNTPGrabCore *obj,
                                                         const char *servername,
                                                         ConfigServer server,
                                                         char **errmsg);

Adjust the configuration details of an usenet server

obj :

An instance of the NNTPGrabCore

servername :

The name of the server whose entry should be adjusted

server :

A structure containing the new configuration details of the given servername

errmsg :

Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none][out]

Returns :

TRUE when the server was successfully adjusted. FALSE on failure (the reason will be placed in the errmsg field)

nntpgrab_core_config_get_opts ()

ConfigOpts          nntpgrab_core_config_get_opts       (NNTPGrabCore *obj);

Retrieve the general configuration options

obj :

An instance of the NNTPGrabCore

Returns :

A structure containing the general configuration options

nntpgrab_core_config_set_opts ()

void                nntpgrab_core_config_set_opts       (NNTPGrabCore *obj,
                                                         ConfigOpts opts);

Adjust the general configuration options

obj :

An instance of the NNTPGrabCore

opts :

A structure containing the new general configuration options

nntpgrab_core_schedular_start ()

ngboolean           nntpgrab_core_schedular_start       (NNTPGrabCore *obj);

Start the NNTPGrab schedular

obj :

An instance of the NNTPGrabCore

Returns :

TRUE is the schedular was successfully started, FALSE if the schedular was already running or in the 'stopping' state

nntpgrab_core_schedular_stop ()

ngboolean           nntpgrab_core_schedular_stop        (NNTPGrabCore *obj,
                                                         ngboolean wait);

Stop the NNTPGrab schedular

obj :

An instance of the NNTPGrabCore

wait :

Whether this function should wait until the schedular really has stopped

Returns :

TRUE is schedular was successfully stopped, FALSE if the schedular was already stopped or the in 'stopping' state

nntpgrab_core_schedular_get_state ()

NGSchedularState    nntpgrab_core_schedular_get_state   (NNTPGrabCore *obj);

Retrieve the current state of the schedular

obj :

An instance of the NNTPGrabCore

Returns :

The current state of the schedular

nntpgrab_core_schedular_add_task_to_queue ()

ngboolean           nntpgrab_core_schedular_add_task_to_queue
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         const char *poster,
                                                         time_t stamp,
                                                         nguint64 file_size,
                                                         NGList *groups,
                                                         NGList *parts,
                                                         char **errmsg);

Add a new task to the download queue

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which this task should be added. If there is no collection in the download queue with the given name, it will automatically be created

subject :

The subject of the file

poster :

The name of the poster

stamp :

The UNIX timestamp of the post date

file_size :

The size of the file

groups :

A list containing the newsgroups in which this file is posted. [element-type utf8]

parts :

A list containing the message-id's of all the individual parts belonging to this file. [element-type NNTPGrabPart]

errmsg :

Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none][out]

Returns :

TRUE if the task was succesfully added, FALSE if an error occured (errmsg will be set)

nntpgrab_core_schedular_del_task_from_queue ()

ngboolean           nntpgrab_core_schedular_del_task_from_queue
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         char **errmsg);

Remove a task from the download queue

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which the task resides

subject :

The subject of the task errmsg (allow-none) (out): Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none]

Returns :

TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)

nntpgrab_core_schedular_restart_task ()

ngboolean           nntpgrab_core_schedular_restart_task
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         char **errmsg);

Restart a task in the download queue

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which the task resides

subject :

The subject of the task errmsg (allow-none) (out): Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none]

Returns :

TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)

nntpgrab_core_schedular_save_queue ()

ngboolean           nntpgrab_core_schedular_save_queue  (NNTPGrabCore *obj,
                                                         char **errmsg);

Save any recent changes in the download queue to the disk Note that the download queue will automatically be saved every now and then by the NNTPGrab Core, but it is recommended to perform a manual save as soon as a lot of file have been added to the download queue (like directly after an NZB import)

obj :

An instance of the NNTPGrabCore

errmsg :

Pointer to a char*. If an errors occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors. [allow-none][out]

Returns :

TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)

nntpgrab_core_schedular_foreach_task ()

void                nntpgrab_core_schedular_foreach_task
                                                        (NNTPGrabCore *obj,
                                                         ForeachCollectionFunc collection_func,
                                                         ForeachFileFunc file_func,
                                                         ForeachGroupFunc group_func,
                                                         void *user_data);

Retrieve a list of all the items in the download queue (using callback functions)

obj :

An instance of the NNTPGrabCore

collection_func :

The function which should be called for every collection in the download queue. [allow-none]

file_func :

The function which should be called for every file in the download queue. [allow-none]

group_func :

The function which should be called for every group in every file in the download queue. [allow-none]

user_data :

Pointer to some data which will be made available in the callback functions. [allow-none]

nntpgrab_core_schedular_move_task ()

ngboolean           nntpgrab_core_schedular_move_task   (NNTPGrabCore *obj,
                                                         const char *collection_name_src,
                                                         const char *subject_src,
                                                         const char *collection_name_dest,
                                                         int position_dest);

Move a task in the download queue

obj :

An instance of the NNTPGrabCore

collection_name_src :

The name of the collection where the subject is part of

subject_src :

The name of the subject which needs to be moved

collection_name_dest :

The name of the collection where the subject needs to be moved to (if NULL, the task will stay in the same collection as it is now) position_dest The position in collection_name_dest where the task needs to be placed at. [allow-none]

Returns :

TRUE on success, FALSE if the collection_name_src or subject_src could not be found

nntpgrab_core_schedular_move_collection ()

ngboolean           nntpgrab_core_schedular_move_collection
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         int new_position);

Move the position of a collection in the download queue

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which needs to be moved

new_position :

The position in the download queue where the collection needs to be moved to

Returns :

TRUE on success, FALSE is the collection_name could not be found

nntpgrab_core_schedular_mark_task_optional ()

ngboolean           nntpgrab_core_schedular_mark_task_optional
                                                        (NNTPGrabCore *obj,
                                                         const char *collection_name,
                                                         const char *subject,
                                                         ngboolean is_optional);

Mark a task in the download queue optional or non-optional

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which the task resides

subject :

The subject of the task

is_optional :

TRUE if the task needs to be marked optional, FALSE is the task needs to be marked non-optional

Returns :

TRUE if the task was successfully updated, FALSE if the task wasn't found

nntpgrab_core_plugins_get_avail_plugins ()

NGList *            nntpgrab_core_plugins_get_avail_plugins
                                                        (NNTPGrabCore *obj);

Retrieve a list of all the available plugins

obj :

An instance of the NNTPGrabCore

Returns :

A list containing all the available plugins (const char* items). Needs to be free'd using nntpgrab_core_plugins_free_avail_plugins(). [transfer full][element-type utf8]

nntpgrab_core_plugins_free_avail_plugins ()

void                nntpgrab_core_plugins_free_avail_plugins
                                                        (NNTPGrabCore *obj,
                                                         NGList *plugins);

Free a list as returned by the function nntpgrab_core_plugins_get_avail_plugins()

obj :

An instance of the NNTPGrabCore

plugins :

The list of available plugins

nntpgrab_core_plugins_get_plugin_info ()

ngboolean           nntpgrab_core_plugins_get_plugin_info
                                                        (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         NNTPGrabPluginInfo *plugin_info);

Retrieve information about a specific plugin

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin whose information needs to be retrieved

plugin_info :

Pointer to an NNTPGrabPluginInfo structure where the plugin information can be saved. [out]

Returns :

TRUE on success, FALSE if the given plugin_name is unknown

nntpgrab_core_plugins_load_plugin ()

ngboolean           nntpgrab_core_plugins_load_plugin   (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         char **errmsg);

Load a plugin

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin which needs to be loaded

errmsg :

Pointer to a location where an error message can be saved. Needs to be free'd using ng_free(). [allow-none][out]

Returns :

TRUE on success, FALSE is the given plugin_name is unknown or an error occured while loading the plugin

nntpgrab_core_plugins_unload_plugin ()

ngboolean           nntpgrab_core_plugins_unload_plugin (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         char **errmsg);

Unload a plugin

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin which needs to be unloaded

errmsg :

Pointer to a location where an error message can be saved. Needs to be free'd using ng_free(). [allow-none][out]

Returns :

TRUE on success, FALSE is the given plugin_name is unknown or an error occured while unloading the plugin

nntpgrab_core_plugins_set_persistent ()

ngboolean           nntpgrab_core_plugins_set_persistent
                                                        (NNTPGrabCore *obj,
                                                         const char *plugin_name,
                                                         ngboolean persistent);

Indicate whether a plugin needs to be automatically loaded on startup Note that this API function is unused in NNTPGrab 0.6

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin

persistent :

Flag to indicate whether this plugin needs to be automatically loaded or not

Returns :

TRUE on success, FALSE is the given plugin_name is unknown

nntpgrab_core_embedded_server_start ()

ngboolean           nntpgrab_core_embedded_server_start (NNTPGrabCore *obj,
                                                         int port,
                                                         char **errmsg);

Start the embedded server on the specified port (even if it's disabled in the configuration) Note that this API function is implemented temporary for NNTPGrab 0.6. For future versions it needs to be moved to a more generic API function

obj :

An instance of the NNTPGrabCore

port :

The port on which the embedded webserver needs to listen

errmsg :

Pointer to a location where an error message can be saved. Needs to be free'd using ng_free(). [allow-none][out]

Returns :

TRUE on success, FALSE if an error occured (errmsg will be set)

Signal Details

The "all-downloads-completed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gpointer      user_data)      : Run Last / Has Details

This message is emit when all the items in the download queue are completed

obj :

An instance of the NNTPGrabCore

user_data :

user data set when the signal handler was connected.

The "collection-added" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *poster,
                                                        gpointer      user_data)            : Run Last / Has Details

A new collection was added

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which was just added

poster :

The poster of this collection. If multiple posters are involved, this value will be NULL. [allow-none]

user_data :

user data set when the signal handler was connected.

The "collection-downloaded" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gpointer      user_data)            : Run Last / Has Details

A collection has been completely downloaded

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which has been fully downloaded

user_data :

user data set when the signal handler was connected.

The "collection-modified" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *poster,
                                                        gpointer      user_data)            : Run Last / Has Details

The poster of a collection was modified

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which was just changed

poster :

The name of the poster of this collection. This value can be NULL if multiple posters are involved. [allow-none]

user_data :

user data set when the signal handler was connected.

The "collection-moved" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gint          old_position,
                                                        gint          new_position,
                                                        gpointer      user_data)            : Run Last / Has Details

The position of a collection in the download queue has changed

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which has just been moved

old_position :

The original position in the download queue of the collection

new_position :

The new position in the download queue of the collection

user_data :

user data set when the signal handler was connected.

The "collection-removed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gpointer      user_data)            : Run Last / Has Details

A collection was removed

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection which was just removed

user_data :

user data set when the signal handler was connected.

The "config-changed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gpointer      user_data)      : Run Last / Has Details

Something in the configuration has changed

obj :

An instance of the NNTPGrabCore

user_data :

user data set when the signal handler was connected.

The "connection-connected" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gchar        *welcome_msg,
                                                        gpointer      user_data)        : Run Last / Has Details

A connection attempt has succeeded

obj :

An instance of the NNTPGrabCore

servername :

The name of the server to which a connection has just been made

conn_id :

An identifier for this connection

welcome_msg :

The welcome message which was returned from the server

user_data :

user data set when the signal handler was connected.

The "connection-connecting" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gpointer      user_data)       : Run Last / Has Details

A new connection is being made to a usenet server

obj :

An instance of the NNTPGrabCore

servername :

The name of the server to which a connection is being made

conn_id :

An identifier for this connection

user_data :

user data set when the signal handler was connected.

The "connection-disconnect" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gint          disconnect_type,
                                                        gchar        *reason,
                                                        gpointer      user_data)            : Run Last / Has Details

A connection to a usenet server was disconnected

obj :

An instance of the NNTPGrabCore

servername :

The name of the server which was just disconnected

conn_id :

An identifier for this connection

disconnect_type :

One of the values from NNTPDisconnectType

reason :

The reason which indicates why the disconnect occured. Can be NULL. [allow-none]

user_data :

user data set when the signal handler was connected.

The "file-added" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gchar        *poster,
                                                        guint64       stamp,
                                                        guint64       file_size,
                                                        guint64       total_size,
                                                        guint64       total_size_remaining,
                                                        gint          status,
                                                        gint          num_parts,
                                                        gpointer      groups,
                                                        gpointer      user_data)                 : Run Last / Has Details

A file was added to a already existing collection

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which this file belongs

subject :

The subject of the file which was just added

poster :

The poster of the file which was just added

stamp :

The stamp mentioning when the first part of this file was posted

file_size :

The size of this file in bytes

total_size :

The size of the entire collection in bytes

total_size_remaining :

The number of bytes which still need to be downloaded from the entire collection

status :

The current status of this file. This is of the type NGTaskState

num_parts :

The number of parts of which this file consists

groups :

A list containing the groups in which this file is posted. [element-type utf8]

user_data :

user data set when the signal handler was connected.

The "file-download-state-update" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gint          num_parts_total,
                                                        gint          num_parts_done,
                                                        gint          num_parts_failed,
                                                        guint64       file_size,
                                                        guint64       file_size_remaining,
                                                        guint64       total_size,
                                                        guint64       total_size_remaining,
                                                        gpointer      user_data)                 : Run Last / Has Details

The state of a file in the download queue has changed

obj :

An instance of the NNTPGrabCore

collection_name :

The collection name

subject :

The subject

num_parts_total :

The number of parts of which this file consists

num_parts_done :

The number of parts of this file which are already downloaded

num_parts_failed :

The number of parts of this file which failed to download

file_size :

The size of this file in bytes

file_size_remaining :

The number of bytes remaining from this file

total_size :

The total size of the entire collection in bytes

total_size_remaining :

The number of bytes remaining from the entire collection

user_data :

user data set when the signal handler was connected.

The "file-removed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        guint64       total_size,
                                                        guint64       total_size_remaining,
                                                        gpointer      user_data)                 : Run Last / Has Details

A file was removed from the download queue

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which this file was situated

subject :

The subject of the file

total_size :

The new total size of the entire collection

total_size_remaining :

The new total size remaining of the entire collection

user_data :

user data set when the signal handler was connected.

The "file-state-changed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gchar        *real_filename,
                                                        gint          old_state,
                                                        gint          new_state,
                                                        gpointer      user_data)            : Run Last / Has Details

A file in the download queue was restarted

obj :

An instance of the NNTPGrabCore

collection_name :

The name of the collection in which the state changed

subject :

The subject of the file which changed state

real_filename :

The file name of the physical resulting file. Will be NULL if the file isn't completely downloaded and decoded yet. [allow-none]

old_state :

The old state of the file

new_state :

The new state of the file

user_data :

user data set when the signal handler was connected.

The "log-message" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *component,
                                                        gint          log_level,
                                                        gchar        *msg,
                                                        gpointer      user_data)      : Run Last / Has Details

A log message has been emitted

obj :

An instance of the NNTPGrabCore

component :

The component which emit this log message

log_level :

One of the values from NGLogLevel

msg :

The log message which was emit

user_data :

user data set when the signal handler was connected.

The "part-done" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gint          part_num,
                                                        gint          size,
                                                        gpointer      user_data)            : Run Last / Has Details

The download of a part has completed successfully

obj :

An instance of the NNTPGrabCore

servername :

The name of the server on which this part has just been downloaded

conn_id :

The connection id which was used to download this part

collection_name :

The name of the collection from which this part is

subject :

The name of the subject from which this part is

part_num :

The number of the part

size :

The size of the part in bytes. This can be different from the size which was mentioned earlier in other calls like nntpgrab_core_schedular_foreach_task()

user_data :

user data set when the signal handler was connected.

The "part-download-start" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gint          part_num,
                                                        gpointer      user_data)            : Run Last / Has Details

The download of a part has just started

obj :

An instance of the NNTPGrabCore

servername :

The name of the server on which this part is being downloaded

conn_id :

The connection id which is used to download this part

collection_name :

The name of the collection from which this part is

subject :

The name of the subject from which this part is

part_num :

The number of the part

user_data :

user data set when the signal handler was connected.

The "part-failed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gint          part_num,
                                                        gint          size,
                                                        gboolean      all_servers_tried,
                                                        gpointer      user_data)              : Run Last / Has Details

The download of a part has failed (probably because the part isn't available on the server)

obj :

An instance of the NNTPGrabCore

servername :

The name of the server on which this part was tried

conn_id :

The connection id which was used to try to download this part

collection_name :

The name of the collection from which this part is

subject :

The name of the subject from which this part is

part_num :

The number of the part

size :

The size of the part in bytes

all_servers_tried :

If TRUE, all configured servers have tried to download this file and none of them succeeded

user_data :

user data set when the signal handler was connected.

The "part-progress-update" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *servername,
                                                        gint          conn_id,
                                                        gchar        *collection_name,
                                                        gchar        *subject,
                                                        gint          part_num,
                                                        gint          bytes_downloaded,
                                                        gint          bytes_total,
                                                        gpointer      user_data)             : Run Last / Has Details

Every 1/10th second of a part download, this message will be sent

obj :

An instance of the NNTPGrabCore

servername :

The name of the server on which this part is being downloaded

conn_id :

The connection id which is being used to download this part

collection_name :

The name of the collection from which this part is

subject :

The name of the subject from which this part is

part_num :

The number of the part

bytes_downloaded :

The number of bytes already downloaded from this part

bytes_total :

The total size of this part in bytes. This can be different from the size which was mentioned earlier in other calls like nntpgrab_core_schedular_foreach_task()

user_data :

user data set when the signal handler was connected.

The "plugin-event" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *plugin_name,
                                                        gchar        *event_name,
                                                        GStrv        *values,
                                                        gpointer      user_data)        : Run Last / Has Details

A plugin has emit an event

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin

event_name :

The name of the plugin event

values :

The values belonging to this event. This is a NULL-terminated array

user_data :

user data set when the signal handler was connected.

The "plugin-loaded" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *plugin_name,
                                                        gboolean      is_persistent,
                                                        gpointer      user_data)          : Run Last / Has Details

A plugin has been loaded

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin

is_persistent :

Unused in NNTPGrab 0.7

user_data :

user data set when the signal handler was connected.

The "plugin-unloaded" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *plugin_name,
                                                        gpointer      user_data)        : Run Last / Has Details

A plugin has been unloaded

obj :

An instance of the NNTPGrabCore

plugin_name :

The name of the plugin

user_data :

user data set when the signal handler was connected.

The "schedular-state-changed" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gint          new_state,
                                                        gchar        *reason,
                                                        gpointer      user_data)      : Run Last / Has Details

The state of the schedular has changed

obj :

An instance of the NNTPGrabCore

new_state :

The new state of the schedular

reason :

The reason why the schedular changed state. Will be NULL if it's caused by request of the user (nntpgrab_core_schedular_start() / nntpgrab_core_schedular_stop()). [allow-none]

user_data :

user data set when the signal handler was connected.

The "task-moved" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gchar        *orig_collection_name,
                                                        gchar        *subject,
                                                        gchar        *new_collection_name,
                                                        gint          old_position,
                                                        gint          new_position,
                                                        gpointer      user_data)                 : Run Last / Has Details

The position of a task in the download queue has changed

obj :

An instance of the NNTPGrabCore

orig_collection_name :

The name of the original collection of which the file was a member of

subject :

The subject of the file

new_collection_name :

The name of the new collection to which the file is moved (which can be the same of orig_collection_name)

old_position :

The original position of the file in the original collection

new_position :

The new position of the file in the new collection

user_data :

user data set when the signal handler was connected.

The "traffic-monitor-update" signal

void                user_function                      (NNTPGrabCore *obj,
                                                        gint          bytes_received1,
                                                        gint          bytes_received2,
                                                        gint          bytes_received3,
                                                        gint          bytes_received4,
                                                        gint          bytes_received5,
                                                        gint          bytes_received6,
                                                        gint          bytes_received7,
                                                        gint          bytes_received8,
                                                        gint          bytes_received9,
                                                        gint          bytes_received10,
                                                        gint64        stamp,
                                                        gdouble       average,
                                                        gpointer      user_data)             : Run Last / Has Details

Every second, traffic statistics about the last 10 seconds are given

obj :

An instance of the NNTPGrabCore

bytes_received1 :

The number of bytes received in now() - 10

bytes_received2 :

The number of bytes received in now() - 9

bytes_received3 :

The number of bytes received in now() - 8

bytes_received4 :

The number of bytes received in now() - 7

bytes_received5 :

The number of bytes received in now() - 6

bytes_received6 :

The number of bytes received in now() - 5

bytes_received7 :

The number of bytes received in now() - 4

bytes_received8 :

The number of bytes received in now() - 3

bytes_received9 :

The number of bytes received in now() - 2

bytes_received10 :

The number of bytes received in now() - 1

stamp :

The timestamp of the last measurement

average :

The average number of bytes per second

user_data :

user data set when the signal handler was connected.