NNTPGrab Glue API

NNTPGrab Glue API

Synopsis

#define             NNTPGRAB_GLUE_VERSION
NntpgrabGlue *      nntpgrab_glue_new                   (void);
void                nntpgrab_glue_destroy               (NntpgrabGlue *obj);
ngboolean           nntpgrab_glue_connect               (NntpgrabGlue *obj,
                                                         const char *hostname,
                                                         int port,
                                                         const char *username,
                                                         const char *password,
                                                         ngboolean use_ssl,
                                                         char **err,
                                                         char **warnings);
ngboolean           nntpgrab_glue_get_is_connected      (NntpgrabGlue *obj);
ngboolean           nntpgrab_glue_get_is_standalone     (NntpgrabGlue *obj);

Description

Details

NNTPGRAB_GLUE_VERSION

#define NNTPGRAB_GLUE_VERSION    20101116

nntpgrab_glue_new ()

NntpgrabGlue *      nntpgrab_glue_new                   (void);

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

Returns :

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

nntpgrab_glue_destroy ()

void                nntpgrab_glue_destroy               (NntpgrabGlue *obj);

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

obj :

An instance of the NntpgrabGlue

nntpgrab_glue_connect ()

ngboolean           nntpgrab_glue_connect               (NntpgrabGlue *obj,
                                                         const char *hostname,
                                                         int port,
                                                         const char *username,
                                                         const char *password,
                                                         ngboolean use_ssl,
                                                         char **err,
                                                         char **warnings);

Connect to an already running NNTPGrab Server OR start the standalone version of NNTPGrab Note that even if this function returns TRUE, the warnings argument MAY be set

obj :

An instance of the NntpgrabGlue

hostname :

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. [allow-none]

port :

The port where the NNTPGrab Server is running

username :

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. [allow-none]

password :

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. [allow-none]

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

err :

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]

warnings :

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. [allow-none][out]

Returns :

TRUE on success, FALSE on failure

nntpgrab_glue_get_is_connected ()

ngboolean           nntpgrab_glue_get_is_connected      (NntpgrabGlue *obj);

Find out is we are already connected to an NNTPGrab Server

obj :

An instance of the NntpgrabGlue

Returns :

TRUE if we are already connected, FALSE if not

nntpgrab_glue_get_is_standalone ()

ngboolean           nntpgrab_glue_get_is_standalone     (NntpgrabGlue *obj);

Find out if we are running the standalone version of NNTPGrab

obj :

An instance of the NntpgrabGlue

Returns :

TRUE if we are running the standalone version of NNTPGrab, FALSE if not