cddb_conn.h
Go to the documentation of this file.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 #define CACHE_OFF 0
00035 #define CACHE_ON 1
00036 #define CACHE_ONLY 2
00043 typedef struct cddb_conn_s
00044
{
00045 unsigned int buf_size;
00047 char *line;
00049 int is_connected;
00050 struct sockaddr_in sa;
00052 int socket;
00053 char *server_name;
00055 int server_port;
00057 int timeout;
00061 char *http_path_query;
00064 char *http_path_submit;
00067 int is_http_enabled;
00069 int is_http_proxy_enabled;
00071 char *http_proxy_server;
00072 int http_proxy_server_port;
00075 FILE *cache_fp;
00077 int use_cache;
00079 char *cache_dir;
00081 int cache_read;
00084 char *cname;
00086 char *cversion;
00088 char *user;
00091 char *hostname;
00095 cddb_error_t errnum;
00097 cddb_disc_t **query_data;
00098 int query_idx;
00099 int query_cnt;
00100 }
cddb_conn_t;
00101
00102
00103
00104
00105
00114
cddb_conn_t *
cddb_new(
void);
00115
00120
void cddb_destroy(
cddb_conn_t *c);
00121
00122
00123
00124
00125
00132
void cddb_set_buf_size(
cddb_conn_t *c,
unsigned int size);
00133
00142 #define cddb_get_server_name(c) (c)->server_name
00143
00153
void cddb_set_server_name(
cddb_conn_t *c,
const char *server);
00154
00163 #define cddb_get_server_port(c) (c)->server_port
00164
00173
void cddb_set_server_port(
cddb_conn_t *c,
int port);
00174
00183 #define cddb_get_timeout(c) (c)->timeout
00184
00194 #define cddb_set_timeout(c, t) (c)->timeout = t
00195
00204 #define cddb_get_http_path_query(c) (c)->http_path_query
00205
00215
void cddb_set_http_path_query(
cddb_conn_t *c,
const char *path);
00216
00225 #define cddb_get_http_path_submit(c) (c)->http_path_submit
00226
00236
void cddb_set_http_path_submit(
cddb_conn_t *c,
const char *path);
00237
00248 #define cddb_is_http_enabled(c) (c)->is_http_enabled
00249
00259
void cddb_http_enable(
cddb_conn_t *c);
00260
00270
void cddb_http_disable(
cddb_conn_t *c);
00271
00284 #define cddb_is_http_proxy_enabled(c) (c)->is_http_proxy_enabled
00285
00297
void cddb_http_proxy_enable(
cddb_conn_t *c);
00298
00308
void cddb_http_proxy_disable(
cddb_conn_t *c);
00309
00318 #define cddb_get_http_proxy_server_name(c) (c)->http_proxy_server
00319
00329
void cddb_set_http_proxy_server_name(
cddb_conn_t *c,
const char *server);
00330
00339 #define cddb_get_http_proxy_server_port(c) (c)->http_proxy_server_port
00340
00349
void cddb_set_http_proxy_server_port(
cddb_conn_t *c,
int port);
00350
00357 #define cddb_errno(c) (c)->errnum
00358
00371
void cddb_set_client(
cddb_conn_t *c,
const char *cname,
const char *cversion);
00372
00381
int cddb_set_email_address(
cddb_conn_t *c,
const char *email);
00382
00396 #define cddb_cache_mode(c) (c)->use_cache
00397
00409 #define cddb_cache_enable(c) (c)->use_cache = CACHE_ON
00410
00422 #define cddb_cache_only(c) (c)->use_cache = CACHE_ONLY
00423
00435 #define cddb_cache_disable(c) (c)->use_cache = CACHE_OFF
00436
00445 #define cddb_cache_get_dir(c) (c)->cache_dir;
00446
00459
int cddb_cache_set_dir(
cddb_conn_t *c,
const char *dir);
00460
00461
00462
#ifdef __cplusplus
00463
}
00464
#endif
00465
00466
#endif
Generated on Wed Jul 21 18:56:32 2004 for libcddb by
1.3.7