libdiscid  0.6.1
 All Files Functions Typedefs Enumerations Enumerator Macros Pages
discid.h
Go to the documentation of this file.
1 /* --------------------------------------------------------------------------
2 
3  MusicBrainz -- The Internet music metadatabase
4 
5  Copyright (C) 2013 Johannes Dewender
6  Copyright (C) 2006-2010 Lukas Lalinsky
7  Copyright (C) 2006 Matthias Friedrich
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  This library 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 Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 --------------------------------------------------------------------------- */
24 #ifndef MUSICBRAINZ_DISC_ID_H
25 #define MUSICBRAINZ_DISC_ID_H
26 
27 #if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
28 # ifdef libdiscid_EXPORTS
29 # define LIBDISCID_API __declspec(dllexport)
30 # else
31 # define LIBDISCID_API __declspec(dllimport)
32 # endif
33 # define LIBDISCID_INTERNAL
34 #elif (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
35 # define LIBDISCID_API
36 # define LIBDISCID_INTERNAL __attribute__((visibility("hidden")))
37 #elif defined(__SUNPRO_C)
38 # define LIBDISCID_API __global
39 # define LIBDISCID_INTERNAL __hidden
40 #else
41 # define LIBDISCID_API
42 # define LIBDISCID_INTERNAL
43 #endif
44 
45 #if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
46 #define LIBDISCID_DEPRECATED __declspec(deprecated)
47 #elif (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__)
48 #define LIBDISCID_DEPRECATED __attribute__((deprecated))
49 #else
50 #define LIBDISCID_DEPRECATED
51 #endif
52 
53 #define DISCID_VERSION_MAJOR 0
54 #define DISCID_VERSION_MINOR 6
55 #define DISCID_VERSION_PATCH 1
56 #define DISCID_VERSION_NUM 601
57 
58 #ifdef __cplusplus
59  extern "C" {
60 #endif
61 
122 typedef void *DiscId;
123 
124 
133 LIBDISCID_API DiscId *discid_new();
134 
135 
141 LIBDISCID_API void discid_free(DiscId *d);
142 
143 
165 LIBDISCID_API int discid_read(DiscId *d, const char *device);
166 
167 
203 LIBDISCID_API int discid_read_sparse(DiscId *d, const char *device,
204  unsigned int features);
205 
206 #define DISCID_HAVE_SPARSE_READ
207 
239 LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets);
240 
241 
251 LIBDISCID_API char *discid_get_error_msg(DiscId *d);
252 
253 
262 LIBDISCID_API char *discid_get_id(DiscId *d);
263 
264 
273 LIBDISCID_API char *discid_get_freedb_id(DiscId *d);
274 
294 LIBDISCID_API char *discid_get_toc_string(DiscId *d);
295 
309 
325 
339 
340 
348 
349 
357 
358 
365 LIBDISCID_API int discid_get_sectors(DiscId *d);
366 
367 
378 LIBDISCID_API int discid_get_track_offset(DiscId *d, int track_num);
379 
380 
391 LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num);
392 
403 LIBDISCID_API char* discid_get_mcn(DiscId *d);
404 
417 LIBDISCID_API char* discid_get_track_isrc(DiscId *d, int track_num);
418 
419 
440 };
452 
453 #define DISCID_FEATURE_STR_READ "read"
454 #define DISCID_FEATURE_STR_MCN "mcn"
455 #define DISCID_FEATURE_STR_ISRC "isrc"
456 #define DISCID_FEATURE_LENGTH 32
457 
468  char *features[DISCID_FEATURE_LENGTH]);
469 
480 
481 
482 #ifdef __cplusplus
483  }
484 #endif
485 
486 #endif /* MUSICBRAINZ_DISC_ID_H */