Chris@40: /* Chris@40: ** Copyright (C) 2001-2014 Erik de Castro Lopo Chris@40: ** Chris@40: ** All rights reserved. Chris@40: ** Chris@40: ** Redistribution and use in source and binary forms, with or without Chris@40: ** modification, are permitted provided that the following conditions are Chris@40: ** met: Chris@40: ** Chris@40: ** * Redistributions of source code must retain the above copyright Chris@40: ** notice, this list of conditions and the following disclaimer. Chris@40: ** * Redistributions in binary form must reproduce the above copyright Chris@40: ** notice, this list of conditions and the following disclaimer in Chris@40: ** the documentation and/or other materials provided with the Chris@40: ** distribution. Chris@40: ** * Neither the author nor the names of any contributors may be used Chris@40: ** to endorse or promote products derived from this software without Chris@40: ** specific prior written permission. Chris@40: ** Chris@40: ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS Chris@40: ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Chris@40: ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR Chris@40: ** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR Chris@40: ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, Chris@40: ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, Chris@40: ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; Chris@40: ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, Chris@40: ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR Chris@40: ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF Chris@40: ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Chris@40: */ Chris@40: Chris@40: #include Chris@40: #include Chris@40: #include Chris@40: #include Chris@40: Chris@40: #include Chris@40: Chris@40: int Chris@40: main (void) Chris@40: { SF_FORMAT_INFO info ; Chris@40: SF_INFO sfinfo ; Chris@40: int format, major_count, subtype_count, m, s ; Chris@40: Chris@40: memset (&sfinfo, 0, sizeof (sfinfo)) ; Chris@40: printf ("Version : %s\n\n", sf_version_string ()) ; Chris@40: Chris@40: sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; Chris@40: sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof (int)) ; Chris@40: Chris@40: sfinfo.channels = 1 ; Chris@40: for (m = 0 ; m < major_count ; m++) Chris@40: { info.format = m ; Chris@40: sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; Chris@40: printf ("%s (extension \"%s\")\n", info.name, info.extension) ; Chris@40: Chris@40: format = info.format ; Chris@40: Chris@40: for (s = 0 ; s < subtype_count ; s++) Chris@40: { info.format = s ; Chris@40: sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) ; Chris@40: Chris@40: format = (format & SF_FORMAT_TYPEMASK) | info.format ; Chris@40: Chris@40: sfinfo.format = format ; Chris@40: if (sf_format_check (&sfinfo)) Chris@40: printf (" %s\n", info.name) ; Chris@40: } ; Chris@40: puts ("") ; Chris@40: } ; Chris@40: puts ("") ; Chris@40: Chris@40: return 0 ; Chris@40: } /* main */ Chris@40: