Statistics
| Revision:

root / trunk / glue / nntpgrab_glue.h @ 1850

History | View | Annotate | Download (24 KB)

1
/* 
2
    Copyright (C) 2005-2010  Erik van Pienbroek
3

                
4
    This program is free software; you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation; either version 2 of the License, or
7
    (at your option) any later version.
8

                
9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13

                
14
    You should have received a copy of the GNU General Public License
15
    along with this program; if not, write to the Free Software
16
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
*/
18

                
19
#ifndef _NNTPGRAB_GLUE_H_
20
#define _NNTPGRAB_GLUE_H_
21

                
22
#include "nntpgrab_types.h"
23

                
24
#ifdef  __cplusplus
25
extern "C" {
26
#endif
27

                
28
#define NNTPGRAB_GLUE_VERSION    20110710
29

                
30
#define NNTPGRAB_TYPE_GLUE              (nntpgrab_glue_get_type ())
31
#define NNTPGRAB_GLUE(object)           (NG_TYPE_CHECK_INSTANCE_CAST ((object), NNTPGRAB_TYPE_GLUE, NntpgrabGlue))
32
#define NNTPGRAB_GLUE_CLASS(klass)      (NG_TYPE_CHECK_CLASS_CAST ((klass), NNTPGRAB_TYPE_GLUE, NntpgrabGlueClass))
33
#define IS_NNTPGRAB_GLUE(object)        (NG_TYPE_CHECK_INSTANCE_TYPE ((object), NNTPGRAB_TYPE_GLUE))
34
#define IS_NNTPGRAB_GLUE_CLASS(klass)   (NG_TYPE_CHECK_CLASS_TYPE ((klass), NNTPGRAB_TYPE_GLUE))
35
#define NNTPGRAB_GLUE_GET_CLASS(obj)    (NG_TYPE_INSTANCE_GET_CLASS ((obj), NNTPGRAB_TYPE_GLUE, NntpgrabGlueClass))
36

                
37
typedef struct NntpgrabGlue NntpgrabGlue;
38
typedef struct NntpgrabGlueClass NntpgrabGlueClass;
39

                
40
NGType nntpgrab_glue_get_type(void);
41

                
42
/** 
43
 * nntpgrab_glue_new:
44
 *
45
 * Creates a new instance of the NntpgrabGlue object. This is required for all other NNTPGrab functions
46
 *
47
 * Return value: An instance of the NntpgrabGlue which need to be used for other NNTPGrab functions
48
 */
49
NntpgrabGlue *nntpgrab_glue_new(void);
50

                
51
/** 
52
 * nntpgrab_glue_init:
53
 * @glue:                               An instance of the NntpgrabGlue
54
 * @glue_version:                       Needs to be NNTPGRAB_GLUE_VERSION, this is used to prevent version conflicts
55
 * @err:           (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
56
 *
57
 * Initialize the NNTPGrab Glue library. This function needs to be called before any other NNTPGrab function can be called
58
 *
59
 * Return value:                        TRUE on success, FALSE if an error has occured (the reason is saved in the err variable)
60
 */
61
ngboolean nntpgrab_glue_init(NntpgrabGlue *glue, int glue_version, char **err);
62

                
63
/** 
64
 * nntpgrab_glue_destroy:
65
 * @obj:           An instance of the NntpgrabGlue
66
 *
67
 * Cleanup the NNTPGrab Glue library. After this function is called, the NntpgrabGlue instance can't be used anymore
68
 */
69
void nntpgrab_glue_destroy(NntpgrabGlue *obj);
70

                
71
/** 
72
 * nntpgrab_glue_connect:
73
 * @obj:                              An instance of the NntpgrabGlue
74
 * @hostname:    (allow-none):        The hostname where the NNTPGrab Server is running. If this is NULL, the standalone version of NNTPGrab will be started. In that case, the contents of the fields port, username, password and use_ssl are ignored
75
 * @port:                             The port where the NNTPGrab Server is running
76
 * @username:    (allow-none):        The username of an user who is allowed to connect to the NNTPGrab Server. This feature isn't implemented yet, so keep it NULL for now
77
 * @password:    (allow-none):        The password of an user who is allowed to connect to the NNTPGrab Server. This feature isn't implemented yet, so keep it NULL for now
78
 * @use_ssl:                          Do we want to have an encrypted connection to the NNTPGrab Server. This feature isn't implemented yet, so keep it FALSE for now
79
 * @err:         (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
80
 * @warnings:    (allow-none) (out):  Pointer to a char*. If an (non-fatal) warning occurs, the reason will be placed in this field. Needs to be freed using ngfree(). Can be NULL to ignore errors
81
 *
82
 * Connect to an already running NNTPGrab Server OR start the standalone version of NNTPGrab
83
 * Note that even if this function returns TRUE, the warnings argument MAY be set
84
 *
85
 * Returns:      TRUE on success, FALSE on failure
86
 */
87
ngboolean nntpgrab_glue_connect(NntpgrabGlue *obj, const char *hostname, int port, const char *username, const char *password, ngboolean use_ssl, char **err, char **warnings);
88

                
89
/** 
90
 * nntpgrab_glue_get_is_connected:
91
 * @obj:       An instance of the NntpgrabGlue
92
 *
93
 * Find out is we are already connected to an NNTPGrab Server
94
 *
95
 * Returns:         TRUE if we are already connected, FALSE if not
96
 */
97
ngboolean nntpgrab_glue_get_is_connected(NntpgrabGlue *obj);
98

                
99
/** 
100
 * nntpgrab_glue_get_is_standalone:
101
 * @obj:      An instance of the NntpgrabGlue
102
 *
103
 * Find out if we are running the standalone version of NNTPGrab
104
 *
105
 * Returns:         TRUE if we are running the standalone version of NNTPGrab, FALSE if not
106
 */
107
ngboolean nntpgrab_glue_get_is_standalone(NntpgrabGlue *obj);
108

                
109
/** 
110
 * nntpgrab_glue_set_emit_log_messages:
111
 * @param obj           An instance of the NntpgrabGlue
112
 * @param val           Boolean which needs to be set to TRUE if log messages need to be emit or FALSE when they don't
113
 *
114
 * Indicate whether log messages should be emit the frontend
115
 */
116
void     nntpgrab_glue_set_emit_log_messages(NntpgrabGlue *obj, ngboolean val);
117

                
118
/** 
119
 * nntpgrab_glue_kill_server:
120
 * @obj:           An instance of the NntpgrabGlue
121
 *
122
 * Shutdown the NNTPGrab Server where we're connected to
123
 * Note: After this function is called, all communication with the NNTPGrab Server will be killed and the frontend should shutdown itself
124
 */
125
void nntpgrab_glue_kill_server(NntpgrabGlue *obj);
126

                
127
/** 
128
 * nntpgrab_glue_signal_connect:
129
 * @obj:           An instance of the NntpgrabGlue
130
 * @signal_name:   The name of the signal for which a signaler handler needs to be registered
131
 * @cb_handler:    The function which need to be called every time the given signal is emit
132
 * @data:          Data used as extra argument in the callback functions
133
 *
134
 * Register a signal handler
135
 * The file nntpgrab_core/marshall.list contains a list of known signals and callback function prototypes for the NntpgrabGlue
136
 */
137
void     nntpgrab_glue_signal_connect(NntpgrabGlue *obj, const char *signal_name, NGCallback cb_handler, void *data);
138

                
139
/** 
140
 * nntpgrab_glue_signal_handler_disconnect_by_func:
141
 * @obj:           An instance of the NntpgrabGlue
142
 * @cb_handler:    The callback function which need to be unregistered
143
 * @data:          The callback data used for the given cb_handler
144
 *
145
 * Un-register a signal handler
146
 */
147
void     nntpgrab_glue_signal_handlers_disconnect_by_func(NntpgrabGlue *obj, NGCallback cb_handler, void *data);
148

                
149
/** 
150
 * nntpgrab_glue_signal_handlers_block_by_func:
151
 * @obj:           An instance of the NntpgrabGlue
152
 * @cb_handler:    The callback function which need to be temporary blocked
153
 * @data:          The callback data used for the given cb_handler
154
 *
155
 * Temporary disable a signal handler for a given callback function
156
 */
157
void     nntpgrab_glue_signal_handlers_block_by_func(NntpgrabGlue *obj, NGCallback cb_handler, void *data);
158

                
159
/** 
160
 * nntpgrab_glue_signal_handlers_unlock_by_func:
161
 * @obj:           An instance of the NntpgrabGlue
162
 * @cb_handler:    The callback function which need to be un-blocked
163
 * @data:          The callback data used for the given cb_handler
164
 *
165
 * Re-enable a signal handler for a given callback function
166
 */
167
void     nntpgrab_glue_signal_handlers_unblock_by_func(NntpgrabGlue *obj, NGCallback cb_handler, void *data);
168

                
169
/** 
170
 * nntpgrab_glue_config_get_avail_servers:
171
 * @obj:       An instance of the NntpgrabGlue
172
 *
173
 * Retrieve a list of the available usenet servers
174
 *
175
 * Return value: (transfer full) (element-type utf8): A list of all the available usenet servers. Needs to be freed using nntpgrab_config_free_avail_servers()
176
 */
177
NGList         *nntpgrab_glue_config_get_avail_servers(NntpgrabGlue *obj);
178

                
179
/** 
180
 * nntpgrab_glue_config_free_avail_servers: (skip)
181
 * @obj           An instance of the NntpgrabGlue
182
 * @servers       A list of the available usenet servers as returned from the function nntpgrab_config_get_avail_servers()
183
 *
184
 * Free the list of available usenet servers
185
 */
186
void            nntpgrab_glue_config_free_avail_servers(NntpgrabGlue *obj, NGList *servers);
187

                
188
/** 
189
 * nntpgrab_glue_config_get_server_info:
190
 * @obj:                  An instance of the NntpgrabGlue
191
 * @servername:           The name of the server whose details should be retrieved
192
 * @server:       (out):  The address of a ConfigServer structure which will be used to fill in the configuration details
193
 *
194
 * Get the configuration details about a specific usenet server
195
 *
196
 * Returns:               TRUE on success (server will be filled in), FALSE if the server isn't known
197
 */
198
ngboolean       nntpgrab_glue_config_get_server_info(NntpgrabGlue *obj, const char *servername, NGConfigServer *server);
199

                
200
/** 
201
 * nntpgrab_glue_config_add_server:
202
 * @obj:                              An instance of the NntpgrabGlue
203
 * @new_server:                       A structure containing the details about the new usenet server
204
 * @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
205
 *
206
 * Add a new usenet server to the NNTPGrab configuration
207
 *
208
 * Returns:                           TRUE when the server was successfully added. FALSE on failure (the reason will be placed in the errmsg field)
209
 */
210
ngboolean       nntpgrab_glue_config_add_server(NntpgrabGlue *obj, NGConfigServer new_server, char **errmsg);
211

                
212
/** 
213
 * nntpgrab_glue_config_del_server:
214
 * @obj:                              An instance of the NntpgrabGlue
215
 * @servername:                       The name of the server whose entry should be removed
216
 * @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
217
 *
218
 * Remove a usenet server from the NNTPGrab configuration
219
 *
220
 * Returns:                           TRUE when the server was successfully removed. FALSE on failure (the reason will be placed in the errmsg field)
221
 */
222
ngboolean       nntpgrab_glue_config_del_server(NntpgrabGlue *obj, const char *servername, char **errmsg);
223

                
224
/** 
225
 * nntpgrab_glue_config_edit_server:
226
 * @obj:                              An instance of the NntpgrabGlue
227
 * @servername:                       The name of the server whose entry should be adjusted
228
 * @server:                           A structure containing the new configuration details of the given servername
229
 * @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
230
 *
231
 * Adjust the configuration details of an usenet server
232
 *
233
 * Returns:                           TRUE when the server was successfully adjusted. FALSE on failure (the reason will be placed in the errmsg field)
234
 */
235
ngboolean       nntpgrab_glue_config_edit_server(NntpgrabGlue *obj, const char *servername, NGConfigServer server, char **errmsg);
236

                
237
/** 
238
 * nntpgrab_glue_config_get_opts:
239
 * @obj:           An instance of the NntpgrabGlue
240
 *
241
 * Retrieve the general configuration options
242
 *
243
 * Returns:        A structure containing the general configuration options
244
 */
245
NGConfigOpts    nntpgrab_glue_config_get_opts(NntpgrabGlue *obj);
246

                
247
/** 
248
 * nntpgrab_glue_config_set_opts:
249
 * @obj:           An instance of the NNTPGrabCore
250
 * @opts:          A structure containing the new general configuration options
251
 *
252
 * Adjust the general configuration options
253
 *
254
 */
255
void            nntpgrab_glue_config_set_opts(NntpgrabGlue *obj, NGConfigOpts opts);
256

                
257
/** 
258
 * nntpgrab_glue_config_get_folder_listing:
259
 * @obj:                                              An instance of the NntpgrabGlue
260
 * @parent:    (allow-none):                          The name of the directory whose sub-folders should be retrieved. When this is NULL all available drives will be returned (when the host is running Windows)
261
 * @folders:   (element-type NNTPGrabFolder) (out):   Pointer to a NGList*. The list of sub-folders will be placed in this field. This list needs to be free'd using the function nntpgrab_config_free_folder_listing()
262
 *
263
 * Retrieves a list containing all the sub-folders which are in the given folder
264
 *
265
 * Returns:                                           TRUE on sucess, FALSE if the given directory isn't found or readable
266
 */
267
ngboolean       nntpgrab_glue_config_get_folder_listing(NntpgrabGlue *obj, const char *parent, NGList **folders);
268

                
269
/** 
270
 * nntpgrab_glue_config_free_folder_listing: (skip)
271
 * @obj:           An instance of the NntpgrabGlue
272
 * @folders:       A list containing subfolders as returned by the function nntpgrab_config_get_folder_listing()
273
 *
274
 * Free a list of sub-folders
275
 */
276
void            nntpgrab_glue_config_free_folder_listing(NntpgrabGlue *obj, NGList *folders);
277

                
278
/** 
279
 * nntpgrab_glue_schedular_start:
280
 * @obj:        An instance of the NntpgrabGlue
281
 *
282
 * Start the NNTPGrab schedular
283
 *
284
 * Returns:     TRUE is the schedular was successfully started, FALSE if the schedular was already running or in the 'stopping' state
285
 */
286
ngboolean       nntpgrab_glue_schedular_start(NntpgrabGlue *obj);
287

                
288
/** 
289
 * nntpgrab_glue_schedular_stop:
290
 * @obj:           An instance of the NntpgrabGlue
291
 * @wait:          Whether this function should wait until the schedular really has stopped
292
 *
293
 * Stop the NNTPGrab schedular
294
 *
295
 * Returns:        TRUE is schedular was successfully stopped, FALSE if the schedular was already stopped or the in 'stopping' state
296
 */
297
ngboolean       nntpgrab_glue_schedular_stop(NntpgrabGlue *obj, ngboolean wait);
298

                
299
/** 
300
 * nntpgrab_glue_schedular_get_state:
301
 * @obj:           An instance of the NntpgrabGlue
302
 *
303
 * Retrieve the current state of the schedular
304
 *
305
 * Returns:        The current state of the schedular
306
 */
307
NGSchedularState  nntpgrab_glue_schedular_get_state(NntpgrabGlue *obj);
308

                
309
/** 
310
 * nntpgrab_glue_schedular_add_task_to_queue:
311
 * @obj:                                            An instance of the NntpgrabGlue
312
 * @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
313
 * @subject:                                        The subject of the file
314
 * @poster:                                         The name of the poster
315
 * @stamp:                                          The UNIX timestamp of the post date
316
 * @file_size:                                      The size of the file in bytes
317
 * @groups:           (element-type utf8):          A list containing the newsgroups in which this file is posted
318
 * @parts:            (element-type NNTPGrabPart):  A list containing the message-id's of all the individual parts belonging to this file
319
 * @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
320
 *
321
 * Add a new task to the download queue
322
 *
323
 * Returns:               TRUE if the task was succesfully added, FALSE if an error occured (errmsg will be set)
324
 */
325
ngboolean       nntpgrab_glue_schedular_add_task_to_queue(NntpgrabGlue *obj, const char *collection_name, const char *subject, const char *poster, time_t stamp, nguint64 file_size, NGList *groups, NGList *parts, char **errmsg);
326

                
327
/** 
328
 * nntpgrab_glue_schedular_del_task_from_queue:
329
 * @obj:                                    An instance of the NntpgrabGlue
330
 * @collection_name:                        The name of the collection in which the task resides
331
 * @subject:                                The subject of the file
332
 * @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
333
 *
334
 * Remove a task from the download queue
335
 *
336
 * Returns:                                 TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)
337
 */
338
ngboolean       nntpgrab_glue_schedular_del_task_from_queue(NntpgrabGlue *obj, const char *collection_name, const char *subject, char **errmsg);
339

                
340
/** 
341
 * nntpgrab_glue_schedular_restart_task:
342
 * @obj:                                    An instance of the NntpgrabGlue
343
 * @collection_name:                        The name of the collection in which the task resides
344
 * @subject:                                The subject of the file
345
 * @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
346
 *
347
 * Restart a task in the download queue
348
 *
349
 * Returns:                                 TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)
350
 */
351
ngboolean       nntpgrab_glue_schedular_restart_task(NntpgrabGlue *obj, const char *collection_name, const char *subject, char **errmsg);
352

                
353
/** 
354
 * nntpgrab_glue_schedular_save_queue:
355
 * @obj:                            An instance of the NntpgrabGlue
356
 * @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
357
 *
358
 * Save any recent changes in the download queue to the disk.
359
 * 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)
360
 *
361
 * Returns:                         TRUE if the task was successfully removed, FALSE if an error occured (errmsg will be set)
362
 */
363
ngboolean       nntpgrab_glue_schedular_save_queue(NntpgrabGlue *obj, char **errmsg);
364

                
365
/** 
366
 * nntpgrab_glue_schedular_foreach_task:
367
 * @obj:                             An instance of the NntpgrabGlue
368
 * @collection_func:  (allow-none):  The function which should be called for every collection in the download queue
369
 * @file_func:        (allow-none):  The function which should be called for every file in the download queue
370
 * @group_func:       (allow-none):  The function which should be called for every group in every file in the download queue
371
 * @data:             (allow-none):  Pointer to some data which will be made available in the callback functions
372
 *
373
 * Retrieve a list of all the items in the download queue (using callback functions)
374
 */
375
void            nntpgrab_glue_schedular_foreach_task(NntpgrabGlue *obj, ForeachCollectionFunc collection_func, ForeachFileFunc file_func, ForeachGroupFunc group_func, void *data);
376

                
377
/** 
378
 * nntpgrab_glue_schedular_move_task:
379
 * @obj:                                 An instance of the NntpgrabGlue
380
 * @collection_name_src:                 The name of the collection where the subject is part of
381
 * @subject_src:                         The name of the subject which needs to be moved
382
 * @collection_name_dest: (allow-none):  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)
383
 * @position_dest:                       The position in collection_name_dest where the task needs to be placed at
384
 *
385
 * Move a task in the download queue
386
 *
387
 * Returns:                              TRUE on success, FALSE if the collection_name_src or subject_src could not be found
388
 */
389
ngboolean       nntpgrab_glue_schedular_move_task(NntpgrabGlue *obj, const char *collection_name_src, const char *subject_src, const char *collection_name_dest, int position_dest);
390

                
391
/** 
392
 * nntpgrab_glue_schedular_move_collection:
393
 * @obj:               An instance of the NntpgrabGlue
394
 * @collection_name:   The name of the collection which needs to be moved
395
 * @new_position:      The position in the download queue where the collection needs to be moved to
396
 *
397
 * Move the position of a collection in the download queue
398
 *
399
 * Returns:           TRUE on success, FALSE is the collection_name could not be found
400
 */
401
ngboolean       nntpgrab_glue_schedular_move_collection(NntpgrabGlue *obj, const char *collection_name, int new_position);
402

                
403
/** 
404
 * nntpgrab_glue_schedular_mark_task_optional:
405
 * @obj:               An instance of the NntpgrabGlue
406
 * @collection_name:   The name of the collection in which the task resides
407
 * @subject:           The subject of the task
408
 * @is_optional:       TRUE if the task needs to be marked optional, FALSE is the task needs to be marked non-optional
409
 *
410
 * Mark a task in the download queue optional or non-optional
411
 *
412
 * Returns:            TRUE if the task was successfully updated, FALSE if the task wasn't found
413
 */
414
ngboolean       nntpgrab_glue_schedular_mark_task_optional(NntpgrabGlue *obj, const char *collection_name, const char *subject, ngboolean is_optional);
415

                
416
/** 
417
 * nntpgrab_glue_plugins_get_avail_plugins:
418
 * @obj:             An instance of the NntpgrabGlue
419
 *
420
 * Retrieve a list of all the available plugins
421
 *
422
 * Returns:          A list containing all the available plugins (const char* items). Needs to be free'd using nntpgrab_plugins_free_avail_plugins()
423
 */
424
NGList         *nntpgrab_glue_plugins_get_avail_plugins(NntpgrabGlue *obj);
425

                
426
/** 
427
 * nntpgrab_glue_plugins_free_avail_plugins: (skip)
428
 * @obj:               An instance of the NNTPGrabCore
429
 * @plugins:           The list of available plugins
430
 *
431
 * Free a list as returned by the function nntpgrab_plugins_get_avail_plugins()
432
 */
433
void            nntpgrab_glue_plugins_free_avail_plugins(NntpgrabGlue *obj, NGList *plugins);
434

                
435
/** 
436
 * nntpgrab_glue_plugins_get_plugin_info:
437
 * @obj:                   An instance of the NntpgrabGlue
438
 * @plugin_name:           The name of the plugin whose information needs to be retrieved
439
 * @plugin_info:  (out):   Pointer to an NNTPGrabPluginInfo structure where the plugin information can be saved
440
 *
441
 * Retrieve information about a specific plugin
442
 *
443
 * Returns:                TRUE on success, FALSE if the given plugin_name is unknown
444
 */
445
ngboolean       nntpgrab_glue_plugins_get_plugin_info(NntpgrabGlue *obj, const char *plugin_name, NNTPGrabPluginInfo *plugin_info);
446

                
447
/** 
448
 * nntpgrab_glue_plugins_load_plugin:
449
 * @obj:                                An instance of the NntpgrabGlue
450
 * @plugin_name:                        The name of the plugin which needs to be loaded
451
 * @errmsg:       (allow-none) (out):   Pointer to a location where an error message can be saved. Needs to be free'd using ng_free()
452
 *
453
 * Load a plugin
454
 *
455
 * Returns:                             TRUE on success, FALSE is the given plugin_name is unknown or an error occured while loading the plugin
456
 */
457
ngboolean       nntpgrab_glue_plugins_load_plugin(NntpgrabGlue *obj, const char *plugin_name, char **errmsg);
458

                
459
/** 
460
 * nntpgrab_glue_plugins_unload_plugin:
461
 * @obj:                                An instance of the NntpgrabGlue
462
 * @plugin_name:                        The name of the plugin which needs to be unloaded
463
 * @errmsg:       (allow-none) (out):   Pointer to a location where an error message can be saved. Needs to be free'd using ng_free()
464
 *
465
 * Unload a plugin
466
 *
467
 * Returns:                             TRUE on success, FALSE is the given plugin_name is unknown or an error occured while unloading the plugin
468
 */
469
ngboolean       nntpgrab_glue_plugins_unload_plugin(NntpgrabGlue *obj, const char *plugin_name, char **errmsg);
470

                
471
/** 
472
 * nntpgrab_glue_plugins_set_persistent:
473
 * @obj:               An instance of the NntpgrabGlue
474
 * @plugin_name:       The name of the plugin
475
 * @persistent:        Flag to indicate whether this plugin needs to be automatically loaded or not
476
 *
477
 * Indicate whether a plugin needs to be automatically loaded on startup
478
 * This API function is unused in NNTPGrab 0.6
479
 *
480
 * Returns:            TRUE on success, FALSE is the given plugin_name is unknown
481
 */
482
ngboolean       nntpgrab_glue_plugins_set_persistent(NntpgrabGlue *obj, const char *plugin_name, ngboolean persistent);
483

                
484
#ifdef  __cplusplus
485
}
486
#endif
487

                
488
#endif /* _NNTPGRAB_GLUE_H_ */