libvalhalla  2.1.0
Data Fields
grabber_list_t Struct Reference

Structure for a grabber. More...

#include <grabber_common.h>

Data Fields

const char * name
 Textual identification of the grabber.
int caps_flag
 Flags to define the capabilities of the grabber.
int(* init )(void *priv, const grabber_param_t *param)
 Init function for the grabber.
void(* uninit )(void *priv)
 Uninit function for the grabber.
int(* grab )(void *priv, file_data_t *data)
 Grabbing function for the grabber.
void(* loop )(void *priv)
 Function called for each end of scan loop.
void * priv
 Private data for the grabber.
grabber_param_t param
 Parameters for the grabber.

Detailed Description

Structure for a grabber.

Definition at line 91 of file grabber_common.h.


Field Documentation

Flags to define the capabilities of the grabber.

Definition at line 97 of file grabber_common.h.

int(* grabber_list_t::grab)(void *priv, file_data_t *data)

Grabbing function for the grabber.

This function is called in order to populate the attributes meta_grabber and list_downloader in the data structure. All others attributes must be considered as read-only! Only them are thread-safe for writing.

To add new metadata in the database, the function vh_metadata_add() must be used on meta_grabber.

It is proibited to download files (images for example) with this function. Only textual metadata are proceeded here. But the reference on an image can be saved in the meta_grabber attribute. To download a file, the URL and the destination must be prepared for the downloader with the function vh_file_dl_add() in order to populate the list_downloader attribute. The files will be downloaded after the grabbing step.

To read meta_parser (attribute populated by the parser), you must use the function vh_metadata_get().

Parameters:
[in]privPrivate structure registered with the grabber.
[in]dataFile structure where some data must be populated.
Returns:
0 for success, != 0 on error.

Definition at line 147 of file grabber_common.h.

Init function for the grabber.

This initialization is called only at the init of an instance of valhalla. The private structure (priv) must be created before this initialization.

Parameters:
[in]privPrivate structure registered with the grabber.
[in]paramParameters, see grabber_param_t.
Returns:
0 for success, != 0 on error.

Definition at line 109 of file grabber_common.h.

void(* grabber_list_t::loop)(void *priv)

Function called for each end of scan loop.

This function is optional, it is called after each scanner loop if there are more than one loop. This function is never called after the last loop. It is useful to make some cleanup in the grabber before the next scan.

Parameters:
[in]privPrivate structure registered with the grabber.

Definition at line 158 of file grabber_common.h.

const char* grabber_list_t::name

Textual identification of the grabber.

Definition at line 95 of file grabber_common.h.

Parameters for the grabber.

Definition at line 168 of file grabber_common.h.

Private data for the grabber.

The data is registered at the same time that the grabber.

Definition at line 165 of file grabber_common.h.

void(* grabber_list_t::uninit)(void *priv)

Uninit function for the grabber.

This unititialization is called only at the uninit of an instance of valhalla. The private structure (priv) must be released in this function.

Parameters:
[in]privPrivate structure registered with the grabber.

Definition at line 120 of file grabber_common.h.


The documentation for this struct was generated from the following file: