#include <stdio.h>
#include <netinet/in.h>
#include "cddb/cddb_site.h"
Go to the source code of this file.
Defines | |
#define | CDDB_CONN_H 1 |
#define | SEARCHCAT(c) (1 << (c)) |
Macro to be used for building the category search bit-string from the values of cddb_cat_t. | |
Typedefs | |
typedef cddb_iconv_s * | cddb_iconv_t |
Forward declaration of opaque structure used for character set conversions. | |
typedef cddb_conn_s | cddb_conn_t |
An opaque structure for keeping state about the connection to a CDDB server. | |
Enumerations | |
enum | cddb_cache_mode_t { CACHE_OFF = 0, CACHE_ON, CACHE_ONLY } |
enum | cddb_search_t { SEARCH_NONE = 0, SEARCH_ARTIST = 1, SEARCH_TITLE = 2, SEARCH_TRACK = 4, SEARCH_OTHER = 8, SEARCH_ALL = ~0 } |
Which fields to use for the full text search is defined by one or more of the constants below. More... | |
Functions | |
cddb_conn_t * | cddb_new (void) |
Creates a new CDDB connection structure. | |
void | cddb_destroy (cddb_conn_t *c) |
Free all resources associated with the given CDDB connection structure. | |
int | cddb_set_charset (cddb_conn_t *c, const char *cs) |
Set the character set. | |
void | cddb_set_buf_size (cddb_conn_t *c, unsigned int size) |
Change the size of the internal buffer. | |
cddb_error_t | cddb_set_site (cddb_conn_t *c, const cddb_site_t *site) |
Set all server details in one go through the use of a site structure. | |
const char * | cddb_get_server_name (const cddb_conn_t *c) |
Get the host name of the CDDB server that is currently being used. | |
void | cddb_set_server_name (cddb_conn_t *c, const char *server) |
Set the host name of the CDDB server. | |
unsigned int | cddb_get_server_port (const cddb_conn_t *c) |
Get the port of the CDDB server that is currently being used. | |
void | cddb_set_server_port (cddb_conn_t *c, int port) |
Set the port of the CDDB server. | |
unsigned int | cddb_get_timeout (const cddb_conn_t *c) |
Get the network time out value (in seconds). | |
void | cddb_set_timeout (cddb_conn_t *c, unsigned int t) |
Set the network time out value (in seconds). | |
const char * | cddb_get_http_path_query (const cddb_conn_t *c) |
Get the URL path for querying a CDDB server through HTTP. | |
void | cddb_set_http_path_query (cddb_conn_t *c, const char *path) |
Set the URL path for querying a CDDB server through HTTP. | |
const char * | cddb_get_http_path_submit (const cddb_conn_t *c) |
Get the URL path for submitting to a CDDB server through HTTP. | |
void | cddb_set_http_path_submit (cddb_conn_t *c, const char *path) |
Set the URL path for submitting to a CDDB server through HTTP. | |
unsigned int | cddb_is_http_enabled (const cddb_conn_t *c) |
Returns true if the HTTP protocol is currently enabled and false if CDDBP is enabled. | |
void | cddb_http_enable (cddb_conn_t *c) |
Enable HTTP tunneling to connect to the CDDB server. | |
void | cddb_http_disable (cddb_conn_t *c) |
Disable HTTP tunneling to connect to the CDDB server. | |
unsigned int | cddb_is_http_proxy_enabled (const cddb_conn_t *c) |
Returns true if the proxy support is currently enabled and false if it is not. | |
void | cddb_http_proxy_enable (cddb_conn_t *c) |
Enable HTTP tunneling through an HTTP proxy server to connect to the CDDB server. | |
void | cddb_http_proxy_disable (cddb_conn_t *c) |
Disable HTTP tunneling through an HTTP proxy server to connect to the CDDB server. | |
const char * | cddb_get_http_proxy_server_name (const cddb_conn_t *c) |
Get the host name of the HTTP proxy server. | |
void | cddb_set_http_proxy_server_name (cddb_conn_t *c, const char *server) |
Set the host name of the HTTP proxy server. | |
unsigned int | cddb_get_http_proxy_server_port (const cddb_conn_t *c) |
Get the port of the HTTP proxy server. | |
void | cddb_set_http_proxy_server_port (cddb_conn_t *c, int port) |
Set the port of the HTTP proxy server. | |
void | cddb_set_http_proxy_username (cddb_conn_t *c, const char *username) |
Set the HTTP proxy user name which is used when Basic Authentication is required. | |
const char * | cddb_get_http_proxy_username (const cddb_conn_t *c) |
Get the HTTP proxy user name. | |
void | cddb_set_http_proxy_password (cddb_conn_t *c, const char *passwd) |
Set the HTTP proxy password which is used when Basic Authentication is required. | |
const char * | cddb_get_http_proxy_password (const cddb_conn_t *c) |
Get the HTTP proxy password. | |
void | cddb_set_http_proxy_credentials (cddb_conn_t *c, const char *username, const char *passwd) |
Set the HTTP proxy user name and password in one go. | |
cddb_error_t | cddb_errno (const cddb_conn_t *c) |
Get the error number returned by the last libcddb command. | |
void | cddb_set_client (cddb_conn_t *c, const char *cname, const char *cversion) |
Set the name and version of the client program overwriting the previous values. | |
int | cddb_set_email_address (cddb_conn_t *c, const char *email) |
Sets the user name and host name of the local machine. | |
cddb_cache_mode_t | cddb_cache_mode (const cddb_conn_t *c) |
Returns the current cache mode. | |
void | cddb_cache_enable (cddb_conn_t *c) |
Enable caching of CDDB entries locally. | |
void | cddb_cache_only (cddb_conn_t *c) |
Only use the local CDDB cache. | |
void | cddb_cache_disable (cddb_conn_t *c) |
Disable caching of CDDB entries locally. | |
const char * | cddb_cache_get_dir (const cddb_conn_t *c) |
Return the directory currently being used for caching. | |
int | cddb_cache_set_dir (cddb_conn_t *c, const char *dir) |
Change the directory used for caching CDDB entries locally. | |
const cddb_site_t * | cddb_first_site (cddb_conn_t *c) |
Retrieve the first CDDB mirror site. | |
const cddb_site_t * | cddb_next_site (cddb_conn_t *c) |
Retrieve the next CDDB mirror site. | |
void | cddb_search_set_fields (cddb_conn_t *c, unsigned int fields) |
Set the bit-string specifying which fields to examine when performing a text search. | |
void | cddb_search_set_categories (cddb_conn_t *c, unsigned int cats) |
Set the bit-string specifying which categories to examine when performing a text search. |
|
|
|
Macro to be used for building the category search bit-string from the values of cddb_cat_t.
|
|
An opaque structure for keeping state about the connection to a CDDB server.
|
|
Forward declaration of opaque structure used for character set conversions.
|
|
|
|
Which fields to use for the full text search is defined by one or more of the constants below.
|
|
Disable caching of CDDB entries locally. All data will be fetched from a CDDB server everytime and the retrieved data will not be cached locally.
|
|
Enable caching of CDDB entries locally. Caching is enabled by default. The cache directory can be changed with the cddb_cache_set_dir function.
|
|
Return the directory currently being used for caching.
|
|
Returns the current cache mode. This can be either on, off or cache only.
|
|
Only use the local CDDB cache. Never contact a server to retrieve any data. The cache directory can be changed with the cddb_cache_set_dir function.
|
|
Change the directory used for caching CDDB entries locally. The default location of the cached entries is a subdirectory (.cddbslave) of the user's home directory. If the first character of the directory is '~', then it will be expanded to the contents of $HOME.
|
|
Free all resources associated with the given CDDB connection structure.
|
|
Get the error number returned by the last libcddb command.
|
|
Retrieve the first CDDB mirror site.
|
|
Get the URL path for querying a CDDB server through HTTP.
|
|
Get the URL path for submitting to a CDDB server through HTTP.
|
|
Get the HTTP proxy password.
|
|
Get the host name of the HTTP proxy server.
|
|
Get the port of the HTTP proxy server.
|
|
Get the HTTP proxy user name.
|
|
Get the host name of the CDDB server that is currently being used.
|
|
Get the port of the CDDB server that is currently being used.
|
|
Get the network time out value (in seconds).
|
|
Disable HTTP tunneling to connect to the CDDB server. By default this option is disabled.
|
|
Enable HTTP tunneling to connect to the CDDB server. By default this option is disabled.
|
|
Disable HTTP tunneling through an HTTP proxy server to connect to the CDDB server. By default this option is disabled.
|
|
Enable HTTP tunneling through an HTTP proxy server to connect to the CDDB server. The usage of an HTTP proxy implies normal HTTP tunneling instead of connecting directly to the CDDB server. By default this option is disabled.
|
|
Returns true if the HTTP protocol is currently enabled and false if CDDBP is enabled.
|
|
Returns true if the proxy support is currently enabled and false if it is not. This fucntion does not check whether HTTP is enabled. So it is possible that true will be returned while in reality the CDDBP protocol is being used (no proxy support).
|
|
Creates a new CDDB connection structure. This structure will have to be passed to all libcddb functions. Default values will be used for the connection parameters allowing it to contact the CDDB server at freedb.org.
|
|
Retrieve the next CDDB mirror site.
|
|
Set the bit-string specifying which categories to examine when performing a text search. The SEARCHCAT macro needs to be used to build the actual bit-string from individual categories. The cddb_search_t values SEARCH_NONE and SEARCH_ALL are also valid. The example below shows some possible combinations. By default all categories are searched.
unsigned int cats = SEARCHCAT(CDDB_CAT_ROCK) | SEARCHCAT(CDDB_CAT_MISC); unsigned int cats = SEARCH_ALL; unsigned int cats = SEARCH_NONE;
|
|
Set the bit-string specifying which fields to examine when performing a text search. By default only the artist and disc title fields are searched.
|
|
Change the size of the internal buffer.
|
|
Set the character set. By default the FreeDB server uses UTF-8 when providing CD data. When a character set is defined with this function any strings retrieved from or sent to the server will automatically be converted.
|
|
Set the name and version of the client program overwriting the previous values. This function will make a copy of the provided strings. The defaults are 'libcddb' and the version number of the libcddb library in use. Both parameters must be valid strings. If any of teh strings is NULL, this fucntion will return without changing anything.
|
|
Sets the user name and host name of the local machine. This function will parse out the user name and host name from the e-mail address.
|
|
Set the URL path for querying a CDDB server through HTTP. The default value is '/~cddb/cddb.cgi'.
|
|
Set the URL path for submitting to a CDDB server through HTTP. The default value is '/~cddb/submit.cgi'.
|
|
Set the HTTP proxy user name and password in one go. These credentials are used when Basic Authentication is required. The advantage of using this function over setting the user name and password seperately is that the cleartext user name and password are not kept in memory longer than needed.
|
|
Set the HTTP proxy password which is used when Basic Authentication is required.
|
|
Set the host name of the HTTP proxy server. There is no default value.
|
|
Set the port of the HTTP proxy server. The default value is 8080.
|
|
Set the HTTP proxy user name which is used when Basic Authentication is required.
|
|
Set the host name of the CDDB server. The default value for the server is 'freedb.org'.
|
|
Set the port of the CDDB server. The default value is 888.
|
|
Set all server details in one go through the use of a site structure. This function initializzes the server address, port, protocol and query path in case of HTTP.
|
|
Set the network time out value (in seconds). The default is 10 seconds.
|