module Bindings.Libcddb.CddbConn where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Bindings.Libcddb.CddbDisc
import Bindings.Libcddb.CddbError
import Bindings.Libcddb.CddbSite
foreign import ccall "inline_SEARCHCAT" c'SEARCHCAT
:: C'cddb_cat_t -> C'cddb_cat_t
type C'cddb_iconv_t = CUInt
data C'cddb_conn_t = C'cddb_conn_t
type C'cddb_cache_mode_t = CUInt
c'CACHE_OFF = 0
c'CACHE_OFF :: (Num a) => a
c'CACHE_ON = 1
c'CACHE_ON :: (Num a) => a
c'CACHE_ONLY = 2
c'CACHE_ONLY :: (Num a) => a
type C'cddb_search_t = CInt
c'SEARCH_NONE = 0
c'SEARCH_NONE :: (Num a) => a
c'SEARCH_ARTIST = 1
c'SEARCH_ARTIST :: (Num a) => a
c'SEARCH_TITLE = 2
c'SEARCH_TITLE :: (Num a) => a
c'SEARCH_TRACK = 4
c'SEARCH_TRACK :: (Num a) => a
c'SEARCH_OTHER = 8
c'SEARCH_OTHER :: (Num a) => a
c'SEARCH_ALL = 1
c'SEARCH_ALL :: (Num a) => a
foreign import ccall "cddb_new" c'cddb_new
:: IO (Ptr C'cddb_conn_t)
foreign import ccall "&cddb_new" p'cddb_new
:: FunPtr (IO (Ptr C'cddb_conn_t))
foreign import ccall "cddb_destroy" c'cddb_destroy
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_destroy" p'cddb_destroy
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_set_charset" c'cddb_set_charset
:: Ptr C'cddb_conn_t -> CString -> IO CInt
foreign import ccall "&cddb_set_charset" p'cddb_set_charset
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO CInt)
foreign import ccall "cddb_set_buf_size" c'cddb_set_buf_size
:: Ptr C'cddb_conn_t -> CUInt -> IO ()
foreign import ccall "&cddb_set_buf_size" p'cddb_set_buf_size
:: FunPtr (Ptr C'cddb_conn_t -> CUInt -> IO ())
foreign import ccall "cddb_set_site" c'cddb_set_site
:: Ptr C'cddb_conn_t -> Ptr C'cddb_site_t -> IO C'cddb_error_t
foreign import ccall "&cddb_set_site" p'cddb_set_site
:: FunPtr (Ptr C'cddb_conn_t -> Ptr C'cddb_site_t -> IO C'cddb_error_t)
foreign import ccall "cddb_get_server_name" c'cddb_get_server_name
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_server_name" p'cddb_get_server_name
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_server_name" c'cddb_set_server_name
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_server_name" p'cddb_set_server_name
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_get_server_port" c'cddb_get_server_port
:: Ptr C'cddb_conn_t -> IO CUInt
foreign import ccall "&cddb_get_server_port" p'cddb_get_server_port
:: FunPtr (Ptr C'cddb_conn_t -> IO CUInt)
foreign import ccall "cddb_set_server_port" c'cddb_set_server_port
:: Ptr C'cddb_conn_t -> CInt -> IO ()
foreign import ccall "&cddb_set_server_port" p'cddb_set_server_port
:: FunPtr (Ptr C'cddb_conn_t -> CInt -> IO ())
foreign import ccall "cddb_get_timeout" c'cddb_get_timeout
:: Ptr C'cddb_conn_t -> IO CUInt
foreign import ccall "&cddb_get_timeout" p'cddb_get_timeout
:: FunPtr (Ptr C'cddb_conn_t -> IO CUInt)
foreign import ccall "cddb_set_timeout" c'cddb_set_timeout
:: Ptr C'cddb_conn_t -> CUInt -> IO ()
foreign import ccall "&cddb_set_timeout" p'cddb_set_timeout
:: FunPtr (Ptr C'cddb_conn_t -> CUInt -> IO ())
foreign import ccall "cddb_get_http_path_query" c'cddb_get_http_path_query
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_http_path_query" p'cddb_get_http_path_query
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_http_path_query" c'cddb_set_http_path_query
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_http_path_query" p'cddb_set_http_path_query
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_get_http_path_submit" c'cddb_get_http_path_submit
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_http_path_submit" p'cddb_get_http_path_submit
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_http_path_submit" c'cddb_set_http_path_submit
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_http_path_submit" p'cddb_set_http_path_submit
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_is_http_enabled" c'cddb_is_http_enabled
:: Ptr C'cddb_conn_t -> IO CUInt
foreign import ccall "&cddb_is_http_enabled" p'cddb_is_http_enabled
:: FunPtr (Ptr C'cddb_conn_t -> IO CUInt)
foreign import ccall "cddb_http_enable" c'cddb_http_enable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_http_enable" p'cddb_http_enable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_http_disable" c'cddb_http_disable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_http_disable" p'cddb_http_disable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_is_http_proxy_enabled" c'cddb_is_http_proxy_enabled
:: Ptr C'cddb_conn_t -> IO CUInt
foreign import ccall "&cddb_is_http_proxy_enabled" p'cddb_is_http_proxy_enabled
:: FunPtr (Ptr C'cddb_conn_t -> IO CUInt)
foreign import ccall "cddb_http_proxy_enable" c'cddb_http_proxy_enable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_http_proxy_enable" p'cddb_http_proxy_enable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_http_proxy_disable" c'cddb_http_proxy_disable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_http_proxy_disable" p'cddb_http_proxy_disable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_get_http_proxy_server_name" c'cddb_get_http_proxy_server_name
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_http_proxy_server_name" p'cddb_get_http_proxy_server_name
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_http_proxy_server_name" c'cddb_set_http_proxy_server_name
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_http_proxy_server_name" p'cddb_set_http_proxy_server_name
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_get_http_proxy_server_port" c'cddb_get_http_proxy_server_port
:: Ptr C'cddb_conn_t -> IO CUInt
foreign import ccall "&cddb_get_http_proxy_server_port" p'cddb_get_http_proxy_server_port
:: FunPtr (Ptr C'cddb_conn_t -> IO CUInt)
foreign import ccall "cddb_set_http_proxy_server_port" c'cddb_set_http_proxy_server_port
:: Ptr C'cddb_conn_t -> CInt -> IO ()
foreign import ccall "&cddb_set_http_proxy_server_port" p'cddb_set_http_proxy_server_port
:: FunPtr (Ptr C'cddb_conn_t -> CInt -> IO ())
foreign import ccall "cddb_set_http_proxy_username" c'cddb_set_http_proxy_username
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_http_proxy_username" p'cddb_set_http_proxy_username
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_get_http_proxy_username" c'cddb_get_http_proxy_username
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_http_proxy_username" p'cddb_get_http_proxy_username
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_http_proxy_password" c'cddb_set_http_proxy_password
:: Ptr C'cddb_conn_t -> CString -> IO ()
foreign import ccall "&cddb_set_http_proxy_password" p'cddb_set_http_proxy_password
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO ())
foreign import ccall "cddb_get_http_proxy_password" c'cddb_get_http_proxy_password
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_get_http_proxy_password" p'cddb_get_http_proxy_password
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_set_http_proxy_credentials" c'cddb_set_http_proxy_credentials
:: Ptr C'cddb_conn_t -> CString -> CString -> IO ()
foreign import ccall "&cddb_set_http_proxy_credentials" p'cddb_set_http_proxy_credentials
:: FunPtr (Ptr C'cddb_conn_t -> CString -> CString -> IO ())
foreign import ccall "cddb_errno" c'cddb_errno
:: Ptr C'cddb_conn_t -> IO C'cddb_error_t
foreign import ccall "&cddb_errno" p'cddb_errno
:: FunPtr (Ptr C'cddb_conn_t -> IO C'cddb_error_t)
foreign import ccall "cddb_set_client" c'cddb_set_client
:: Ptr C'cddb_conn_t -> CString -> CString -> IO ()
foreign import ccall "&cddb_set_client" p'cddb_set_client
:: FunPtr (Ptr C'cddb_conn_t -> CString -> CString -> IO ())
foreign import ccall "cddb_set_email_address" c'cddb_set_email_address
:: Ptr C'cddb_conn_t -> CString -> IO CInt
foreign import ccall "&cddb_set_email_address" p'cddb_set_email_address
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO CInt)
foreign import ccall "cddb_cache_mode" c'cddb_cache_mode
:: Ptr C'cddb_conn_t -> IO C'cddb_cache_mode_t
foreign import ccall "&cddb_cache_mode" p'cddb_cache_mode
:: FunPtr (Ptr C'cddb_conn_t -> IO C'cddb_cache_mode_t)
foreign import ccall "cddb_cache_enable" c'cddb_cache_enable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_cache_enable" p'cddb_cache_enable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_cache_only" c'cddb_cache_only
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_cache_only" p'cddb_cache_only
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_cache_disable" c'cddb_cache_disable
:: Ptr C'cddb_conn_t -> IO ()
foreign import ccall "&cddb_cache_disable" p'cddb_cache_disable
:: FunPtr (Ptr C'cddb_conn_t -> IO ())
foreign import ccall "cddb_cache_get_dir" c'cddb_cache_get_dir
:: Ptr C'cddb_conn_t -> IO CString
foreign import ccall "&cddb_cache_get_dir" p'cddb_cache_get_dir
:: FunPtr (Ptr C'cddb_conn_t -> IO CString)
foreign import ccall "cddb_cache_set_dir" c'cddb_cache_set_dir
:: Ptr C'cddb_conn_t -> CString -> IO CInt
foreign import ccall "&cddb_cache_set_dir" p'cddb_cache_set_dir
:: FunPtr (Ptr C'cddb_conn_t -> CString -> IO CInt)
foreign import ccall "cddb_first_site" c'cddb_first_site
:: Ptr C'cddb_conn_t -> IO (Ptr C'cddb_site_t)
foreign import ccall "&cddb_first_site" p'cddb_first_site
:: FunPtr (Ptr C'cddb_conn_t -> IO (Ptr C'cddb_site_t))
foreign import ccall "cddb_next_site" c'cddb_next_site
:: Ptr C'cddb_conn_t -> IO (Ptr C'cddb_site_t)
foreign import ccall "&cddb_next_site" p'cddb_next_site
:: FunPtr (Ptr C'cddb_conn_t -> IO (Ptr C'cddb_site_t))
foreign import ccall "cddb_search_set_fields" c'cddb_search_set_fields
:: Ptr C'cddb_conn_t -> CUInt -> IO ()
foreign import ccall "&cddb_search_set_fields" p'cddb_search_set_fields
:: FunPtr (Ptr C'cddb_conn_t -> CUInt -> IO ())
foreign import ccall "cddb_search_set_categories" c'cddb_search_set_categories
:: Ptr C'cddb_conn_t -> CUInt -> IO ()
foreign import ccall "&cddb_search_set_categories" p'cddb_search_set_categories
:: FunPtr (Ptr C'cddb_conn_t -> CUInt -> IO ())