cddb_conn.h

Go to the documentation of this file.
00001 /*
00002     $Id: cddb_conn.h,v 1.30 2005/08/03 18:25:01 airborne Exp $
00003 
00004     Copyright (C) 2003, 2004, 2005 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 #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 
00060 typedef enum {
00061     SEARCH_NONE = 0,            
00062     SEARCH_ARTIST = 1,          
00063     SEARCH_TITLE = 2,           
00064     SEARCH_TRACK = 4,           
00065     SEARCH_OTHER = 8,           
00066     SEARCH_ALL = ~0,            
00067 } cddb_search_t;
00068 
00073 #define SEARCHCAT(c) (1 << (c))
00074 
00075 
00076 /* --- construction / destruction --- */
00077 
00078 
00087 cddb_conn_t *cddb_new(void);
00088 
00093 void cddb_destroy(cddb_conn_t *c);
00094 
00095 
00096 /* --- getters & setters --- */
00097 
00098 
00110 int cddb_set_charset(cddb_conn_t *c, const char *cs);
00111 
00118 void cddb_set_buf_size(cddb_conn_t *c, unsigned int size);
00119 
00133 cddb_error_t cddb_set_site(cddb_conn_t *c, const cddb_site_t *site);
00134 
00143 const char *cddb_get_server_name(const cddb_conn_t *c);
00144 
00154 void cddb_set_server_name(cddb_conn_t *c, const char *server);
00155 
00164 unsigned int cddb_get_server_port(const cddb_conn_t *c);
00165 
00174 void cddb_set_server_port(cddb_conn_t *c, int port);
00175 
00184 unsigned int cddb_get_timeout(const cddb_conn_t *c);
00185 
00195 void cddb_set_timeout(cddb_conn_t *c, unsigned int t);
00196 
00205 const char *cddb_get_http_path_query(const cddb_conn_t *c);
00206 
00216 void cddb_set_http_path_query(cddb_conn_t *c, const char *path);
00217 
00226 const char *cddb_get_http_path_submit(const cddb_conn_t *c);
00227 
00237 void cddb_set_http_path_submit(cddb_conn_t *c, const char *path);
00238 
00249 unsigned int cddb_is_http_enabled(const cddb_conn_t *c);
00250 
00260 void cddb_http_enable(cddb_conn_t *c);
00261 
00271 void cddb_http_disable(cddb_conn_t *c);
00272 
00285 unsigned int cddb_is_http_proxy_enabled(const cddb_conn_t *c);
00286 
00298 void cddb_http_proxy_enable(cddb_conn_t *c);
00299 
00309 void cddb_http_proxy_disable(cddb_conn_t *c);
00310 
00319 const char *cddb_get_http_proxy_server_name(const cddb_conn_t *c);
00320 
00330 void cddb_set_http_proxy_server_name(cddb_conn_t *c, const char *server);
00331 
00340 unsigned int cddb_get_http_proxy_server_port(const cddb_conn_t *c);
00341 
00350 void cddb_set_http_proxy_server_port(cddb_conn_t *c, int port);
00351 
00359 void cddb_set_http_proxy_username(cddb_conn_t* c, const char* username);
00360 
00367 const char *cddb_get_http_proxy_username(const cddb_conn_t *c);
00368 
00376 void cddb_set_http_proxy_password(cddb_conn_t* c, const char* passwd);
00377 
00384 const char *cddb_get_http_proxy_password(const cddb_conn_t *c);
00385 
00397 void cddb_set_http_proxy_credentials(cddb_conn_t* c,
00398                                      const char *username, const char* passwd);
00399 
00406 cddb_error_t cddb_errno(const cddb_conn_t *c);
00407 
00420 void cddb_set_client(cddb_conn_t *c, const char *cname, const char *cversion);
00421 
00430 int cddb_set_email_address(cddb_conn_t *c, const char *email);
00431 
00445 cddb_cache_mode_t cddb_cache_mode(const cddb_conn_t *c);
00446 
00458 void cddb_cache_enable(cddb_conn_t *c);
00459 
00471 void cddb_cache_only(cddb_conn_t *c);
00472 
00484 void cddb_cache_disable(cddb_conn_t *c);
00485 
00494 const char *cddb_cache_get_dir(const cddb_conn_t *c);
00495 
00508 int cddb_cache_set_dir(cddb_conn_t *c, const char *dir);
00509 
00516 const cddb_site_t *cddb_first_site(cddb_conn_t *c);
00517 
00524 const cddb_site_t *cddb_next_site(cddb_conn_t *c);
00525 
00534 void cddb_search_set_fields(cddb_conn_t *c, unsigned int fields);
00535 
00553 void cddb_search_set_categories(cddb_conn_t *c, unsigned int cats);
00554 
00555 
00556 #ifdef __cplusplus
00557     }
00558 #endif
00559 
00560 #endif /* CDDB_CONN_H */

Generated on Sun Oct 15 14:49:14 2006 for libcddb by  doxygen 1.4.6