libdiscid  0.5.0
 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 #define DISCID_VERSION_MAJOR 0
46 #define DISCID_VERSION_MINOR 5
47 #define DISCID_VERSION_PATCH 0
48 #define DISCID_VERSION_NUM 500
49 
50 #ifdef __cplusplus
51  extern "C" {
52 #endif
53 
114 typedef void *DiscId;
115 
116 
125 LIBDISCID_API DiscId *discid_new();
126 
127 
133 LIBDISCID_API void discid_free(DiscId *d);
134 
135 
157 LIBDISCID_API int discid_read(DiscId *d, const char *device);
158 
159 
183 LIBDISCID_API int discid_read_sparse(DiscId *d, const char *device, unsigned int features);
184 
185 #define DISCID_HAVE_SPARSE_READ
186 
208 LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets);
209 
210 
220 LIBDISCID_API char *discid_get_error_msg(DiscId *d);
221 
222 
231 LIBDISCID_API char *discid_get_id(DiscId *d);
232 
233 
242 LIBDISCID_API char *discid_get_freedb_id(DiscId *d);
243 
244 
258 
271 
278 
279 
287 
288 
296 
297 
304 LIBDISCID_API int discid_get_sectors(DiscId *d);
305 
306 
317 LIBDISCID_API int discid_get_track_offset(DiscId *d, int track_num);
318 
319 
330 LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num);
331 
340 LIBDISCID_API char* discid_get_mcn(DiscId *d);
341 
354 LIBDISCID_API char* discid_get_track_isrc(DiscId *d, int track_num);
355 
356 
372 };
382 
383 #define DISCID_FEATURE_STR_READ "read"
384 #define DISCID_FEATURE_STR_MCN "mcn"
385 #define DISCID_FEATURE_STR_ISRC "isrc"
386 #define DISCID_FEATURE_LENGTH 32
387 
398  char *features[DISCID_FEATURE_LENGTH]);
399 
410 
411 
412 #ifdef __cplusplus
413  }
414 #endif
415 
416 #endif /* MUSICBRAINZ_DISC_ID_H */