123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- #ifndef MUSICBRAINZ_DISC_ID_H
- #define MUSICBRAINZ_DISC_ID_H
- #if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
- # ifdef libdiscid_EXPORTS
- # define LIBDISCID_API __declspec(dllexport)
- # else
- # define LIBDISCID_API __declspec(dllimport)
- # endif
- # define LIBDISCID_INTERNAL
- #elif (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
- # define LIBDISCID_API
- # define LIBDISCID_INTERNAL __attribute__((visibility("hidden")))
- #elif defined(__SUNPRO_C)
- # define LIBDISCID_API __global
- # define LIBDISCID_INTERNAL __hidden
- #else
- # define LIBDISCID_API
- # define LIBDISCID_INTERNAL
- #endif
- #if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
- #define LIBDISCID_DEPRECATED __declspec(deprecated)
- #elif (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__)
- #define LIBDISCID_DEPRECATED __attribute__((deprecated))
- #else
- #define LIBDISCID_DEPRECATED
- #endif
- #define DISCID_VERSION_MAJOR @libdiscid_MAJOR@
- #define DISCID_VERSION_MINOR @libdiscid_MINOR@
- #define DISCID_VERSION_PATCH @libdiscid_PATCH@
- #define DISCID_VERSION_NUM @libdiscid_VERSION_NUM@
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- typedef void *DiscId;
- LIBDISCID_API DiscId *discid_new();
- LIBDISCID_API void discid_free(DiscId *d);
- LIBDISCID_API int discid_read(DiscId *d, const char *device);
- LIBDISCID_API int discid_read_sparse(DiscId *d, const char *device,
- unsigned int features);
- #define DISCID_HAVE_SPARSE_READ
- LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets);
- LIBDISCID_API char *discid_get_error_msg(DiscId *d);
- LIBDISCID_API char *discid_get_id(DiscId *d);
- LIBDISCID_API char *discid_get_freedb_id(DiscId *d);
- LIBDISCID_API char *discid_get_toc_string(DiscId *d);
- LIBDISCID_API char *discid_get_submission_url(DiscId *d);
- LIBDISCID_API LIBDISCID_DEPRECATED char *discid_get_webservice_url(DiscId *d);
- LIBDISCID_API char *discid_get_default_device(void);
- LIBDISCID_API int discid_get_first_track_num(DiscId *d);
- LIBDISCID_API int discid_get_last_track_num(DiscId *d);
- LIBDISCID_API int discid_get_sectors(DiscId *d);
- LIBDISCID_API int discid_get_track_offset(DiscId *d, int track_num);
- LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num);
- LIBDISCID_API char* discid_get_mcn(DiscId *d);
- LIBDISCID_API char* discid_get_track_isrc(DiscId *d, int track_num);
- enum discid_feature {
- DISCID_FEATURE_READ = 1 << 0,
- DISCID_FEATURE_MCN = 1 << 1,
- DISCID_FEATURE_ISRC = 1 << 2,
- };
- LIBDISCID_API int discid_has_feature(enum discid_feature feature);
- #define DISCID_FEATURE_STR_READ "read"
- #define DISCID_FEATURE_STR_MCN "mcn"
- #define DISCID_FEATURE_STR_ISRC "isrc"
- #define DISCID_FEATURE_LENGTH 32
- LIBDISCID_API void discid_get_feature_list(
- char *features[DISCID_FEATURE_LENGTH]);
- LIBDISCID_API char *discid_get_version_string(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|