libcoverart  1.0.0
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 the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  libcoverart is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this library. If not, see <http://www.gnu.org/licenses/>.
21 
22  THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT IT!
23 
24 ----------------------------------------------------------------------------*/
25 
26 
27 
28 /*
29  Things you should delete using the appropriate caa_xxx_delete() function:
30 
31  * The coverart object you create to do the actual work
32  * The releaseinfo object returned from the caa_coverart_releaseinfo() function
33  * Any image data returned from the caa_fetch_xxx functions
34  * The return from any caa_xxx_clone() function
35 
36  Everything else remains managed by the library, and should not be deleted
37 
38  If in doubt, valgrind is a useful way to spot leaks or things being deleted
39  when they shouldn't be.
40 
41 */
42 
43 #ifndef _COVERART_MB_C_H
44 #define _COVERART_MB_C_H
45 
46 #include "coverart/defines.h"
47 
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52 
53 
54  typedef void *CaaCoverArt;
55  typedef void *CaaImage;
56  typedef void *CaaReleaseInfo;
57  typedef void *CaaThumbnails;
58  typedef void *CaaType;
59  typedef void *CaaImageList;
60  typedef void *CaaTypeList;
61 
67  void caa_coverart_delete(CaaCoverArt CoverArt);
68 
77  CaaCoverArt caa_coverart_clone(CaaCoverArt CoverArt);
78 
86  int caa_coverart_get_lasthttpcode(CaaCoverArt CoverArt);
87 
97  int caa_coverart_get_lasterrormessage(CaaCoverArt CoverArt, char *str, int len);
98 
108  int caa_coverart_get_version(CaaCoverArt CoverArt, char *str, int len);
109 
110 /* --------------------------------------------------------------------------
111 
112  libcoverart - Client library to access MusicBrainz
113 
114  Copyright (C) 2012 Andrew Hawkins
115 
116  This file is part of libcoverart.
117 
118  This library is free software; you can redistribute it and/or
119  modify it under the terms of the GNU Lesser General Public
120  License as published by the Free Software Foundation; either
121  version 2.1 of the License, or (at your option) any later version.
122 
123  libcoverart is distributed in the hope that it will be useful,
124  but WITHOUT ANY WARRANTY; without even the implied warranty of
125  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
126  Lesser General Public License for more details.
127 
128  You should have received a copy of the GNU General Public License
129  along with this library. If not, see <http://www.gnu.org/licenses/>.
130 
131  $Id$
132 
133 ----------------------------------------------------------------------------*/
134 
135 typedef void *CaaImageData;
136 
148  CaaCoverArt caa_coverart_new(const char *UserAgent);
149 
158  void caa_coverart_set_proxyhost(CaaCoverArt CoverArt, const char *ProxyHost);
159 
168  void caa_coverart_set_proxyport(CaaCoverArt CoverArt, int ProxyPort);
169 
178  void caa_coverart_set_proxyusername(CaaCoverArt CoverArt, const char *ProxyUserName);
179 
188  void caa_coverart_set_proxypassword(CaaCoverArt CoverArt, const char *ProxyPassword);
189 
201  CaaImageData caa_coverart_fetch_front(CaaCoverArt CoverArt, const char *ReleaseID);
202 
214  CaaImageData caa_coverart_fetch_back(CaaCoverArt CoverArt, const char *ReleaseID);
215 
216  typedef enum
217  {
221  } tImageSize;
222 
236  CaaImageData caa_coverart_fetch_image(CaaCoverArt CoverArt, const char *ReleaseID, const char *ImageID, tImageSize ImageSize);
237 
249  CaaReleaseInfo caa_coverart_releaseinfo(CaaCoverArt CoverArt, const char *ReleaseID);
250 
255  typedef enum
256  {
264  } tCoverArtResult;
265 
273  tCoverArtResult caa_coverart_get_lastresult(CaaCoverArt CoverArt);
274 
275 
276 
282  void caa_image_delete(CaaImage Image);
283 
292  CaaImage caa_image_clone(CaaImage Image);
293 
301  int caa_image_get_approved(CaaImage Image);
302 
310  int caa_image_get_back(CaaImage Image);
311 
321  int caa_image_get_comment(CaaImage Image, char *str, int len);
322 
330  int caa_image_get_edit(CaaImage Image);
331 
339  int caa_image_get_front(CaaImage Image);
340 
350  int caa_image_get_id(CaaImage Image, char *str, int len);
351 
361  int caa_image_get_image(CaaImage Image, char *str, int len);
362 
370  CaaThumbnails caa_image_get_thumbnails(CaaImage Image);
371 
379  CaaTypeList caa_image_get_typelist(CaaImage Image);
380 
381 /* --------------------------------------------------------------------------
382 
383  libcoverart - Client library to access MusicBrainz
384 
385  Copyright (C) 2012 Andrew Hawkins
386 
387  This file is part of libcoverart.
388 
389  This library is free software; you can redistribute it and/or
390  modify it under the terms of the GNU Lesser General Public
391  License as published by the Free Software Foundation; either
392  version 2.1 of the License, or (at your option) any later version.
393 
394  libcoverart is distributed in the hope that it will be useful,
395  but WITHOUT ANY WARRANTY; without even the implied warranty of
396  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
397  Lesser General Public License for more details.
398 
399  You should have received a copy of the GNU General Public License
400  along with this library. If not, see <http://www.gnu.org/licenses/>.
401 
402  $Id$
403 
404 ----------------------------------------------------------------------------*/
405 
411  void caa_imagedata_delete(CaaImageData ImageData);
412 
421  CaaImageData caa_imagedata_clone(CaaImageData ImageData);
422 
430  int caa_imagedata_size(CaaImageData ImageData);
431 
439  unsigned char *caa_imagedata_data(CaaImageData ImageData);
440 
441 
442 
448  void caa_releaseinfo_delete(CaaReleaseInfo ReleaseInfo);
449 
458  CaaReleaseInfo caa_releaseinfo_clone(CaaReleaseInfo ReleaseInfo);
459 
469  int caa_releaseinfo_get_release(CaaReleaseInfo ReleaseInfo, char *str, int len);
470 
478  CaaImageList caa_releaseinfo_get_imagelist(CaaReleaseInfo ReleaseInfo);
479 
485  void caa_thumbnails_delete(CaaThumbnails Thumbnails);
486 
495  CaaThumbnails caa_thumbnails_clone(CaaThumbnails Thumbnails);
496 
506  int caa_thumbnails_get_large(CaaThumbnails Thumbnails, char *str, int len);
507 
517  int caa_thumbnails_get_small(CaaThumbnails Thumbnails, char *str, int len);
518 
524  void caa_type_delete(CaaType Type);
525 
534  CaaType caa_type_clone(CaaType Type);
535 
545  int caa_type_get_type(CaaType Type, char *str, int len);
546 
552  void caa_image_list_delete(CaaImageList List);
553 
559  int caa_image_list_size(CaaImageList List);
560 
569  CaaImage caa_image_list_item(CaaImageList List, int Item);
570 
576  int caa_image_list_get_count(CaaImageList List);
577 
583  int caa_image_list_get_offset(CaaImageList List);
584 
593  CaaImageList caa_image_list_clone(CaaImageList ImageList);
594 
600  void caa_type_list_delete(CaaTypeList List);
601 
607  int caa_type_list_size(CaaTypeList List);
608 
617  CaaType caa_type_list_item(CaaTypeList List, int Item);
618 
624  int caa_type_list_get_count(CaaTypeList List);
625 
631  int caa_type_list_get_offset(CaaTypeList List);
632 
641  CaaTypeList caa_type_list_clone(CaaTypeList TypeList);
642 
643 
644 #ifdef __cplusplus
645 }
646 #endif
647 
648 #endif
649 
650 
void caa_coverart_delete(CaaCoverArt CoverArt)
Delete a CaaCoverArt object.
CaaImageData caa_coverart_fetch_back(CaaCoverArt CoverArt, const char *ReleaseID)
Request the back image for a release.
CaaReleaseInfo caa_releaseinfo_clone(CaaReleaseInfo ReleaseInfo)
Clone a CaaReleaseInfo object.
void caa_coverart_set_proxyport(CaaCoverArt CoverArt, int ProxyPort)
Set the port to use on the proxy server.
Definition: caa_c.h:257
void * CaaImageData
Definition: caa_c.h:135
Definition: caa_c.h:260
void caa_thumbnails_delete(CaaThumbnails Thumbnails)
Delete a CaaThumbnails object.
CaaImageData caa_coverart_fetch_image(CaaCoverArt CoverArt, const char *ReleaseID, const char *ImageID, tImageSize ImageSize)
Request a specific image for a release.
Definition: caa_c.h:261
tImageSize
Definition: caa_c.h:216
int caa_thumbnails_get_large(CaaThumbnails Thumbnails, char *str, int len)
void caa_type_delete(CaaType Type)
Delete a CaaType object.
CaaThumbnails caa_thumbnails_clone(CaaThumbnails Thumbnails)
Clone a CaaThumbnails object.
void * CaaType
Definition: caa_c.h:58
int caa_imagedata_size(CaaImageData ImageData)
Return the number of bytes in a CaaImageData object.
CaaTypeList caa_type_list_clone(CaaTypeList TypeList)
Clone an CaaTypeList object.
void * CaaImage
Definition: caa_c.h:55
void * CaaCoverArt
Definition: caa_c.h:54
Definition: caa_c.h:263
int caa_type_list_size(CaaTypeList List)
Return the number of entries in a CaaTypeList.
int caa_image_get_id(CaaImage Image, char *str, int len)
void caa_image_list_delete(CaaImageList List)
Delete a CaaImageList.
tCoverArtResult caa_coverart_get_lastresult(CaaCoverArt CoverArt)
CaaImageList caa_image_list_clone(CaaImageList ImageList)
Clone an CaaImageList object.
int caa_coverart_get_version(CaaCoverArt CoverArt, char *str, int len)
Definition: caa_c.h:218
void * CaaImageList
Definition: caa_c.h:59
CaaImageList caa_releaseinfo_get_imagelist(CaaReleaseInfo ReleaseInfo)
int caa_image_list_get_count(CaaImageList List)
Return the count of entries in an CaaImageList.
unsigned char * caa_imagedata_data(CaaImageData ImageData)
Return the data in a CaaImageData object.
void * CaaThumbnails
Definition: caa_c.h:57
CaaThumbnails caa_image_get_thumbnails(CaaImage Image)
int caa_image_get_approved(CaaImage Image)
int caa_type_get_type(CaaType Type, char *str, int len)
int caa_coverart_get_lasthttpcode(CaaCoverArt CoverArt)
CaaImage caa_image_clone(CaaImage Image)
Clone a CaaImage object.
CaaCoverArt caa_coverart_clone(CaaCoverArt CoverArt)
Clone a CaaCoverArt object.
void caa_coverart_set_proxyhost(CaaCoverArt CoverArt, const char *ProxyHost)
Set the proxy server.
void caa_imagedata_delete(CaaImageData ImageData)
Delete a CaaImageData object.
void * CaaReleaseInfo
Definition: caa_c.h:56
int caa_image_get_image(CaaImage Image, char *str, int len)
int caa_type_list_get_offset(CaaTypeList List)
Return the offset of entries in an CaaTypeList.
void caa_releaseinfo_delete(CaaReleaseInfo ReleaseInfo)
Delete a CaaReleaseInfo object.
Definition: caa_c.h:258
CaaImageData caa_coverart_fetch_front(CaaCoverArt CoverArt, const char *ReleaseID)
Request the front image for a release.
CaaType caa_type_list_item(CaaTypeList List, int Item)
Returns an entry from a CaaTypeList.
void caa_image_delete(CaaImage Image)
Delete a CaaImage object.
int caa_image_list_get_offset(CaaImageList List)
Return the offset of entries in an CaaImageList.
tCoverArtResult
Definition: caa_c.h:255
CaaType caa_type_clone(CaaType Type)
Clone a CaaType object.
int caa_type_list_get_count(CaaTypeList List)
Return the count of entries in an CaaTypeList.
Definition: caa_c.h:259
int caa_thumbnails_get_small(CaaThumbnails Thumbnails, char *str, int len)
Definition: caa_c.h:220
void caa_type_list_delete(CaaTypeList List)
Delete a CaaTypeList.
int caa_image_get_back(CaaImage Image)
int caa_image_get_edit(CaaImage Image)
CaaTypeList caa_image_get_typelist(CaaImage Image)
Definition: caa_c.h:219
int caa_image_get_front(CaaImage Image)
int caa_releaseinfo_get_release(CaaReleaseInfo ReleaseInfo, char *str, int len)
CaaImage caa_image_list_item(CaaImageList List, int Item)
Returns an entry from a CaaImageList.
void * CaaTypeList
Definition: caa_c.h:60
CaaCoverArt caa_coverart_new(const char *UserAgent)
Create a new instance of CaaCoverArt.
int caa_image_list_size(CaaImageList List)
Return the number of entries in a CaaImageList.
CaaImageData caa_imagedata_clone(CaaImageData ImageData)
Clone a CaaImageData object.
int caa_image_get_comment(CaaImage Image, char *str, int len)
void caa_coverart_set_proxypassword(CaaCoverArt CoverArt, const char *ProxyPassword)
Set the password to use to authenticate to the proxy server.
CaaReleaseInfo caa_coverart_releaseinfo(CaaCoverArt CoverArt, const char *ReleaseID)
Request all information about a release.
int caa_coverart_get_lasterrormessage(CaaCoverArt CoverArt, char *str, int len)
void caa_coverart_set_proxyusername(CaaCoverArt CoverArt, const char *ProxyUserName)
Set the username to use to authenticate to the proxy server.
Definition: caa_c.h:262