libmp3splt
src/freedb.c File Reference
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "splt.h"
#include "freedb.h"
Include dependency graph for freedb.c:

Go to the source code of this file.

Defines

#define closesocket   close

Functions

char * splt_freedb_get_file (splt_state *state, int i, int *error, int get_type, const char cddb_get_server[256], int port)
int splt_freedb_process_search (splt_state *state, char *search, int search_type, const char search_server[256], int port)

Detailed Description

All functions that are needed in order to do a Freedb search.

Don't use these functions directly. The version of these functions that is meant to be used directly are all in mp3splt.c.

Definition in file freedb.c.


Function Documentation

char* splt_freedb_get_file ( splt_state state,
int  i,
int *  error,
int  get_type,
const char  cddb_get_server[256],
int  port 
)

must only be called after process_freedb_search

returns the cddb file content corresponding to the last search, for the disc_id i (parameter of the function)

Parameters:
stateThe central structure that keeps all data this library uses
errorIs set to the error code this action results in
disc_idThe freedb disc ID.
cddb_get_typespecifies the type of the get: it can be SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI (that works for both freedb and freedb2 at the moment - 18_10_06) or SPLT_FREEDB_GET_FILE_TYPE_CDDB (that only work for freedb at the moment - 18_10_06)
Todo:
see when we don't have a valid port or get_type

Definition at line 593 of file freedb.c.

References SPLT_FALSE, and SPLT_TRUE.

Referenced by mp3splt_write_freedb_file_result().

Here is the caller graph for this function:

int splt_freedb_process_search ( splt_state state,
char *  search,
int  search_type,
const char  search_server[256],
int  port 
)

search the freedb according to "search"

Parameters:
stateThe central structure this library keeps all its data in
search_stringThe string that is to be searched for
errorThe error code this action returns in
search_typethe type of the search. Can be ert to SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI
search_serverThe URL of the search server or NULL to select the default which currently means freedb2.org
portThe port on the server. -1 means default (Which should be 80).

Definition at line 308 of file freedb.c.

References SPLT_FALSE, SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI, SPLT_MAXCD, and SPLT_TRUE.

Referenced by mp3splt_get_freedb_search().

Here is the caller graph for this function: