#include "cddb/cddb_error.h"
Go to the source code of this file.
Defines | |
#define | CDDB_SITE_H 1 |
Typedefs | |
typedef cddb_site_s | cddb_site_t |
The CDDB site structure. | |
Enumerations | |
enum | cddb_protocol_t { PROTO_UNKNOWN = 0, PROTO_CDDBP, PROTO_HTTP } |
Enumeration defining the CDDB protocol supported by a specific site. More... | |
Functions | |
cddb_site_t * | cddb_site_new (void) |
Creates a new CDDB site structure. | |
cddb_error_t | cddb_site_destroy (cddb_site_t *site) |
Free all resources associated with the given CDDB site structure. | |
cddb_site_t * | cddb_site_clone (cddb_site_t *site) |
Creates a clone of the given site. | |
cddb_error_t | cddb_site_get_address (const cddb_site_t *site, const char **address, unsigned int *port) |
Get the site's address. | |
cddb_error_t | cddb_site_set_address (cddb_site_t *site, const char *address, unsigned int port) |
Set the site's address. | |
cddb_protocol_t | cddb_site_get_protocol (const cddb_site_t *site) |
Get the protocol used by the site. | |
cddb_error_t | cddb_site_set_protocol (cddb_site_t *site, cddb_protocol_t proto) |
Set the protocol used by the site. | |
cddb_error_t | cddb_site_get_query_path (const cddb_site_t *site, const char **path) |
Get the query path in case the HTTP protocol is used. | |
cddb_error_t | cddb_site_set_query_path (cddb_site_t *site, const char *path) |
Set the query path in case the HTTP protocol is used. | |
cddb_error_t | cddb_site_get_submit_path (const cddb_site_t *site, const char **path) |
Get the submit path in case the HTTP protocol is used. | |
cddb_error_t | cddb_site_set_submit_path (cddb_site_t *site, const char *path) |
Set the submit path in case the HTTP protocol is used. | |
cddb_error_t | cddb_site_get_location (const cddb_site_t *site, float *latitude, float *longitude) |
Get the site's location. | |
cddb_error_t | cddb_site_set_location (cddb_site_t *site, float latitude, float longitude) |
Set the site's location. | |
cddb_error_t | cddb_site_get_description (const cddb_site_t *site, const char **desc) |
Get a description of the site. | |
cddb_error_t | cddb_site_set_description (cddb_site_t *site, const char *desc) |
Set a description for the site. | |
int | cddb_site_parse (cddb_site_t *site, const char *line) |
Parses one line of data as returned by the sites command and populates the given structure. | |
cddb_error_t | cddb_site_print (const cddb_site_t *site) |
Prints information about the site on stdout. |
#define CDDB_SITE_H 1 |
typedef struct cddb_site_s cddb_site_t |
The CDDB site structure.
Contains all information about one particular CDDB server.
enum cddb_protocol_t |
cddb_site_t* cddb_site_clone | ( | cddb_site_t * | site | ) |
Creates a clone of the given site.
site | The CDDB site structure. |
cddb_error_t cddb_site_destroy | ( | cddb_site_t * | site | ) |
Free all resources associated with the given CDDB site structure.
site | The CDDB site structure. |
cddb_error_t cddb_site_get_address | ( | const cddb_site_t * | site, | |
const char ** | address, | |||
unsigned int * | port | |||
) |
Get the site's address.
site | The CDDB site structure. | |
address | The address of the server upon returning. | |
port | The port of the server upon returning. |
cddb_error_t cddb_site_get_description | ( | const cddb_site_t * | site, | |
const char ** | desc | |||
) |
Get a description of the site.
site | The CDDB site structure. | |
desc | The description upon returning. |
cddb_error_t cddb_site_get_location | ( | const cddb_site_t * | site, | |
float * | latitude, | |||
float * | longitude | |||
) |
Get the site's location.
site | The CDDB site structure. | |
latitude | Will contain the server's latitude upon returning. A positive number is used for the northern hemisphere, a negative one for the southern hemisphere. | |
longitude | Will contain the server's longitude upon returning. A positive number is used for the eastern hemisphere, a negative one for the western hemisphere. |
cddb_protocol_t cddb_site_get_protocol | ( | const cddb_site_t * | site | ) |
Get the protocol used by the site.
site | The CDDB site structure. |
cddb_error_t cddb_site_get_query_path | ( | const cddb_site_t * | site, | |
const char ** | path | |||
) |
Get the query path in case the HTTP protocol is used.
site | The CDDB site structure. | |
path | The query path upon returning. |
cddb_error_t cddb_site_get_submit_path | ( | const cddb_site_t * | site, | |
const char ** | path | |||
) |
Get the submit path in case the HTTP protocol is used.
site | The CDDB site structure. | |
path | The submit path upon returning. |
cddb_site_t* cddb_site_new | ( | void | ) |
Creates a new CDDB site structure.
int cddb_site_parse | ( | cddb_site_t * | site, | |
const char * | line | |||
) |
Parses one line of data as returned by the sites command and populates the given structure.
site | The CDDB site structure. | |
line | The result line. |
cddb_error_t cddb_site_print | ( | const cddb_site_t * | site | ) |
Prints information about the site on stdout.
This is just a debugging routine to display the structure's content.
site | The CDDB site structure. |
cddb_error_t cddb_site_set_address | ( | cddb_site_t * | site, | |
const char * | address, | |||
unsigned int | port | |||
) |
Set the site's address.
A copy of the address string is made. So the caller should free any memory associated with the input parameter.
site | The CDDB site structure. | |
address | The address of the server. | |
port | The port of the server. |
cddb_error_t cddb_site_set_description | ( | cddb_site_t * | site, | |
const char * | desc | |||
) |
Set a description for the site.
A copy of the description string is made. So the caller should free any memory associated with the input parameter.
site | The CDDB site structure. | |
desc | The description. A value of NULL deletes the current description. |
cddb_error_t cddb_site_set_location | ( | cddb_site_t * | site, | |
float | latitude, | |||
float | longitude | |||
) |
Set the site's location.
site | The CDDB site structure. | |
latitude | The server's latitude. Use a positive number for the northern hemisphere, a negative one for the southern hemisphere. | |
longitude | The server's longitude. Use a positive number for the eastern hemisphere, a negative one for the western hemisphere. |
cddb_error_t cddb_site_set_protocol | ( | cddb_site_t * | site, | |
cddb_protocol_t | proto | |||
) |
Set the protocol used by the site.
site | The CDDB site structure. | |
proto | The protocol. |
cddb_error_t cddb_site_set_query_path | ( | cddb_site_t * | site, | |
const char * | path | |||
) |
Set the query path in case the HTTP protocol is used.
A copy of the path string is made. So the caller should free any memory associated with the input parameter.
site | The CDDB site structure. | |
path | The query path. A value of NULL deletes the current path. |
cddb_error_t cddb_site_set_submit_path | ( | cddb_site_t * | site, | |
const char * | path | |||
) |
Set the submit path in case the HTTP protocol is used.
A copy of the path string is made. So the caller should free any memory associated with the input parameter.
site | The CDDB site structure. | |
path | The query path. A value of NULL deletes the current path. |