00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef CDDB_CONN_H
00023 #define CDDB_CONN_H 1
00024
00025
#ifdef __cplusplus
00026
extern "C" {
00027
#endif
00028
00029
00030
#include <stdio.h>
00031
#include <netinet/in.h>
00032
00033
#include "cddb/cddb_site.h"
00034
00035
00036 typedef enum {
00037
CACHE_OFF = 0,
00039
CACHE_ON,
00040
CACHE_ONLY
00042 }
cddb_cache_mode_t;
00043
00048 typedef struct cddb_iconv_s *
cddb_iconv_t;
00049
00054 typedef struct cddb_conn_s
cddb_conn_t;
00055
00056
00057
00058
00059
00068
cddb_conn_t *
cddb_new(
void);
00069
00074
void cddb_destroy(cddb_conn_t *c);
00075
00076
00077
00078
00079
00091
int cddb_set_charset(cddb_conn_t *c,
const char *cs);
00092
00099
void cddb_set_buf_size(cddb_conn_t *c,
unsigned int size);
00100
00114
cddb_error_t cddb_set_site(cddb_conn_t *c,
const cddb_site_t *site);
00115
00124
const char *
cddb_get_server_name(
const cddb_conn_t *c);
00125
00135
void cddb_set_server_name(cddb_conn_t *c,
const char *server);
00136
00145
unsigned int cddb_get_server_port(
const cddb_conn_t *c);
00146
00155
void cddb_set_server_port(cddb_conn_t *c,
int port);
00156
00165
unsigned int cddb_get_timeout(
const cddb_conn_t *c);
00166
00176
void cddb_set_timeout(cddb_conn_t *c,
unsigned int t);
00177
00186
const char *
cddb_get_http_path_query(
const cddb_conn_t *c);
00187
00197
void cddb_set_http_path_query(cddb_conn_t *c,
const char *path);
00198
00207
const char *
cddb_get_http_path_submit(
const cddb_conn_t *c);
00208
00218
void cddb_set_http_path_submit(cddb_conn_t *c,
const char *path);
00219
00230
unsigned int cddb_is_http_enabled(
const cddb_conn_t *c);
00231
00241
void cddb_http_enable(cddb_conn_t *c);
00242
00252
void cddb_http_disable(cddb_conn_t *c);
00253
00266
unsigned int cddb_is_http_proxy_enabled(
const cddb_conn_t *c);
00267
00279
void cddb_http_proxy_enable(cddb_conn_t *c);
00280
00290
void cddb_http_proxy_disable(cddb_conn_t *c);
00291
00300
const char *
cddb_get_http_proxy_server_name(
const cddb_conn_t *c);
00301
00311
void cddb_set_http_proxy_server_name(cddb_conn_t *c,
const char *server);
00312
00321
unsigned int cddb_get_http_proxy_server_port(
const cddb_conn_t *c);
00322
00331
void cddb_set_http_proxy_server_port(cddb_conn_t *c,
int port);
00332
00340
void cddb_set_http_proxy_username(cddb_conn_t* c,
const char* username);
00341
00348
const char *
cddb_get_http_proxy_username(
const cddb_conn_t *c);
00349
00357
void cddb_set_http_proxy_password(cddb_conn_t* c,
const char* passwd);
00358
00365
const char *
cddb_get_http_proxy_password(
const cddb_conn_t *c);
00366
00378
void cddb_set_http_proxy_credentials(cddb_conn_t* c,
00379
const char *username,
const char* passwd);
00380
00387
cddb_error_t cddb_errno(
const cddb_conn_t *c);
00388
00401
void cddb_set_client(cddb_conn_t *c,
const char *cname,
const char *cversion);
00402
00411
int cddb_set_email_address(cddb_conn_t *c,
const char *email);
00412
00426
cddb_cache_mode_t cddb_cache_mode(
const cddb_conn_t *c);
00427
00439
void cddb_cache_enable(cddb_conn_t *c);
00440
00452
void cddb_cache_only(cddb_conn_t *c);
00453
00465
void cddb_cache_disable(cddb_conn_t *c);
00466
00475
const char *
cddb_cache_get_dir(
const cddb_conn_t *c);
00476
00489
int cddb_cache_set_dir(cddb_conn_t *c,
const char *dir);
00490
00497
const cddb_site_t *
cddb_first_site(cddb_conn_t *c);
00498
00505
const cddb_site_t *
cddb_next_site(cddb_conn_t *c);
00506
00507
00508
#ifdef __cplusplus
00509
}
00510
#endif
00511
00512
#endif