Main Page | Class List | File List | Class Members | File Members

cddb_conn.h

Go to the documentation of this file.
00001 /* 00002 $Id: cddb_conn.h,v 1.20 2004/07/21 16:12:31 airborne Exp $ 00003 00004 Copyright (C) 2003, 2004 Kris Verbeeck <airborne@advalvas.be> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the 00018 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 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 /* --- construction / destruction --- */ 00104 00105 00114 cddb_conn_t *cddb_new(void); 00115 00120 void cddb_destroy(cddb_conn_t *c); 00121 00122 00123 /* --- getters & setters --- */ 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 /* CDDB_CONN_H */

Generated on Wed Jul 21 18:56:32 2004 for libcddb by doxygen 1.3.7