libcoverart: caa_c.h Source File

libcoverart 1.0.0

Loading...
Searching...
No Matches
caa_c.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------------
2
3 libcoverart - Client library to access MusicBrainz
4
5 Copyright (C) 2012 Andrew Hawkins
6
7 This file is part of libcoverart.
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of v2 of the GNU Lesser General Public
11 License as published by the Free Software Foundation.
12
13 libcoverart is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this library. If not, see <http://www.gnu.org/licenses/>.
20
21 THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT IT!
22
23----------------------------------------------------------------------------*/
24
25
26/*
27 Things you should delete using the appropriate caa_xxx_delete() function:
28
29 * The coverart object you create to do the actual work
30 * The releaseinfo object returned from the caa_coverart_releaseinfo() function
31 * Any image data returned from the caa_fetch_xxx functions
32 * The return from any caa_xxx_clone() function
33
34 Everything else remains managed by the library, and should not be deleted
35
36 If in doubt, valgrind is a useful way to spot leaks or things being deleted
37 when they shouldn't be.
38
39*/
40
41#ifndef _COVERART_MB_C_H
42#define _COVERART_MB_C_H
43
44#include "coverart/defines.h"
45
46#ifdef __cplusplus
47extern "C"
48{
49#endif
50
51 typedef void *CaaCoverArt;
52 typedef void *CaaImage;
53 typedef void *CaaReleaseInfo;
54 typedef void *CaaThumbnails;
55 typedef void *CaaType;
56 typedef void *CaaImageList;
57 typedef void *CaaTypeList;
58
64 void caa_coverart_delete(CaaCoverArt CoverArt);
65
74 CaaCoverArt caa_coverart_clone(CaaCoverArt CoverArt);
75
83 int caa_coverart_get_lasthttpcode(CaaCoverArt CoverArt);
84
94 int caa_coverart_get_lasterrormessage(CaaCoverArt CoverArt, char *str, int len);
95
105 int caa_coverart_get_version(CaaCoverArt CoverArt, char *str, int len);
106
107/* --------------------------------------------------------------------------
108
109 libcoverart - Client library to access MusicBrainz
110
111 Copyright (C) 2012 Andrew Hawkins
112
113 This file is part of libcoverart.
114
115 This library is free software; you can redistribute it and/or
116 modify it under the terms of v2 of the GNU Lesser General Public
117 License as published by the Free Software Foundation.
118
119 libcoverart is distributed in the hope that it will be useful,
120 but WITHOUT ANY WARRANTY; without even the implied warranty of
121 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
122 Lesser General Public License for more details.
123
124 You should have received a copy of the GNU General Public License
125 along with this library. If not, see <http://www.gnu.org/licenses/>.
126
127 $Id$
128
129----------------------------------------------------------------------------*/
130
131 typedef void *CaaImageData;
132
143
144 CaaCoverArt caa_coverart_new(const char *UserAgent);
145
154 void caa_coverart_set_proxyhost(CaaCoverArt CoverArt, const char *ProxyHost);
155
164 void caa_coverart_set_proxyport(CaaCoverArt CoverArt, int ProxyPort);
165
174 void caa_coverart_set_proxyusername(CaaCoverArt CoverArt, const char *ProxyUserName);
175
184 void caa_coverart_set_proxypassword(CaaCoverArt CoverArt, const char *ProxyPassword);
185
197 CaaImageData caa_coverart_fetch_front(CaaCoverArt CoverArt, const char *ReleaseID);
198
210 CaaImageData caa_coverart_fetch_back(CaaCoverArt CoverArt, const char *ReleaseID);
211
212 typedef enum
213 {
214 eSize_Full=0,
215 eSize_250=250,
216 eSize_500=500
217 } tImageSize;
218
232 CaaImageData caa_coverart_fetch_image(CaaCoverArt CoverArt, const char *ReleaseID, const char *ImageID, tImageSize ImageSize);
233
245 CaaReleaseInfo caa_coverart_releaseinfo(CaaCoverArt CoverArt, const char *ReleaseID);
246
250
251 typedef enum
252 {
253 eCoverArt_Success=0,
254 eCoverArt_ConnectionError,
255 eCoverArt_Timeout,
256 eCoverArt_AuthenticationError,
257 eCoverArt_FetchError,
258 eCoverArt_RequestError,
259 eCoverArt_ResourceNotFound
260 } tCoverArtResult;
261
269 tCoverArtResult caa_coverart_get_lastresult(CaaCoverArt CoverArt);
270
271
272
278 void caa_image_delete(CaaImage Image);
279
288 CaaImage caa_image_clone(CaaImage Image);
289
297 int caa_image_get_approved(CaaImage Image);
298
306 int caa_image_get_back(CaaImage Image);
307
317 int caa_image_get_comment(CaaImage Image, char *str, int len);
318
326 int caa_image_get_edit(CaaImage Image);
327
335 int caa_image_get_front(CaaImage Image);
336
346 int caa_image_get_id(CaaImage Image, char *str, int len);
347
357 int caa_image_get_image(CaaImage Image, char *str, int len);
358
366 CaaThumbnails caa_image_get_thumbnails(CaaImage Image);
367
375 CaaTypeList caa_image_get_typelist(CaaImage Image);
376
377/* --------------------------------------------------------------------------
378
379 libcoverart - Client library to access MusicBrainz
380
381 Copyright (C) 2012 Andrew Hawkins
382
383 This file is part of libcoverart.
384
385 This library is free software; you can redistribute it and/or
386 modify it under the terms of v2 of the GNU Lesser General Public
387 License as published by the Free Software Foundation.
388
389 libcoverart is distributed in the hope that it will be useful,
390 but WITHOUT ANY WARRANTY; without even the implied warranty of
391 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
392 Lesser General Public License for more details.
393
394 You should have received a copy of the GNU General Public License
395 along with this library. If not, see <http://www.gnu.org/licenses/>.
396
397 $Id$
398
399----------------------------------------------------------------------------*/
400
406 void caa_imagedata_delete(CaaImageData ImageData);
407
416 CaaImageData caa_imagedata_clone(CaaImageData ImageData);
417
425 int caa_imagedata_size(CaaImageData ImageData);
426
434 unsigned char *caa_imagedata_data(CaaImageData ImageData);
435
436
437
443 void caa_releaseinfo_delete(CaaReleaseInfo ReleaseInfo);
444
453 CaaReleaseInfo caa_releaseinfo_clone(CaaReleaseInfo ReleaseInfo);
454
464 int caa_releaseinfo_get_release(CaaReleaseInfo ReleaseInfo, char *str, int len);
465
473 CaaImageList caa_releaseinfo_get_imagelist(CaaReleaseInfo ReleaseInfo);
474
480 void caa_thumbnails_delete(CaaThumbnails Thumbnails);
481
490 CaaThumbnails caa_thumbnails_clone(CaaThumbnails Thumbnails);
491
501 int caa_thumbnails_get_large(CaaThumbnails Thumbnails, char *str, int len);
502
512 int caa_thumbnails_get_small(CaaThumbnails Thumbnails, char *str, int len);
513
519 void caa_type_delete(CaaType Type);
520
529 CaaType caa_type_clone(CaaType Type);
530
540 int caa_type_get_type(CaaType Type, char *str, int len);
541
547 void caa_image_list_delete(CaaImageList List);
548
554 int caa_image_list_size(CaaImageList List);
555
564 CaaImage caa_image_list_item(CaaImageList List, int Item);
565
571 int caa_image_list_get_count(CaaImageList List);
572
578 int caa_image_list_get_offset(CaaImageList List);
579
588 CaaImageList caa_image_list_clone(CaaImageList ImageList);
589
595 void caa_type_list_delete(CaaTypeList List);
596
602 int caa_type_list_size(CaaTypeList List);
603
612 CaaType caa_type_list_item(CaaTypeList List, int Item);
613
619 int caa_type_list_get_count(CaaTypeList List);
620
626 int caa_type_list_get_offset(CaaTypeList List);
627
636 CaaTypeList caa_type_list_clone(CaaTypeList TypeList);
637
638#ifdef __cplusplus
639}
640#endif
641
642#endif
643
caa_coverart_clone
CaaCoverArt caa_coverart_clone(CaaCoverArt CoverArt)
Clone a CaaCoverArt object.
caa_image_get_approved
int caa_image_get_approved(CaaImage Image)
caa_type_clone
CaaType caa_type_clone(CaaType Type)
Clone a CaaType object.
caa_image_get_front
int caa_image_get_front(CaaImage Image)
CaaCoverArt
void * CaaCoverArt
Definition caa_c.h:51
caa_coverart_fetch_front
CaaImageData caa_coverart_fetch_front(CaaCoverArt CoverArt, const char *ReleaseID)
Request the front image for a release.
CaaThumbnails
void * CaaThumbnails
Definition caa_c.h:54
CaaImage
void * CaaImage
Definition caa_c.h:52
caa_image_list_item
CaaImage caa_image_list_item(CaaImageList List, int Item)
Returns an entry from a CaaImageList.
caa_thumbnails_get_small
int caa_thumbnails_get_small(CaaThumbnails Thumbnails, char *str, int len)
caa_image_list_size
int caa_image_list_size(CaaImageList List)
Return the number of entries in a CaaImageList.
caa_releaseinfo_get_imagelist
CaaImageList caa_releaseinfo_get_imagelist(CaaReleaseInfo ReleaseInfo)
caa_coverart_new
CaaCoverArt caa_coverart_new(const char *UserAgent)
Create a new instance of CaaCoverArt.
caa_image_get_comment
int caa_image_get_comment(CaaImage Image, char *str, int len)
caa_coverart_set_proxyport
void caa_coverart_set_proxyport(CaaCoverArt CoverArt, int ProxyPort)
Set the port to use on the proxy server.
caa_image_get_edit
int caa_image_get_edit(CaaImage Image)
caa_image_get_thumbnails
CaaThumbnails caa_image_get_thumbnails(CaaImage Image)
caa_imagedata_delete
void caa_imagedata_delete(CaaImageData ImageData)
Delete a CaaImageData object.
caa_thumbnails_clone
CaaThumbnails caa_thumbnails_clone(CaaThumbnails Thumbnails)
Clone a CaaThumbnails object.
caa_image_get_image
int caa_image_get_image(CaaImage Image, char *str, int len)
CaaImageList
void * CaaImageList
Definition caa_c.h:56
caa_type_get_type
int caa_type_get_type(CaaType Type, char *str, int len)
CaaImageData
void * CaaImageData
Definition caa_c.h:131
caa_coverart_releaseinfo
CaaReleaseInfo caa_coverart_releaseinfo(CaaCoverArt CoverArt, const char *ReleaseID)
Request all information about a release.
caa_type_list_clone
CaaTypeList caa_type_list_clone(CaaTypeList TypeList)
Clone an CaaTypeList object.
caa_coverart_get_lastresult
tCoverArtResult caa_coverart_get_lastresult(CaaCoverArt CoverArt)
caa_type_list_delete
void caa_type_list_delete(CaaTypeList List)
Delete a CaaTypeList.
caa_releaseinfo_delete
void caa_releaseinfo_delete(CaaReleaseInfo ReleaseInfo)
Delete a CaaReleaseInfo object.
caa_thumbnails_delete
void caa_thumbnails_delete(CaaThumbnails Thumbnails)
Delete a CaaThumbnails object.
caa_thumbnails_get_large
int caa_thumbnails_get_large(CaaThumbnails Thumbnails, char *str, int len)
caa_imagedata_size
int caa_imagedata_size(CaaImageData ImageData)
Return the number of bytes in a CaaImageData object.
caa_imagedata_clone
CaaImageData caa_imagedata_clone(CaaImageData ImageData)
Clone a CaaImageData object.
caa_image_clone
CaaImage caa_image_clone(CaaImage Image)
Clone a CaaImage object.
tImageSize
tImageSize
Definition caa_c.h:213
eSize_Full
@ eSize_Full
Definition caa_c.h:214
eSize_250
@ eSize_250
Definition caa_c.h:215
eSize_500
@ eSize_500
Definition caa_c.h:216
caa_type_list_get_offset
int caa_type_list_get_offset(CaaTypeList List)
Return the offset of entries in an CaaTypeList.
caa_type_list_get_count
int caa_type_list_get_count(CaaTypeList List)
Return the count of entries in an CaaTypeList.
caa_image_get_back
int caa_image_get_back(CaaImage Image)
caa_releaseinfo_get_release
int caa_releaseinfo_get_release(CaaReleaseInfo ReleaseInfo, char *str, int len)
caa_type_delete
void caa_type_delete(CaaType Type)
Delete a CaaType object.
caa_image_list_get_count
int caa_image_list_get_count(CaaImageList List)
Return the count of entries in an CaaImageList.
caa_coverart_get_lasterrormessage
int caa_coverart_get_lasterrormessage(CaaCoverArt CoverArt, char *str, int len)
caa_coverart_get_version
int caa_coverart_get_version(CaaCoverArt CoverArt, char *str, int len)
CaaReleaseInfo
void * CaaReleaseInfo
Definition caa_c.h:53
caa_type_list_size
int caa_type_list_size(CaaTypeList List)
Return the number of entries in a CaaTypeList.
caa_coverart_fetch_back
CaaImageData caa_coverart_fetch_back(CaaCoverArt CoverArt, const char *ReleaseID)
Request the back image for a release.
caa_image_list_delete
void caa_image_list_delete(CaaImageList List)
Delete a CaaImageList.
caa_coverart_fetch_image
CaaImageData caa_coverart_fetch_image(CaaCoverArt CoverArt, const char *ReleaseID, const char *ImageID, tImageSize ImageSize)
Request a specific image for a release.
caa_coverart_set_proxypassword
void caa_coverart_set_proxypassword(CaaCoverArt CoverArt, const char *ProxyPassword)
Set the password to use to authenticate to the proxy server.
caa_imagedata_data
unsigned char * caa_imagedata_data(CaaImageData ImageData)
Return the data in a CaaImageData object.
tCoverArtResult
tCoverArtResult
Definition caa_c.h:252
eCoverArt_ResourceNotFound
@ eCoverArt_ResourceNotFound
Definition caa_c.h:259
eCoverArt_Success
@ eCoverArt_Success
Definition caa_c.h:253
eCoverArt_Timeout
@ eCoverArt_Timeout
Definition caa_c.h:255
eCoverArt_RequestError
@ eCoverArt_RequestError
Definition caa_c.h:258
eCoverArt_FetchError
@ eCoverArt_FetchError
Definition caa_c.h:257
eCoverArt_AuthenticationError
@ eCoverArt_AuthenticationError
Definition caa_c.h:256
eCoverArt_ConnectionError
@ eCoverArt_ConnectionError
Definition caa_c.h:254
caa_image_list_get_offset
int caa_image_list_get_offset(CaaImageList List)
Return the offset of entries in an CaaImageList.
caa_coverart_delete
void caa_coverart_delete(CaaCoverArt CoverArt)
Delete a CaaCoverArt object.
CaaType
void * CaaType
Definition caa_c.h:55
caa_coverart_set_proxyusername
void caa_coverart_set_proxyusername(CaaCoverArt CoverArt, const char *ProxyUserName)
Set the username to use to authenticate to the proxy server.
caa_type_list_item
CaaType caa_type_list_item(CaaTypeList List, int Item)
Returns an entry from a CaaTypeList.
caa_image_get_typelist
CaaTypeList caa_image_get_typelist(CaaImage Image)
CaaTypeList
void * CaaTypeList
Definition caa_c.h:57
caa_image_list_clone
CaaImageList caa_image_list_clone(CaaImageList ImageList)
Clone an CaaImageList object.
caa_coverart_set_proxyhost
void caa_coverart_set_proxyhost(CaaCoverArt CoverArt, const char *ProxyHost)
Set the proxy server.
caa_releaseinfo_clone
CaaReleaseInfo caa_releaseinfo_clone(CaaReleaseInfo ReleaseInfo)
Clone a CaaReleaseInfo object.
caa_image_get_id
int caa_image_get_id(CaaImage Image, char *str, int len)
caa_image_delete
void caa_image_delete(CaaImage Image)
Delete a CaaImage object.
caa_coverart_get_lasthttpcode
int caa_coverart_get_lasthttpcode(CaaCoverArt CoverArt)