libmp3splt
src/freedb.h
00001 /**********************************************************
00002  *
00003  * libmp3splt -- library based on mp3splt,
00004  *               for mp3/ogg splitting without decoding
00005  *
00006  * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
00007  * Copyright (c) 2005-2011 Alexandru Munteanu - io_fx@yahoo.fr
00008  *
00009  * http://mp3splt.sourceforge.net
00010  *
00011  *********************************************************/
00012 
00013 /**********************************************************
00014  *
00015  * This program is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU General Public License
00017  * as published by the Free Software Foundation; either version 2
00018  * of the License, or (at your option) any later version.
00019  *
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00028  * 02111-1307,
00029  * USA.
00030  *
00031  *********************************************************/
00032 
00033 #ifndef FREEDB_H
00034 
00035 //structure for the socket connection
00036 typedef struct {
00037   short proxy;
00038   char hostname[512];
00039   int port;
00040   char *auth;
00041 } splt_addr;
00042 
00043 int splt_freedb_process_search(splt_state *state, char *search, 
00044     int search_type, const char *cddb_get_server,
00045     int port);
00046 char *splt_freedb_get_file(splt_state *state, int i, int *error,
00047     int get_type, const char *cddb_get_server, int port);
00048 
00049 //global freedb, ports and buffersize
00050 #define SPLT_FREEDB_BUFFERSIZE 8192
00051 
00052 #define SPLT_FREEDB2_SITE "tracktype.org"
00053 #define SPLT_FREEDB_SITE "freedb.org"
00054 
00055 //cddb protocol
00056 #define SPLT_FREEDB_HELLO "CDDB HELLO nouser mp3splt.sf.net "SPLT_PACKAGE_NAME" "SPLT_PACKAGE_VERSION"\n"
00057 #define SPLT_FREEDB_GET_FILE "CDDB READ %s %s\n"
00058 
00059 //cddb.cgi
00060 #define SPLT_HTTP_VERSION_AND_HOST "HTTP/1.0\r\nHost: %s\r\n\r\n"
00061 #define SPLT_FREEDB_HELLO_PROTO "&hello=nouser+mp3splt.sf.net+"SPLT_PACKAGE_NAME"+"SPLT_PACKAGE_VERSION"&proto=5"
00062 
00063 #define SPLT_GET_SUFFIX SPLT_FREEDB_HELLO_PROTO" "SPLT_HTTP_VERSION_AND_HOST
00064 
00065 #define SPLT_FREEDB2_SEARCH "GET %s?cmd=cddb+album+%s"SPLT_GET_SUFFIX
00066 #define SPLT_FREEDB_CDDB_CGI_GET_FILE "GET %s?cmd=cddb+read+%s+%s"SPLT_GET_SUFFIX
00067 
00068 //proxy stuff
00069 //#define PROXYCONFIG ".mp3splt"
00070 //#define PROXYDLG "HTTP/1.0\nUserAgent: "PACKAGE_NAME"/"PACKAGE_VERSION"\n"
00071 //#define SPLT_AUTH "Proxy-Authorization: Basic "
00072 
00073 #define FREEDB_H
00074 
00075 #endif
00076