1
2
3
/* automatically generated by rust-bindgen */

pub const DISCID_FEATURE_STR_READ : & 'static [ u8 ; 5usize ] = b"read\0" ; pub const DISCID_FEATURE_STR_MCN : & 'static [ u8 ; 4usize ] = b"mcn\0" ; pub const DISCID_FEATURE_STR_ISRC : & 'static [ u8 ; 5usize ] = b"isrc\0" ; pub const DISCID_FEATURE_LENGTH : u32 = 32 ; # [ doc = " A transparent handle for an Audio CD." ] # [ doc = "" ] # [ doc = " This is returned by discid_new() and has to be passed as the first" ] # [ doc = " parameter to all discid_*() functions." ] pub type DiscId = * mut :: std :: os :: raw :: c_void ; extern "C" { # [ doc = " Return a handle for a new DiscId object." ] # [ doc = "" ] # [ doc = " If no memory could be allocated, NULL is returned. Don't use the created" ] # [ doc = " DiscId object before calling discid_read() or discid_put()." ] # [ doc = "" ] # [ doc = " @return a DiscId object, or NULL." ] pub fn discid_new ( ) -> * mut DiscId ; } extern "C" { # [ doc = " Release the memory allocated for the DiscId object." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] pub fn discid_free ( d : * mut DiscId ) ; } extern "C" { # [ doc = " Read all supported features of the disc in the given CD-ROM/DVD-ROM drive." ] # [ doc = "" ] # [ doc = " This function reads the disc in the drive specified by the given device" ] # [ doc = " identifier. If the device is NULL, the default drive, as returned by" ] # [ doc = " discid_get_default_device() is used." ] # [ doc = "" ] # [ doc = " If you do not require all features provided by libdiscid, such as MCN" ] # [ doc = " or ISRC reading, you should consider using discid_read_sparse() instead" ] # [ doc = " of discid_read() for performance reasons." ] # [ doc = "" ] # [ doc = " On error, this function returns false and sets the error message which you" ] # [ doc = " can access using discid_get_error_msg(). In this case, the other functions" ] # [ doc = " won't return meaningful values and should not be used." ] # [ doc = "" ] # [ doc = " This function may be used multiple times with the same DiscId object." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @param device an operating system dependent device identifier, or NULL" ] # [ doc = " @return true if successful, or false on error." ] pub fn discid_read ( d : * mut DiscId , device : * const :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Read the disc in the given CD-ROM/DVD-ROM drive" ] # [ doc = " extracting only the TOC and additionally specified features." ] # [ doc = "" ] # [ doc = " This function will always read the TOC, but additional features" ] # [ doc = " like ::DISCID_FEATURE_MCN and ::DISCID_FEATURE_ISRC can be set" ] # [ doc = " using the features parameter." ] # [ doc = " Multiple features can be set using bitwise OR." ] # [ doc = "" ] # [ doc = " If you only want to generate a disc ID, you only need the TOC," ] # [ doc = " so set features to 0:" ] # [ doc = " \\code" ] # [ doc = " discid_read_sparse(disc, device, 0)" ] # [ doc = " \\endcode" ] # [ doc = " This is a bit more verbose, but equivalent since ::DISCID_FEATURE_READ" ] # [ doc = " is always implied:" ] # [ doc = " \\code" ] # [ doc = " discid_read_sparse(disc, device, DISCID_FEATURE_READ)" ] # [ doc = " \\endcode" ] # [ doc = "" ] # [ doc = " If you want to read all features available, you can use discid_read()." ] # [ doc = "" ] # [ doc = " On error, this function returns false and sets the error message which you" ] # [ doc = " can access using discid_get_error_msg(). In this case, the other functions" ] # [ doc = " won't return meaningful values and should not be used." ] # [ doc = "" ] # [ doc = " This function may be used multiple times with the same DiscId object." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.5.0" ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @param device an operating system dependent device identifier, or NULL" ] # [ doc = " @param features a list of bit flags from the enum ::discid_feature" ] # [ doc = " @return true if successful, or false on error." ] pub fn discid_read_sparse ( d : * mut DiscId , device : * const :: std :: os :: raw :: c_char , features : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Provides the TOC of a known CD." ] # [ doc = "" ] # [ doc = " This function may be used if the TOC has been read earlier and you" ] # [ doc = " want to calculate the disc ID afterwards, without accessing the disc" ] # [ doc = " drive. It replaces the discid_read function in this case." ] # [ doc = "" ] # [ doc = " On error, this function returns false and sets the error message which you" ] # [ doc = " can access using discid_get_error_msg(). In this case, the other functions" ] # [ doc = " won't return meaningful values and should not be used." ] # [ doc = "" ] # [ doc = " The offsets parameter points to an array which contains the track offsets" ] # [ doc = " for each track. The first element, offsets[0], is the leadout track. It" ] # [ doc = " must contain the total number of sectors on the disc." ] # [ doc = "" ] # [ doc = " For discs with additional data tracks, the trailing data tracks" ] # [ doc = " should be ignored. offset[0] should then be the last sector of the last" ] # [ doc = " audio track." ] # [ doc = " Make sure the length of the last audio track as returned by libdiscid" ] # [ doc = " after a put is the same as the length of your last audio track." ] # [ doc = " Depending on your tools you might need to substract 11400 (2:32 min.)." ] # [ doc = " See also:" ] # [ doc = " <a href=\"http://musicbrainz.org/doc/Disc_ID_Calculation\">Disc ID Calculation</a>" ] # [ doc = "" ] # [ doc = "" ] # [ doc = " @param d a DiscID object created by discid_new()" ] # [ doc = " @param first the number of the first audio track on disc (usually one)" ] # [ doc = " @param last the number of the last audio track on the disc" ] # [ doc = " @param offsets a pointer to an array of 100 track offsets" ] # [ doc = " @return true if the given data was valid, and false on error" ] pub fn discid_put ( d : * mut DiscId , first : :: std :: os :: raw :: c_int , last : :: std :: os :: raw :: c_int , offsets : * mut :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return a human-readable error message." ] # [ doc = "" ] # [ doc = " This function may only be used if discid_read() failed. The returned" ] # [ doc = " error message is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string describing the error that occurred" ] pub fn discid_get_error_msg ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return a MusicBrainz DiscID." ] # [ doc = "" ] # [ doc = " The returned string is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing a MusicBrainz DiscID" ] pub fn discid_get_id ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return a FreeDB DiscID." ] # [ doc = "" ] # [ doc = " The returned string is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing a FreeDB DiscID" ] pub fn discid_get_freedb_id ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return a string representing CD Table Of Contents (TOC)." ] # [ doc = "" ] # [ doc = " The string has following values separated by space:" ] # [ doc = " first track number" ] # [ doc = " last track number" ] # [ doc = " total length in sectors" ] # [ doc = " offset of 1st track" ] # [ doc = " offset of 2nd track" ] # [ doc = " ..." ] # [ doc = "" ] # [ doc = " Example:" ] # [ doc = " 1 7 164900 150 22460 50197 80614 100828 133318 144712" ] # [ doc = "" ] # [ doc = " The returned string is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing TOC information" ] pub fn discid_get_toc_string ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return an URL for submitting the DiscID to MusicBrainz." ] # [ doc = "" ] # [ doc = " The URL leads to an interactive disc submission wizard that guides the" ] # [ doc = " user through the process of associating this disc's DiscID with a" ] # [ doc = " release in the MusicBrainz database." ] # [ doc = "" ] # [ doc = " The returned string is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing an URL" ] pub fn discid_get_submission_url ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return an URL for retrieving CD information from MusicBrainz' web service" ] # [ doc = "" ] # [ doc = " The URL provides the CD information in XML." ] # [ doc = " See http://musicbrainz.org/development/mmd for details." ] # [ doc = "" ] # [ doc = " The returned string is only valid as long as the DiscId object exists." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing an URL" ] # [ doc = "" ] # [ doc = " @deprecated This function is deprecated. Please use libmusicbrainz instead" ] # [ doc = " since this function returns an URL referring the deprecated webservice." ] pub fn discid_get_webservice_url ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return the name of the default disc drive for this machine." ] # [ doc = " This isn't constant, but possibly depends on the drives currently" ] # [ doc = " attached, depending on the platform." ] # [ doc = " For this reason you should call this once and save it" ] # [ doc = " when you want to make sure to use the same drive for" ] # [ doc = " multiple operations." ] # [ doc = "" ] # [ doc = " The returned string is thread local and owned by libdiscid internally." ] # [ doc = "" ] # [ doc = " @return a string containing an operating system dependent device identifier" ] pub fn discid_get_default_device ( ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return the number of the first track on this disc." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return the number of the first track" ] pub fn discid_get_first_track_num ( d : * mut DiscId ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return the number of the last audio track on this disc." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return the number of the last track" ] pub fn discid_get_last_track_num ( d : * mut DiscId ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return the length of the disc in sectors." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return the length of the disc in sectors" ] pub fn discid_get_sectors ( d : * mut DiscId ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return the sector offset of a track." ] # [ doc = "" ] # [ doc = " Only track numbers between (and including) discid_get_first_track_num()" ] # [ doc = " and discid_get_last_track_num() may be used." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @param track_num the number of a track" ] # [ doc = " @return sector offset of the specified track" ] pub fn discid_get_track_offset ( d : * mut DiscId , track_num : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return the length of a track in sectors." ] # [ doc = "" ] # [ doc = " Only track numbers between (and including) discid_get_first_track_num()" ] # [ doc = " and discid_get_last_track_num() may be used." ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @param track_num the number of a track" ] # [ doc = " @return length of the specified track" ] pub fn discid_get_track_length ( d : * mut DiscId , track_num : :: std :: os :: raw :: c_int ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return the Media Catalogue Number (MCN) for the disc." ] # [ doc = "" ] # [ doc = " This is essentially an EAN (= UPC with 0 prefix)." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.3.0" ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @return a string containing an Media Catalogue Number of the disk" ] pub fn discid_get_mcn ( d : * mut DiscId ) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Return the ISRC for a track." ] # [ doc = "" ] # [ doc = " Only track numbers between (and including) discid_get_first_track_num()" ] # [ doc = " and discid_get_last_track_num() may be used." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.3.0" ] # [ doc = "" ] # [ doc = " @param d a DiscId object created by discid_new()" ] # [ doc = " @param track_num the number of a track" ] # [ doc = " @return a string containing an ISRC for the specified track" ] pub fn discid_get_track_isrc ( d : * mut DiscId , track_num : :: std :: os :: raw :: c_int ) -> * mut :: std :: os :: raw :: c_char ; } pub mod discid_feature { # [ doc = " PLATFORM-DEPENDENT FEATURES" ] # [ doc = "" ] # [ doc = " The platform dependent features are currently:" ] # [ doc = "   - \"read\"\tread TOC from disc" ] # [ doc = "   - \"mcn\"\tread MCN from disc" ] # [ doc = "   - \"isrc\"\tread ISRC from disc" ] # [ doc = "" ] # [ doc = " A table in the" ] # [ doc = " <a href=\"http://musicbrainz.org/doc/libdiscid\">MusicBrainz Documentation</a>" ] # [ doc = " specifies which features are available on which platform in what version." ] # [ doc = "" ] # [ doc = " In the code you can use discid_get_feature_list() or discid_has_feature()" ] # [ doc = " below to get the features for your platform in this version." ] pub type Type = u32 ; pub const DISCID_FEATURE_READ : Type = 1 ; pub const DISCID_FEATURE_MCN : Type = 2 ; pub const DISCID_FEATURE_ISRC : Type = 4 ; } extern "C" { # [ doc = " Check if a certain feature is implemented on the current platform." ] # [ doc = "" ] # [ doc = " This only works for single features, not bit masks with multiple features." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.4.0" ] # [ doc = "" ] # [ doc = " @param feature as enum ::discid_feature" ] # [ doc = " @return 1 if the feature is implemented and 0 if not." ] pub fn discid_has_feature ( feature : discid_feature :: Type ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Return a list of features supported by the current platform." ] # [ doc = " The array of length ::DISCID_FEATURE_LENGTH should be allocated by the user." ] # [ doc = " After the call each element of the array is either NULL" ] # [ doc = " or a pointer to a static string." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.4.0" ] # [ doc = "" ] # [ doc = " @param[out] features a static string array of length ::DISCID_FEATURE_LENGTH" ] pub fn discid_get_feature_list ( features : * mut * mut :: std :: os :: raw :: c_char ) ; } extern "C" { # [ doc = " Return the full version string of this library, including the name." ] # [ doc = " This can be used for debug output." ] # [ doc = " Don't use this to test for features, see discid_has_feature()." ] # [ doc = "" ] # [ doc = " \\since libdiscid 0.4.0" ] # [ doc = "" ] # [ doc = " @return a string containing the version of libdiscid." ] pub fn discid_get_version_string ( ) -> * mut :: std :: os :: raw :: c_char ; }