2.19 MB
/gnu/store/cxqgwmlw0wshq6h4214wb0gjx4b346i4-libsndfile-1.0.30.tar.bz2 vs.
/gnu/store/sms1l40l1sm3jfjh4dmqxwn8n23j30v6-libsndfile-1.0.30.tar.bz2
2.19 MB
cxqgwmlw0wshq6h4214wb0gjx4b346i4-libsndfile-1.0.30.tar vs.
sms1l40l1sm3jfjh4dmqxwn8n23j30v6-libsndfile-1.0.30.tar
75.1 KB
file list
    
Offset 1, 360 lines modifiedOffset 1, 360 lines modified
1 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:36.000000·libsndfile-1.0.30/1 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/
2 -rwxrwxrwx···0·····1000·····1000····66232·2020-09-19·07:25:36.000000·libsndfile-1.0.30/aclocal.m42 -rwxr-xr-x···0····71588····10513···822284·2020-10-04·13:10:13.000000·libsndfile-1.0.30/configure
3 -rwxrwxrwx···0·····1000·····1000·····1954·2020-08-16·04:58:50.000000·libsndfile-1.0.30/AUTHORS3 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/examples/
4 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:31.000000·libsndfile-1.0.30/build-aux/4 -rw-r--r--···0····71588····10513·····5280·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/sndfile-loopify.c
5 -rwxrwxrwx···0·····1000·····1000·····5827·2020-09-19·07:25:40.000000·libsndfile-1.0.30/build-aux/ar-lib5 -rw-r--r--···0····71588····10513·····2226·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/sndfilehandle.cc
6 -rwxrwxrwx···0·····1000·····1000·····7383·2020-09-19·07:25:40.000000·libsndfile-1.0.30/build-aux/compile6 -rw-r--r--···0····71588····10513·····3242·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/make_sine.c
7 -rwxrwxrwx···0·····1000·····1000····44283·2020-09-19·07:25:40.000000·libsndfile-1.0.30/build-aux/config.guess7 -rw-r--r--···0····71588····10513·····2686·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/list_formats.c
8 -rwxrwxrwx···0·····1000·····1000····36136·2020-09-19·07:25:41.000000·libsndfile-1.0.30/build-aux/config.sub8 -rw-r--r--···0····71588····10513·····4567·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/sndfile-to-text.c
9 -rwxrwxrwx···0·····1000·····1000····23568·2020-09-19·07:25:41.000000·libsndfile-1.0.30/build-aux/depcomp9 -rw-r--r--···0····71588····10513·····4991·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/sfprocess.c
10 -rwxrwxrwx···0·····1000·····1000····15368·2020-09-19·07:25:41.000000·libsndfile-1.0.30/build-aux/install-sh10 -rw-r--r--···0····71588····10513·····4412·2020-10-04·10:00:49.000000·libsndfile-1.0.30/examples/generate.c
11 -rwxrwxrwx···0·····1000·····1000···327114·2020-09-19·07:25:32.000000·libsndfile-1.0.30/build-aux/ltmain.sh11 -rw-r--r--···0····71588····10513····25968·2020-10-04·10:00:49.000000·libsndfile-1.0.30/configure.ac
12 -rwxrwxrwx···0·····1000·····1000·····6878·2020-09-19·07:25:41.000000·libsndfile-1.0.30/build-aux/missing12 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/Octave/
13 -rwxrwxrwx···0·····1000·····1000······112·2020-08-16·04:58:50.000000·libsndfile-1.0.30/ChangeLog13 -rwxr-xr-x···0····71588····10513·····1849·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/octave_test.sh
14 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:35.000000·libsndfile-1.0.30/cmake/14 -rw-r--r--···0····71588····10513·····2710·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/Makefile.am
15 -rwxrwxrwx···0·····1000·····1000·····2055·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/ClipMode.cmake15 -rw-r--r--···0····71588····10513·····1595·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/sndfile_save.m
16 -rwxrwxrwx···0·····1000·····1000·····1226·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/CMakeAutoGen.cmake16 -rw-r--r--···0····71588····10513·····1606·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/octave_test.m
17 -rwxrwxrwx···0·····1000·····1000····18687·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/CMakeAutoGenScript.cmake17 -rw-r--r--···0····71588····10513·····1558·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/sndfile_play.m
18 -rwxrwxrwx···0·····1000·····1000·····1659·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindFLAC.cmake18 -rw-r--r--···0····71588····10513····11485·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/sndfile.cc
19 -rwxrwxrwx···0·····1000·····1000·····1407·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindOgg.cmake19 -rw-r--r--···0····71588····10513······112·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/PKG_ADD
20 -rwxrwxrwx···0·····1000·····1000·····1501·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindOpus.cmake20 -rw-r--r--···0····71588····10513·····1483·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Octave/sndfile_load.m
21 -rwxrwxrwx···0·····1000·····1000·····1387·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindSndio.cmake21 -rw-r--r--···0····71588····10513····19776·2020-10-04·13:10:14.000000·libsndfile-1.0.30/Octave/Makefile.in
22 -rwxrwxrwx···0·····1000·····1000·····1211·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindSpeex.cmake22 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/doc/
23 -rwxrwxrwx···0·····1000·····1000·····1451·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindSQLite3.cmake23 -rw-r--r--···0····71588····10513····12652·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/index.html
24 -rwxrwxrwx···0·····1000·····1000·····5508·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/FindVorbis.cmake24 -rw-r--r--···0····71588····10513····38869·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/api.html
25 -rwxrwxrwx···0·····1000·····1000·····8577·2020-09-19·06:51:49.000000·libsndfile-1.0.30/cmake/SndFileChecks.cmake25 -rw-r--r--···0····71588····10513·····1675·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/lists.html
26 -rwxrwxrwx···0·····1000·····1000······875·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/SndFileConfig.cmake.in26 -rw-r--r--···0····71588····10513·····1327·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/sndfile_info.html
27 -rwxrwxrwx···0·····1000·····1000······109·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/TestInline.c.in27 -rw-r--r--···0····71588····10513····12266·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/formats.html
28 -rwxrwxrwx···0·····1000·····1000·····2270·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/TestInline.cmake28 -rw-r--r--···0····71588····10513·····1282·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/win32.html
29 -rwxrwxrwx···0·····1000·····1000·····4375·2020-08-16·04:58:50.000000·libsndfile-1.0.30/cmake/TestLargeFiles.cmake29 -rw-r--r--···0····71588····10513·····4572·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/new_file_type.HOWTO
30 -rwxrwxrwx···0·····1000·····1000····39040·2020-09-19·06:51:49.000000·libsndfile-1.0.30/CMakeLists.txt30 -rw-r--r--···0····71588····10513·····1897·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/libsndfile.css.in
31 -rwxrwxrwx···0·····1000·····1000···822008·2020-09-19·07:25:38.000000·libsndfile-1.0.30/configure31 -rw-r--r--···0····71588····10513·····1441·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/embedded_files.html
32 -rwxrwxrwx···0·····1000·····1000····25968·2020-09-19·06:51:49.000000·libsndfile-1.0.30/configure.ac32 -rw-r--r--···0····71588····10513·····2705·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/bugs.html
33 -rwxrwxrwx···0·····1000·····1000····26518·2020-08-16·04:58:50.000000·libsndfile-1.0.30/COPYING33 -rw-r--r--···0····71588····10513······834·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/tutorial.html
34 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:31.000000·libsndfile-1.0.30/doc/34 -rw-r--r--···0····71588····10513····31070·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/FAQ.html
35 -rwxrwxrwx···0·····1000·····1000····39881·2020-09-19·06:51:49.000000·libsndfile-1.0.30/doc/api.html35 -rw-r--r--···0····71588····10513······122·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/print.css
36 -rwxrwxrwx···0·····1000·····1000·····2705·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/bugs.html36 -rw-r--r--···0····71588····10513····59993·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/command.html
37 -rwxrwxrwx···0·····1000·····1000····62086·2020-09-19·06:51:49.000000·libsndfile-1.0.30/doc/command.html37 -rw-r--r--···0····71588····10513·····1817·2020-10-04·13:12:28.000000·libsndfile-1.0.30/doc/libsndfile.css
38 -rwxrwxrwx···0·····1000·····1000·····1441·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/embedded_files.html38 -rw-r--r--···0····71588····10513····22043·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/libsndfile.jpg
39 -rwxrwxrwx···0·····1000·····1000····31070·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/FAQ.html39 -rw-r--r--···0····71588····10513·····4056·2020-10-04·10:00:49.000000·libsndfile-1.0.30/doc/octave.html
40 -rwxrwxrwx···0·····1000·····1000····12811·2020-09-19·06:51:49.000000·libsndfile-1.0.30/doc/formats.html40 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/cmake/
41 -rwxrwxrwx···0·····1000·····1000····12942·2020-09-19·06:51:49.000000·libsndfile-1.0.30/doc/index.html41 -rw-r--r--···0····71588····10513····18687·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/CMakeAutoGenScript.cmake
42 -rwxrwxrwx···0·····1000·····1000·····1916·2020-09-19·07:27:22.000000·libsndfile-1.0.30/doc/libsndfile.css42 -rw-r--r--···0····71588····10513·····1407·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindOgg.cmake
43 -rwxrwxrwx···0·····1000·····1000·····1996·2020-09-19·06:51:49.000000·libsndfile-1.0.30/doc/libsndfile.css.in43 -rw-r--r--···0····71588····10513·····1226·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/CMakeAutoGen.cmake
44 -rwxrwxrwx···0·····1000·····1000····22043·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/libsndfile.jpg44 -rw-r--r--···0····71588····10513·····1451·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindSQLite3.cmake
45 -rwxrwxrwx···0·····1000·····1000·····1675·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/lists.html45 -rw-r--r--···0····71588····10513·····1501·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindOpus.cmake
46 -rwxrwxrwx···0·····1000·····1000·····4572·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/new_file_type.HOWTO46 -rw-r--r--···0····71588····10513·····1211·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindSpeex.cmake
47 -rwxrwxrwx···0·····1000·····1000·····4056·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/octave.html47 -rw-r--r--···0····71588····10513·····2270·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/TestInline.cmake
48 -rwxrwxrwx···0·····1000·····1000······122·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/print.css48 -rw-r--r--···0····71588····10513·····4375·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/TestLargeFiles.cmake
49 -rwxrwxrwx···0·····1000·····1000·····1327·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/sndfile_info.html49 -rw-r--r--···0····71588····10513·····2055·2020-10-04·10:04:27.000000·libsndfile-1.0.30/cmake/ClipMode.cmake
50 -rwxrwxrwx···0·····1000·····1000······834·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/tutorial.html50 -rw-r--r--···0····71588····10513······109·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/TestInline.c.in
51 -rwxrwxrwx···0·····1000·····1000·····1282·2020-08-16·04:58:50.000000·libsndfile-1.0.30/doc/win32.html51 -rw-r--r--···0····71588····10513······875·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/SndFileConfig.cmake.in
52 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:33.000000·libsndfile-1.0.30/examples/52 -rw-r--r--···0····71588····10513·····1659·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindFLAC.cmake
53 -rwxrwxrwx···0·····1000·····1000·····4412·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/generate.c53 -rw-r--r--···0····71588····10513·····8306·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/SndFileChecks.cmake
54 -rwxrwxrwx···0·····1000·····1000·····2686·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/list_formats.c54 -rw-r--r--···0····71588····10513·····1387·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindSndio.cmake
55 -rwxrwxrwx···0·····1000·····1000·····3242·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/make_sine.c55 -rw-r--r--···0····71588····10513·····5508·2020-10-04·10:00:49.000000·libsndfile-1.0.30/cmake/FindVorbis.cmake
56 -rwxrwxrwx···0·····1000·····1000·····4991·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/sfprocess.c56 -rw-r--r--···0····71588····10513····66367·2020-10-04·13:10:13.000000·libsndfile-1.0.30/aclocal.m4
57 -rwxrwxrwx···0·····1000·····1000·····5280·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/sndfile-loopify.c57 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/programs/
58 -rwxrwxrwx···0·····1000·····1000·····4567·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/sndfile-to-text.c58 -rw-r--r--···0····71588····10513····12529·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-convert.c
59 -rwxrwxrwx···0·····1000·····1000·····2226·2020-08-16·04:58:50.000000·libsndfile-1.0.30/examples/sndfilehandle.cc59 -rwxr-xr-x···0····71588····10513·····6749·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/test-sndfile-metadata-set.py
60 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:31.000000·libsndfile-1.0.30/include/60 -rw-r--r--···0····71588····10513·····4989·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-concat.c
61 -rwxrwxrwx···0·····1000·····1000····30121·2020-09-19·06:51:49.000000·libsndfile-1.0.30/include/sndfile.h.in61 -rw-r--r--···0····71588····10513····24194·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-play.c
62 -rwxrwxrwx···0·····1000·····1000····13220·2020-09-19·06:51:49.000000·libsndfile-1.0.30/include/sndfile.hh62 -rw-r--r--···0····71588····10513·····7358·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-salvage.c
63 -rwxrwxrwx···0·····1000·····1000·····1874·2020-08-16·04:58:50.000000·libsndfile-1.0.30/libsndfile.spec.in63 -rw-r--r--···0····71588····10513····16862·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-info.c
64 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:30.000000·libsndfile-1.0.30/m4/64 -rw-r--r--···0····71588····10513·····3044·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/common.h
65 -rwxrwxrwx···0·····1000·····1000·····1716·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_add_fortify_source.m465 -rw-r--r--···0····71588····10513·····4506·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-cmp.c
66 -rwxrwxrwx···0·····1000·····1000·····2992·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_append_compile_flags.m466 -rw-r--r--···0····71588····10513·····7296·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-metadata-get.c
67 -rwxrwxrwx···0·····1000·····1000·····2779·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_append_flag.m467 -rw-r--r--···0····71588····10513····10272·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-metadata-set.c
68 -rwxrwxrwx···0·····1000·····1000·····2938·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_append_link_flags.m468 -rw-r--r--···0····71588····10513·····5548·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-interleave.c
69 -rwxrwxrwx···0·····1000·····1000·····3331·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_check_compile_flag.m469 -rw-r--r--···0····71588····10513·····5752·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/sndfile-deinterleave.c
70 -rwxrwxrwx···0·····1000·····1000·····3183·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_check_link_flag.m470 -rw-r--r--···0····71588····10513····14950·2020-10-04·10:00:49.000000·libsndfile-1.0.30/programs/common.c
71 -rwxrwxrwx···0·····1000·····1000·····3606·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_compiler_vendor.m471 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/ossfuzz/
72 -rwxrwxrwx···0·····1000·····1000····21739·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_compiler_version.m472 -rw-r--r--···0····71588····10513·······96·2020-10-04·10:00:49.000000·libsndfile-1.0.30/ossfuzz/testinput.h
73 -rwxrwxrwx···0·····1000·····1000·····2408·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_recursive_eval.m473 -rw-r--r--···0····71588····10513·····2533·2020-10-04·10:00:49.000000·libsndfile-1.0.30/ossfuzz/sndfile_fuzzer.cc
74 -rwxrwxrwx···0·····1000·····1000·····1218·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/ax_require_defined.m474 -rw-r--r--···0····71588····10513·····2081·2020-10-04·10:00:49.000000·libsndfile-1.0.30/ossfuzz/standaloneengine.cc
75 -rwxrwxrwx···0·····1000·····1000·····2378·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/clip_mode.m475 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/m4/
76 -rwxrwxrwx···0·····1000·····1000·····3628·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/extra_pkg.m476 -rw-r--r--···0····71588····10513·····3331·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_check_compile_flag.m4
77 -rwxrwxrwx···0·····1000·····1000···306432·2020-09-19·07:25:32.000000·libsndfile-1.0.30/m4/libtool.m477 -rw-r--r--···0····71588····10513·····6140·2020-10-04·13:10:10.000000·libsndfile-1.0.30/m4/lt~obsolete.m4
78 -rwxrwxrwx···0·····1000·····1000····14514·2020-09-19·07:25:33.000000·libsndfile-1.0.30/m4/ltoptions.m478 -rw-r--r--···0····71588····10513···306304·2020-10-04·13:10:10.000000·libsndfile-1.0.30/m4/libtool.m4
79 -rwxrwxrwx···0·····1000·····1000·····4384·2020-09-19·07:25:33.000000·libsndfile-1.0.30/m4/ltsugar.m479 -rw-r--r--···0····71588····10513·····1716·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_add_fortify_source.m4
80 -rwxrwxrwx···0·····1000·····1000······699·2020-09-19·07:25:33.000000·libsndfile-1.0.30/m4/ltversion.m480 -rw-r--r--···0····71588····10513·····2408·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_recursive_eval.m4
81 -rwxrwxrwx···0·····1000·····1000·····6140·2020-09-19·07:25:33.000000·libsndfile-1.0.30/m4/lt~obsolete.m481 -rw-r--r--···0····71588····10513·····3628·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/extra_pkg.m4
82 -rwxrwxrwx···0·····1000·····1000·····1145·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/mkoctfile_version.m482 -rw-r--r--···0····71588····10513·····3606·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_compiler_vendor.m4
83 -rwxrwxrwx···0·····1000·····1000·····4287·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/octave.m483 -rw-r--r--···0····71588····10513····21739·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_compiler_version.m4
84 -rwxrwxrwx···0·····1000·····1000·····2940·2020-08-16·04:58:50.000000·libsndfile-1.0.30/m4/stack_protect.m484 -rw-r--r--···0····71588····10513·····4287·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/octave.m4
85 -rwxrwxrwx···0·····1000·····1000····20399·2020-09-19·06:51:49.000000·libsndfile-1.0.30/Makefile.am85 -rw-r--r--···0····71588····10513·····1218·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_require_defined.m4
86 -rwxrwxrwx···0·····1000·····1000···246186·2020-09-19·07:25:41.000000·libsndfile-1.0.30/Makefile.in86 -rw-r--r--···0····71588····10513·····4384·2020-10-04·13:10:10.000000·libsndfile-1.0.30/m4/ltsugar.m4
87 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:31.000000·libsndfile-1.0.30/man/87 -rw-r--r--···0····71588····10513·····2938·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_append_link_flags.m4
88 -rwxrwxrwx···0·····1000·····1000······726·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-cmp.188 -rw-r--r--···0····71588····10513······699·2020-10-04·13:10:10.000000·libsndfile-1.0.30/m4/ltversion.m4
89 -rwxrwxrwx···0·····1000·····1000······725·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-concat.189 -rw-r--r--···0····71588····10513·····2940·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/stack_protect.m4
90 -rwxrwxrwx···0·····1000·····1000·····3285·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-convert.190 -rw-r--r--···0····71588····10513·····2992·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_append_compile_flags.m4
91 -rwxrwxrwx···0·····1000·····1000·····1752·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-deinterleave.191 -rw-r--r--···0····71588····10513·····2378·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/clip_mode.m4
92 -rwxrwxrwx···0·····1000·····1000······793·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-info.192 -rw-r--r--···0····71588····10513·····1145·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/mkoctfile_version.m4
93 -rwxrwxrwx···0·····1000·····1000·····1752·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-interleave.193 -rw-r--r--···0····71588····10513·····3183·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_check_link_flag.m4
94 -rwxrwxrwx···0·····1000·····1000·····2476·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-metadata-get.194 -rw-r--r--···0····71588····10513····14514·2020-10-04·13:10:10.000000·libsndfile-1.0.30/m4/ltoptions.m4
95 -rwxrwxrwx···0·····1000·····1000·····2476·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-metadata-set.195 -rw-r--r--···0····71588····10513·····2779·2020-10-04·10:00:49.000000·libsndfile-1.0.30/m4/ax_append_flag.m4
96 -rwxrwxrwx···0·····1000·····1000······625·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-play.196 -rw-r--r--···0····71588····10513····20399·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Makefile.am
97 -rwxrwxrwx···0·····1000·····1000······741·2020-08-16·04:58:50.000000·libsndfile-1.0.30/man/sndfile-salvage.197 -rw-r--r--···0····71588····10513······279·2020-10-04·10:00:49.000000·libsndfile-1.0.30/sndfile.pc.in
98 -rwxrwxrwx···0·····1000·····1000·····9354·2020-09-19·06:51:49.000000·libsndfile-1.0.30/NEWS98 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/man/
99 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:36.000000·libsndfile-1.0.30/Octave/99 -rw-r--r--···0····71588····10513······725·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-concat.1
100 -rwxrwxrwx···0·····1000·····1000·····2710·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/Makefile.am100 -rw-r--r--···0····71588····10513······793·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-info.1
101 -rwxrwxrwx···0·····1000·····1000····19776·2020-09-19·07:25:41.000000·libsndfile-1.0.30/Octave/Makefile.in101 -rw-r--r--···0····71588····10513······741·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-salvage.1
102 -rwxrwxrwx···0·····1000·····1000·····1606·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/octave_test.m102 -rw-r--r--···0····71588····10513·····1752·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-interleave.1
103 -rwxrwxrwx···0·····1000·····1000·····1849·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/octave_test.sh103 -rw-r--r--···0····71588····10513·····2476·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-metadata-get.1
104 -rwxrwxrwx···0·····1000·····1000······112·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/PKG_ADD104 -rw-r--r--···0····71588····10513······726·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-cmp.1
105 -rwxrwxrwx···0·····1000·····1000····11485·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/sndfile.cc105 -rw-r--r--···0····71588····10513·····2476·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-metadata-set.1
106 -rwxrwxrwx···0·····1000·····1000·····1483·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/sndfile_load.m106 -rw-r--r--···0····71588····10513·····1752·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-deinterleave.1
107 -rwxrwxrwx···0·····1000·····1000·····1558·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/sndfile_play.m107 -rw-r--r--···0····71588····10513·····3285·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-convert.1
108 -rwxrwxrwx···0·····1000·····1000·····1595·2020-08-16·04:58:50.000000·libsndfile-1.0.30/Octave/sndfile_save.m108 -rw-r--r--···0····71588····10513······625·2020-10-04·10:00:49.000000·libsndfile-1.0.30/man/sndfile-play.1
109 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:33.000000·libsndfile-1.0.30/ossfuzz/109 -rw-r--r--···0····71588····10513·····1874·2020-10-04·10:00:49.000000·libsndfile-1.0.30/libsndfile.spec.in
110 -rwxrwxrwx···0·····1000·····1000·····2667·2020-09-19·06:51:49.000000·libsndfile-1.0.30/ossfuzz/sndfile_fuzzer.cc110 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/Scripts/
111 -rwxrwxrwx···0·····1000·····1000·····2167·2020-09-19·06:51:49.000000·libsndfile-1.0.30/ossfuzz/standaloneengine.cc111 -rwxr-xr-x···0····71588····10513······402·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Scripts/linux-to-win-cross-configure.sh
112 -rwxrwxrwx···0·····1000·····1000·······99·2020-09-19·06:51:49.000000·libsndfile-1.0.30/ossfuzz/testinput.h112 -rw-r--r--···0····71588····10513·····1755·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Scripts/build-test-tarball.mk.in
113 drwxrwxrwx···0·····1000·····1000········0·2020-09-19·07:27:36.000000·libsndfile-1.0.30/programs/113 -rwxr-xr-x···0····71588····10513·····4096·2020-10-04·10:00:49.000000·libsndfile-1.0.30/Scripts/android-configure.sh
114 -rwxrwxrwx···0·····1000·····1000····14950·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/common.c114 drwxr-xr-x···0····71588····10513········0·2020-10-04·13:12:55.000000·libsndfile-1.0.30/tests/
115 -rwxrwxrwx···0·····1000·····1000·····3044·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/common.h115 -rw-r--r--···0····71588····10513·····7208·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/ulaw_test.c
116 -rwxrwxrwx···0·····1000·····1000·····4506·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-cmp.c116 -rw-r--r--···0····71588····10513····11787·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/peak_chunk_test.c
117 -rwxrwxrwx···0·····1000·····1000·····4989·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-concat.c117 -rw-r--r--···0····71588····10513·····5090·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/dither_test.c
118 -rwxrwxrwx···0·····1000·····1000····12529·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-convert.c118 -rw-r--r--···0····71588····10513····14509·2020-10-04·10:00:49.000000·libsndfile-1.0.30/tests/test_wrapper.sh.in
119 -rwxrwxrwx···0·····1000·····1000·····5752·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-deinterleave.c119 -rw-r--r--···0····71588····10513····28510·2020-10-04·13:12:55.000000·libsndfile-1.0.30/tests/utils.c
120 -rwxrwxrwx···0·····1000·····1000····16862·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-info.c120 -rw-r--r--···0····71588····10513·····9046·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/long_read_write_test.c
121 -rwxrwxrwx···0·····1000·····1000·····5548·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-interleave.c121 -rw-r--r--···0····71588····10513·····2529·2020-10-04·10:00:49.000000·libsndfile-1.0.30/tests/rdwr_test.tpl
122 -rwxrwxrwx···0·····1000·····1000·····7296·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-metadata-get.c122 -rw-r--r--···0····71588····10513······474·2020-10-04·10:00:49.000000·libsndfile-1.0.30/tests/rdwr_test.def
123 -rwxrwxrwx···0·····1000·····1000····10272·2020-08-16·04:58:50.000000·libsndfile-1.0.30/programs/sndfile-metadata-set.c123 -rw-r--r--···0····71588····10513····63953·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/command_test.c
124 -rwxrwxrwx···0·····1000·····1000····25054·2020-09-19·06:51:49.000000·libsndfile-1.0.30/programs/sndfile-play.c124 -rw-r--r--···0····71588····10513·····3426·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/win32_ordinal_test.c
125 -rwxrwxrwx···0·····1000·····1000·····7358·2020-08-16·04:58:51.000000·libsndfile-1.0.30/programs/sndfile-salvage.c125 -rw-r--r--···0····71588····10513····18815·2020-10-04·10:00:49.000000·libsndfile-1.0.30/tests/header_test.tpl
126 -rwxrwxrwx···0·····1000·····1000·····6749·2020-08-16·04:58:51.000000·libsndfile-1.0.30/programs/test-sndfile-metadata-set.py126 -rw-r--r--···0····71588····10513·····5133·2020-10-04·10:06:32.000000·libsndfile-1.0.30/tests/stdin_test.c
127 -rwxrwxrwx···0·····1000·····1000·····2028·2020-08-16·04:58:50.000000·libsndfile-1.0.30/README127 -rw-r--r--···0····71588····10513····16031·2020-10-04·10:00:49.000000·libsndfile-1.0.30/tests/scale_clip_test.tpl
Max diff block lines reached; -1/76908 bytes (-0.00%) of diff not shown.
14.2 KB
libsndfile-1.0.30/aclocal.m4
    
Offset 1, 10 lines modifiedOffset 1, 10 lines modified
1 #·generated·automatically·by·aclocal·1.16.1·-*-·Autoconf·-*-1 #·generated·automatically·by·aclocal·1.16.2·-*-·Autoconf·-*-
  
2 #·Copyright·(C)·1996-2018·Free·Software·Foundation,·Inc.2 #·Copyright·(C)·1996-2020·Free·Software·Foundation,·Inc.
  
3 #·This·file·is·free·software;·the·Free·Software·Foundation3 #·This·file·is·free·software;·the·Free·Software·Foundation
4 #·gives·unlimited·permission·to·copy·and/or·distribute·it,4 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
5 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.5 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
6 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,6 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
7 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without7 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without
Offset 360, 30 lines modifiedOffset 360, 30 lines modified
360 [360 [
361 PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])361 PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
  
362 AS_IF([test·"$AS_TR_SH([with_]m4_tolower([$1]))"·=·"yes"],362 AS_IF([test·"$AS_TR_SH([with_]m4_tolower([$1]))"·=·"yes"],
363 ········[AC_DEFINE([HAVE_][$1],·1,·[Enable·]m4_tolower([$1])[·support])])363 ········[AC_DEFINE([HAVE_][$1],·1,·[Enable·]m4_tolower([$1])[·support])])
364 ])dnl·PKG_HAVE_DEFINE_WITH_MODULES364 ])dnl·PKG_HAVE_DEFINE_WITH_MODULES
  
365 #·Copyright·(C)·2002-2018·Free·Software·Foundation,·Inc.365 #·Copyright·(C)·2002-2020·Free·Software·Foundation,·Inc.
366 #366 #
367 #·This·file·is·free·software;·the·Free·Software·Foundation367 #·This·file·is·free·software;·the·Free·Software·Foundation
368 #·gives·unlimited·permission·to·copy·and/or·distribute·it,368 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
369 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.369 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
370 #·AM_AUTOMAKE_VERSION(VERSION)370 #·AM_AUTOMAKE_VERSION(VERSION)
371 #·----------------------------371 #·----------------------------
372 #·Automake·X.Y·traces·this·macro·to·ensure·aclocal.m4·has·been372 #·Automake·X.Y·traces·this·macro·to·ensure·aclocal.m4·has·been
373 #·generated·from·the·m4·files·accompanying·Automake·X.Y.373 #·generated·from·the·m4·files·accompanying·Automake·X.Y.
374 #·(This·private·macro·should·not·be·called·outside·this·file.)374 #·(This·private·macro·should·not·be·called·outside·this·file.)
375 AC_DEFUN([AM_AUTOMAKE_VERSION],375 AC_DEFUN([AM_AUTOMAKE_VERSION],
376 [am__api_version='1.16'376 [am__api_version='1.16'
377 dnl·Some·users·find·AM_AUTOMAKE_VERSION·and·mistake·it·for·a·way·to377 dnl·Some·users·find·AM_AUTOMAKE_VERSION·and·mistake·it·for·a·way·to
378 dnl·require·some·minimum·version.··Point·them·to·the·right·macro.378 dnl·require·some·minimum·version.··Point·them·to·the·right·macro.
379 m4_if([$1],·[1.16.1],·[],379 m4_if([$1],·[1.16.2],·[],
380 ······[AC_FATAL([Do·not·call·$0,·use·AM_INIT_AUTOMAKE([$1]).])])dnl380 ······[AC_FATAL([Do·not·call·$0,·use·AM_INIT_AUTOMAKE([$1]).])])dnl
381 ])381 ])
  
382 #·_AM_AUTOCONF_VERSION(VERSION)382 #·_AM_AUTOCONF_VERSION(VERSION)
383 #·-----------------------------383 #·-----------------------------
384 #·aclocal·traces·this·macro·to·find·the·Autoconf·version.384 #·aclocal·traces·this·macro·to·find·the·Autoconf·version.
385 #·This·is·a·private·macro·too.··Using·m4_define·simplifies385 #·This·is·a·private·macro·too.··Using·m4_define·simplifies
Offset 391, 20 lines modifiedOffset 391, 20 lines modified
391 m4_define([_AM_AUTOCONF_VERSION],·[])391 m4_define([_AM_AUTOCONF_VERSION],·[])
  
392 #·AM_SET_CURRENT_AUTOMAKE_VERSION392 #·AM_SET_CURRENT_AUTOMAKE_VERSION
393 #·-------------------------------393 #·-------------------------------
394 #·Call·AM_AUTOMAKE_VERSION·and·AM_AUTOMAKE_VERSION·so·they·can·be·traced.394 #·Call·AM_AUTOMAKE_VERSION·and·AM_AUTOMAKE_VERSION·so·they·can·be·traced.
395 #·This·function·is·AC_REQUIREd·by·AM_INIT_AUTOMAKE.395 #·This·function·is·AC_REQUIREd·by·AM_INIT_AUTOMAKE.
396 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],396 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
397 [AM_AUTOMAKE_VERSION([1.16.1])dnl397 [AM_AUTOMAKE_VERSION([1.16.2])dnl
398 m4_ifndef([AC_AUTOCONF_VERSION],398 m4_ifndef([AC_AUTOCONF_VERSION],
399 ··[m4_copy([m4_PACKAGE_VERSION],·[AC_AUTOCONF_VERSION])])dnl399 ··[m4_copy([m4_PACKAGE_VERSION],·[AC_AUTOCONF_VERSION])])dnl
400 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])400 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  
401 #·Copyright·(C)·2011-2018·Free·Software·Foundation,·Inc.401 #·Copyright·(C)·2011-2020·Free·Software·Foundation,·Inc.
402 #402 #
403 #·This·file·is·free·software;·the·Free·Software·Foundation403 #·This·file·is·free·software;·the·Free·Software·Foundation
404 #·gives·unlimited·permission·to·copy·and/or·distribute·it,404 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
405 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.405 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
406 #·AM_PROG_AR([ACT-IF-FAIL])406 #·AM_PROG_AR([ACT-IF-FAIL])
407 #·-------------------------407 #·-------------------------
Offset 458, 15 lines modifiedOffset 458, 15 lines modified
458 ··;;458 ··;;
459 esac459 esac
460 AC_SUBST([AR])dnl460 AC_SUBST([AR])dnl
461 ])461 ])
  
462 #·AM_AUX_DIR_EXPAND·········································-*-·Autoconf·-*-462 #·AM_AUX_DIR_EXPAND·········································-*-·Autoconf·-*-
  
463 #·Copyright·(C)·2001-2018·Free·Software·Foundation,·Inc.463 #·Copyright·(C)·2001-2020·Free·Software·Foundation,·Inc.
464 #464 #
465 #·This·file·is·free·software;·the·Free·Software·Foundation465 #·This·file·is·free·software;·the·Free·Software·Foundation
466 #·gives·unlimited·permission·to·copy·and/or·distribute·it,466 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
467 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.467 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
468 #·For·projects·using·AC_CONFIG_AUX_DIR([foo]),·Autoconf·sets468 #·For·projects·using·AC_CONFIG_AUX_DIR([foo]),·Autoconf·sets
469 #·$ac_aux_dir·to·'$srcdir/foo'.··In·other·projects,·it·is·set·to469 #·$ac_aux_dir·to·'$srcdir/foo'.··In·other·projects,·it·is·set·to
Offset 510, 15 lines modifiedOffset 510, 15 lines modified
510 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl510 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
511 #·Expand·$ac_aux_dir·to·an·absolute·path.511 #·Expand·$ac_aux_dir·to·an·absolute·path.
512 am_aux_dir=`cd·"$ac_aux_dir"·&&·pwd`512 am_aux_dir=`cd·"$ac_aux_dir"·&&·pwd`
513 ])513 ])
  
514 #·AM_CONDITIONAL············································-*-·Autoconf·-*-514 #·AM_CONDITIONAL············································-*-·Autoconf·-*-
  
515 #·Copyright·(C)·1997-2018·Free·Software·Foundation,·Inc.515 #·Copyright·(C)·1997-2020·Free·Software·Foundation,·Inc.
516 #516 #
517 #·This·file·is·free·software;·the·Free·Software·Foundation517 #·This·file·is·free·software;·the·Free·Software·Foundation
518 #·gives·unlimited·permission·to·copy·and/or·distribute·it,518 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
519 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.519 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
520 #·AM_CONDITIONAL(NAME,·SHELL-CONDITION)520 #·AM_CONDITIONAL(NAME,·SHELL-CONDITION)
521 #·-------------------------------------521 #·-------------------------------------
Offset 541, 15 lines modifiedOffset 541, 15 lines modified
541 fi541 fi
542 AC_CONFIG_COMMANDS_PRE(542 AC_CONFIG_COMMANDS_PRE(
543 [if·test·-z·"${$1_TRUE}"·&&·test·-z·"${$1_FALSE}";·then543 [if·test·-z·"${$1_TRUE}"·&&·test·-z·"${$1_FALSE}";·then
544 ··AC_MSG_ERROR([[conditional·"$1"·was·never·defined.544 ··AC_MSG_ERROR([[conditional·"$1"·was·never·defined.
545 Usually·this·means·the·macro·was·only·invoked·conditionally.]])545 Usually·this·means·the·macro·was·only·invoked·conditionally.]])
546 fi])])546 fi])])
  
547 #·Copyright·(C)·1999-2018·Free·Software·Foundation,·Inc.547 #·Copyright·(C)·1999-2020·Free·Software·Foundation,·Inc.
548 #548 #
549 #·This·file·is·free·software;·the·Free·Software·Foundation549 #·This·file·is·free·software;·the·Free·Software·Foundation
550 #·gives·unlimited·permission·to·copy·and/or·distribute·it,550 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
551 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.551 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
  
552 #·There·are·a·few·dirty·hacks·below·to·avoid·letting·'AC_PROG_CC'·be552 #·There·are·a·few·dirty·hacks·below·to·avoid·letting·'AC_PROG_CC'·be
Offset 732, 15 lines modifiedOffset 732, 15 lines modified
732 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl732 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
733 AC_SUBST([am__nodep])dnl733 AC_SUBST([am__nodep])dnl
734 _AM_SUBST_NOTMAKE([am__nodep])dnl734 _AM_SUBST_NOTMAKE([am__nodep])dnl
735 ])735 ])
  
736 #·Generate·code·to·set·up·dependency·tracking.··············-*-·Autoconf·-*-736 #·Generate·code·to·set·up·dependency·tracking.··············-*-·Autoconf·-*-
  
737 #·Copyright·(C)·1999-2018·Free·Software·Foundation,·Inc.737 #·Copyright·(C)·1999-2020·Free·Software·Foundation,·Inc.
738 #738 #
739 #·This·file·is·free·software;·the·Free·Software·Foundation739 #·This·file·is·free·software;·the·Free·Software·Foundation
740 #·gives·unlimited·permission·to·copy·and/or·distribute·it,740 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
741 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.741 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
742 #·_AM_OUTPUT_DEPENDENCY_COMMANDS742 #·_AM_OUTPUT_DEPENDENCY_COMMANDS
743 #·------------------------------743 #·------------------------------
Offset 771, 15 lines modifiedOffset 771, 17 lines modified
Max diff block lines reached; 9278/14522 bytes (63.89%) of diff not shown.
1.87 KB
libsndfile-1.0.30/build-aux/ar-lib
    
Offset 1, 14 lines modifiedOffset 1, 14 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·Wrapper·for·Microsoft·lib.exe2 #·Wrapper·for·Microsoft·lib.exe
  
3 me=ar-lib3 me=ar-lib
4 scriptversion=2012-03-01.08;·#·UTC4 scriptversion=2019-07-04.01;·#·UTC
  
5 #·Copyright·(C)·2010-2018·Free·Software·Foundation,·Inc.5 #·Copyright·(C)·2010-2020·Free·Software·Foundation,·Inc.
6 #·Written·by·Peter·Rosin·<peda@lysator.liu.se>.6 #·Written·by·Peter·Rosin·<peda@lysator.liu.se>.
7 #7 #
8 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify8 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
9 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by9 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
10 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)10 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)
11 #·any·later·version.11 #·any·later·version.
12 #12 #
Offset 49, 27 lines modifiedOffset 49, 27 lines modified
49 ····/·|·/[!/]*)·#·absolute·file,·and·not·a·UNC·file49 ····/·|·/[!/]*)·#·absolute·file,·and·not·a·UNC·file
50 ······if·test·-z·"$file_conv";·then50 ······if·test·-z·"$file_conv";·then
51 »       #·lazily·determine·how·to·convert·abs·files51 »       #·lazily·determine·how·to·convert·abs·files
52 »       case·`uname·-s`·in52 »       case·`uname·-s`·in
53 »       ··MINGW*)53 »       ··MINGW*)
54 »       ····file_conv=mingw54 »       ····file_conv=mingw
55 »       ····;;55 »       ····;;
56 »       ··CYGWIN*)56 »       ··CYGWIN*·|·MSYS*)
57 »       ····file_conv=cygwin57 »       ····file_conv=cygwin
58 »       ····;;58 »       ····;;
59 »       ··*)59 »       ··*)
60 »       ····file_conv=wine60 »       ····file_conv=wine
61 »       ····;;61 »       ····;;
62 »       esac62 »       esac
63 ······fi63 ······fi
64 ······case·$file_conv·in64 ······case·$file_conv·in
65 »       mingw)65 »       mingw)
66 »       ··file=`cmd·//C·echo·"$file·"·|·sed·-e·'s/"\(.*\)·"·*$/\1/'`66 »       ··file=`cmd·//C·echo·"$file·"·|·sed·-e·'s/"\(.*\)·"·*$/\1/'`
67 »       ··;;67 »       ··;;
68 »       cygwin)68 »       cygwin·|·msys)
69 »       ··file=`cygpath·-m·"$file"·||·echo·"$file"`69 »       ··file=`cygpath·-m·"$file"·||·echo·"$file"`
70 »       ··;;70 »       ··;;
71 »       wine)71 »       wine)
72 »       ··file=`winepath·-w·"$file"·||·echo·"$file"`72 »       ··file=`winepath·-w·"$file"·||·echo·"$file"`
73 »       ··;;73 »       ··;;
74 ······esac74 ······esac
75 ······;;75 ······;;
Offset 220, 18 lines modifiedOffset 220, 19 lines modified
220 ········*)220 ········*)
221 ··········func_file_conv·"$1"221 ··········func_file_conv·"$1"
222 ··········$AR·-NOLOGO·-EXTRACT:"$file"·"$archive"·||·exit·$?222 ··········$AR·-NOLOGO·-EXTRACT:"$file"·"$archive"·||·exit·$?
223 ··········;;223 ··········;;
224 ······esac224 ······esac
225 ····done225 ····done
226 ··else226 ··else
227 ····$AR·-NOLOGO·-LIST·"$archive"·|·sed·-e·'s/\\/\\\\/g'·|·while·read·member227 ····$AR·-NOLOGO·-LIST·"$archive"·|·tr·-d·'\r'·|·sed·-e·'s/\\/\\\\/g'·\
228 ····do228 ······|·while·read·member
229 ······$AR·-NOLOGO·-EXTRACT:"$member"·"$archive"·||·exit·$?229 ········do
230 ····done230 ··········$AR·-NOLOGO·-EXTRACT:"$member"·"$archive"·||·exit·$?
 231 ········done
231 ··fi232 ··fi
  
232 elif·test·-n·"$quick$replace";·then233 elif·test·-n·"$quick$replace";·then
233 ··if·test·!·-f·"$orig_archive";·then234 ··if·test·!·-f·"$orig_archive";·then
234 ····if·test·-z·"$create";·then235 ····if·test·-z·"$create";·then
235 ······echo·"$me:·creating·$orig_archive"236 ······echo·"$me:·creating·$orig_archive"
236 ····fi237 ····fi
1.22 KB
libsndfile-1.0.30/build-aux/compile
    
Offset 1, 13 lines modifiedOffset 1, 13 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·Wrapper·for·compilers·which·do·not·understand·'-c·-o'.2 #·Wrapper·for·compilers·which·do·not·understand·'-c·-o'.
  
3 scriptversion=2018-03-07.03;·#·UTC3 scriptversion=2018-03-07.03;·#·UTC
  
4 #·Copyright·(C)·1999-2018·Free·Software·Foundation,·Inc.4 #·Copyright·(C)·1999-2020·Free·Software·Foundation,·Inc.
5 #·Written·by·Tom·Tromey·<tromey@cygnus.com>.5 #·Written·by·Tom·Tromey·<tromey@cygnus.com>.
6 #6 #
7 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify7 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
8 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by8 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
9 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)9 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)
10 #·any·later·version.10 #·any·later·version.
11 #11 #
Offset 49, 29 lines modifiedOffset 49, 29 lines modified
49 ····/·|·/[!/]*)·#·absolute·file,·and·not·a·UNC·file49 ····/·|·/[!/]*)·#·absolute·file,·and·not·a·UNC·file
50 ······if·test·-z·"$file_conv";·then50 ······if·test·-z·"$file_conv";·then
51 »       #·lazily·determine·how·to·convert·abs·files51 »       #·lazily·determine·how·to·convert·abs·files
52 »       case·`uname·-s`·in52 »       case·`uname·-s`·in
53 »       ··MINGW*)53 »       ··MINGW*)
54 »       ····file_conv=mingw54 »       ····file_conv=mingw
55 »       ····;;55 »       ····;;
56 »       ··CYGWIN*)56 »       ··CYGWIN*·|·MSYS*)
57 »       ····file_conv=cygwin57 »       ····file_conv=cygwin
58 »       ····;;58 »       ····;;
59 »       ··*)59 »       ··*)
60 »       ····file_conv=wine60 »       ····file_conv=wine
61 »       ····;;61 »       ····;;
62 »       esac62 »       esac
63 ······fi63 ······fi
64 ······case·$file_conv/,$2,·in64 ······case·$file_conv/,$2,·in
65 »       *,$file_conv,*)65 »       *,$file_conv,*)
66 »       ··;;66 »       ··;;
67 »       mingw/*)67 »       mingw/*)
68 »       ··file=`cmd·//C·echo·"$file·"·|·sed·-e·'s/"\(.*\)·"·*$/\1/'`68 »       ··file=`cmd·//C·echo·"$file·"·|·sed·-e·'s/"\(.*\)·"·*$/\1/'`
69 »       ··;;69 »       ··;;
70 »       cygwin/*)70 »       cygwin/*·|·msys/*)
71 »       ··file=`cygpath·-m·"$file"·||·echo·"$file"`71 »       ··file=`cygpath·-m·"$file"·||·echo·"$file"`
72 »       ··;;72 »       ··;;
73 »       wine/*)73 »       wine/*)
74 »       ··file=`winepath·-w·"$file"·||·echo·"$file"`74 »       ··file=`winepath·-w·"$file"·||·echo·"$file"`
75 »       ··;;75 »       ··;;
76 ······esac76 ······esac
77 ······;;77 ······;;
23.8 KB
libsndfile-1.0.30/build-aux/config.guess
    
Offset 1, 12 lines modifiedOffset 1, 12 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·Attempt·to·guess·a·canonical·system·name.2 #·Attempt·to·guess·a·canonical·system·name.
3 #···Copyright·1992-2018·Free·Software·Foundation,·Inc.3 #···Copyright·1992-2020·Free·Software·Foundation,·Inc.
  
4 timestamp='2018-02-24'4 timestamp='2020-04-26'
  
5 #·This·file·is·free·software;·you·can·redistribute·it·and/or·modify·it5 #·This·file·is·free·software;·you·can·redistribute·it·and/or·modify·it
6 #·under·the·terms·of·the·GNU·General·Public·License·as·published·by6 #·under·the·terms·of·the·GNU·General·Public·License·as·published·by
7 #·the·Free·Software·Foundation;·either·version·3·of·the·License,·or7 #·the·Free·Software·Foundation;·either·version·3·of·the·License,·or
8 #·(at·your·option)·any·later·version.8 #·(at·your·option)·any·later·version.
9 #9 #
10 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,·but10 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,·but
Offset 46, 15 lines modifiedOffset 46, 15 lines modified
  
46 Report·bugs·and·patches·to·<config-patches@gnu.org>."46 Report·bugs·and·patches·to·<config-patches@gnu.org>."
  
47 version="\47 version="\
48 GNU·config.guess·($timestamp)48 GNU·config.guess·($timestamp)
  
49 Originally·written·by·Per·Bothner.49 Originally·written·by·Per·Bothner.
50 Copyright·1992-2018·Free·Software·Foundation,·Inc.50 Copyright·1992-2020·Free·Software·Foundation,·Inc.
  
51 This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO51 This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO
52 warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE."52 warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE."
  
53 help="53 help="
54 Try·\`$me·--help'·for·more·information."54 Try·\`$me·--help'·for·more·information."
  
Offset 80, 69 lines modifiedOffset 80, 73 lines modified
80 done80 done
  
81 if·test·$#·!=·0;·then81 if·test·$#·!=·0;·then
82 ··echo·"$me:·too·many·arguments$help"·>&282 ··echo·"$me:·too·many·arguments$help"·>&2
83 ··exit·183 ··exit·1
84 fi84 fi
  
85 trap·'exit·1'·1·2·15 
  
86 #·CC_FOR_BUILD·--·compiler·used·by·this·script.·Note·that·the·use·of·a85 #·CC_FOR_BUILD·--·compiler·used·by·this·script.·Note·that·the·use·of·a
87 #·compiler·to·aid·in·system·detection·is·discouraged·as·it·requires86 #·compiler·to·aid·in·system·detection·is·discouraged·as·it·requires
88 #·temporary·files·to·be·created·and,·as·you·can·see·below,·it·is·a87 #·temporary·files·to·be·created·and,·as·you·can·see·below,·it·is·a
89 #·headache·to·deal·with·in·a·portable·fashion.88 #·headache·to·deal·with·in·a·portable·fashion.
  
90 #·Historically,·`CC_FOR_BUILD'·used·to·be·named·`HOST_CC'.·We·still89 #·Historically,·`CC_FOR_BUILD'·used·to·be·named·`HOST_CC'.·We·still
91 #·use·`HOST_CC'·if·defined,·but·it·is·deprecated.90 #·use·`HOST_CC'·if·defined,·but·it·is·deprecated.
  
92 #·Portable·tmp·directory·creation·inspired·by·the·Autoconf·team.91 #·Portable·tmp·directory·creation·inspired·by·the·Autoconf·team.
  
93 set_cc_for_build='92 tmp=
94 trap·"exitcode=\$?;·(rm·-f·\$tmpfiles·2>/dev/null;·rmdir·\$tmp·2>/dev/null)·&&·exit·\$exitcode"·0·;93 #·shellcheck·disable=SC2172
95 trap·"rm·-f·\$tmpfiles·2>/dev/null;·rmdir·\$tmp·2>/dev/null;·exit·1"·1·2·13·15·;94 trap·'test·-z·"$tmp"·||·rm·-fr·"$tmp"'·0·1·2·13·15
96 :·${TMPDIR=/tmp}·; 
97 ·{·tmp=`(umask·077·&&·mktemp·-d·"$TMPDIR/cgXXXXXX")·2>/dev/null`·&&·test·-n·"$tmp"·&&·test·-d·"$tmp"·;·}·||95 set_cc_for_build()·{
98 ·{·test·-n·"$RANDOM"·&&·tmp=$TMPDIR/cg$$-$RANDOM·&&·(umask·077·&&·mkdir·$tmp)·;·}·||96 ····#·prevent·multiple·calls·if·$tmp·is·already·set
99 ·{·tmp=$TMPDIR/cg-$$·&&·(umask·077·&&·mkdir·$tmp)·&&·echo·"Warning:·creating·insecure·temp·directory"·>&2·;·}·||97 ····test·"$tmp"·&&·return·0
100 ·{·echo·"$me:·cannot·create·a·temporary·directory·in·$TMPDIR"·>&2·;·exit·1·;·}·;98 ····:·"${TMPDIR=/tmp}"
101 dummy=$tmp/dummy·;99 ····#·shellcheck·disable=SC2039
102 tmpfiles="$dummy.c·$dummy.o·$dummy.rel·$dummy"·;100 ····{·tmp=`(umask·077·&&·mktemp·-d·"$TMPDIR/cgXXXXXX")·2>/dev/null`·&&·test·-n·"$tmp"·&&·test·-d·"$tmp"·;·}·||
103 case·$CC_FOR_BUILD,$HOST_CC,$CC·in101 »       {·test·-n·"$RANDOM"·&&·tmp=$TMPDIR/cg$$-$RANDOM·&&·(umask·077·&&·mkdir·"$tmp"·2>/dev/null)·;·}·||
104 ·,,)····echo·"int·x;"·>·"$dummy.c"·;102 »       {·tmp=$TMPDIR/cg-$$·&&·(umask·077·&&·mkdir·"$tmp"·2>/dev/null)·&&·echo·"Warning:·creating·insecure·temp·directory"·>&2·;·}·||
105 »       for·c·in·cc·gcc·c89·c99·;·do103 »       {·echo·"$me:·cannot·create·a·temporary·directory·in·$TMPDIR"·>&2·;·exit·1·;·}
106 »       ··if·($c·-c·-o·"$dummy.o"·"$dummy.c")·>/dev/null·2>&1·;·then104 ····dummy=$tmp/dummy
107 »       ·····CC_FOR_BUILD="$c";·break·;105 ····case·${CC_FOR_BUILD-},${HOST_CC-},${CC-}·in
108 »       ··fi·;106 »       ,,)····echo·"int·x;"·>·"$dummy.c"
109 »       done·;107 »       ·······for·driver·in·cc·gcc·c89·c99·;·do
110 »       if·test·x"$CC_FOR_BUILD"·=·x·;·then108 »       »       ···if·($driver·-c·-o·"$dummy.o"·"$dummy.c")·>/dev/null·2>&1·;·then
111 »       ··CC_FOR_BUILD=no_compiler_found·;109 »       »       ·······CC_FOR_BUILD="$driver"
112 »       fi110 »       »       ·······break
113 »       ;;111 »       »       ···fi
114 ·,,*)···CC_FOR_BUILD=$CC·;;112 »       ·······done
115 ·,*,*)··CC_FOR_BUILD=$HOST_CC·;;113 »       ·······if·test·x"$CC_FOR_BUILD"·=·x·;·then
116 esac·;·set_cc_for_build=·;'114 »       »       ···CC_FOR_BUILD=no_compiler_found
 115 »       ·······fi
 116 »       ·······;;
 117 »       ,,*)···CC_FOR_BUILD=$CC·;;
 118 »       ,*,*)··CC_FOR_BUILD=$HOST_CC·;;
 119 ····esac
 120 }
  
117 #·This·is·needed·to·find·uname·on·a·Pyramid·OSx·when·run·in·the·BSD·universe.121 #·This·is·needed·to·find·uname·on·a·Pyramid·OSx·when·run·in·the·BSD·universe.
118 #·(ghazi@noc.rutgers.edu·1994-08-24)122 #·(ghazi@noc.rutgers.edu·1994-08-24)
119 if·(test·-f·/.attbin/uname)·>/dev/null·2>&1·;·then123 if·test·-f·/.attbin/uname·;·then
120 »       PATH=$PATH:/.attbin·;·export·PATH124 »       PATH=$PATH:/.attbin·;·export·PATH
121 fi125 fi
  
122 UNAME_MACHINE=`(uname·-m)·2>/dev/null`·||·UNAME_MACHINE=unknown126 UNAME_MACHINE=`(uname·-m)·2>/dev/null`·||·UNAME_MACHINE=unknown
123 UNAME_RELEASE=`(uname·-r)·2>/dev/null`·||·UNAME_RELEASE=unknown127 UNAME_RELEASE=`(uname·-r)·2>/dev/null`·||·UNAME_RELEASE=unknown
124 UNAME_SYSTEM=`(uname·-s)·2>/dev/null`··||·UNAME_SYSTEM=unknown128 UNAME_SYSTEM=`(uname·-s)·2>/dev/null`··||·UNAME_SYSTEM=unknown
125 UNAME_VERSION=`(uname·-v)·2>/dev/null`·||·UNAME_VERSION=unknown129 UNAME_VERSION=`(uname·-v)·2>/dev/null`·||·UNAME_VERSION=unknown
  
126 case·"$UNAME_SYSTEM"·in130 case·"$UNAME_SYSTEM"·in
127 Linux|GNU|GNU/*)131 Linux|GNU|GNU/*)
128 »       #·If·the·system·lacks·a·compiler,·then·just·pick·glibc.132 »       #·If·the·system·lacks·a·compiler,·then·just·pick·glibc.
129 »       #·We·could·probably·try·harder.133 »       #·We·could·probably·try·harder.
130 »       LIBC=gnu134 »       LIBC=gnu
  
131 »       eval·"$set_cc_for_build"135 »       set_cc_for_build
132 »       cat·<<-EOF·>·"$dummy.c"136 »       cat·<<-EOF·>·"$dummy.c"
133 »       #include·<features.h>137 »       #include·<features.h>
134 »       #if·defined(__UCLIBC__)138 »       #if·defined(__UCLIBC__)
135 »       LIBC=uclibc139 »       LIBC=uclibc
136 »       #elif·defined(__dietlibc__)140 »       #elif·defined(__dietlibc__)
137 »       LIBC=dietlibc141 »       LIBC=dietlibc
138 »       #else142 »       #else
Offset 195, 15 lines modifiedOffset 199, 15 lines modified
195 »       #·The·Operating·System·including·object·format,·if·it·has·switched199 »       #·The·Operating·System·including·object·format,·if·it·has·switched
196 »       #·to·ELF·recently·(or·will·in·the·future)·and·ABI.200 »       #·to·ELF·recently·(or·will·in·the·future)·and·ABI.
197 »       case·"$UNAME_MACHINE_ARCH"·in201 »       case·"$UNAME_MACHINE_ARCH"·in
198 »       ····earm*)202 »       ····earm*)
199 »       »       os=netbsdelf203 »       »       os=netbsdelf
200 »       »       ;;204 »       »       ;;
201 »       ····arm*|i386|m68k|ns32k|sh3*|sparc|vax)205 »       ····arm*|i386|m68k|ns32k|sh3*|sparc|vax)
202 »       »       eval·"$set_cc_for_build"206 »       »       set_cc_for_build
203 »       »       if·echo·__ELF__·|·$CC_FOR_BUILD·-E·-·2>/dev/null·\207 »       »       if·echo·__ELF__·|·$CC_FOR_BUILD·-E·-·2>/dev/null·\
204 »       »       »       |·grep·-q·__ELF__208 »       »       »       |·grep·-q·__ELF__
205 »       »       then209 »       »       then
206 »       »       ····#·Once·all·utilities·can·be·ECOFF·(netbsdecoff)·or·a.out·(netbsdaout).210 »       »       ····#·Once·all·utilities·can·be·ECOFF·(netbsdecoff)·or·a.out·(netbsdaout).
207 »       »       ····#·Return·netbsd·for·either.··FIX?211 »       »       ····#·Return·netbsd·for·either.··FIX?
208 »       »       ····os=netbsd212 »       »       ····os=netbsd
209 »       »       else213 »       »       else
Offset 233, 15 lines modifiedOffset 237, 15 lines modified
233 »       ····*)237 »       ····*)
234 »       »       release=`echo·"$UNAME_RELEASE"·|·sed·-e·'s/[-_].*//'·|·cut·-d.·-f1,2`238 »       »       release=`echo·"$UNAME_RELEASE"·|·sed·-e·'s/[-_].*//'·|·cut·-d.·-f1,2`
235 »       »       ;;239 »       »       ;;
236 »       esac240 »       esac
237 »       #·Since·CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:241 »       #·Since·CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
238 »       #·contains·redundant·information,·the·shorter·form:242 »       #·contains·redundant·information,·the·shorter·form:
Max diff block lines reached; 18787/24287 bytes (77.35%) of diff not shown.
58.4 KB
libsndfile-1.0.30/build-aux/config.sub
    
Offset 1, 12 lines modifiedOffset 1, 12 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·Configuration·validation·subroutine·script.2 #·Configuration·validation·subroutine·script.
3 #···Copyright·1992-2018·Free·Software·Foundation,·Inc.3 #···Copyright·1992-2020·Free·Software·Foundation,·Inc.
  
4 timestamp='2018-02-22'4 timestamp='2020-06-20'
  
5 #·This·file·is·free·software;·you·can·redistribute·it·and/or·modify·it5 #·This·file·is·free·software;·you·can·redistribute·it·and/or·modify·it
6 #·under·the·terms·of·the·GNU·General·Public·License·as·published·by6 #·under·the·terms·of·the·GNU·General·Public·License·as·published·by
7 #·the·Free·Software·Foundation;·either·version·3·of·the·License,·or7 #·the·Free·Software·Foundation;·either·version·3·of·the·License,·or
8 #·(at·your·option)·any·later·version.8 #·(at·your·option)·any·later·version.
9 #9 #
10 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,·but10 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,·but
Offset 63, 15 lines modifiedOffset 63, 15 lines modified
63 ··-v,·--version······print·version·number,·then·exit63 ··-v,·--version······print·version·number,·then·exit
  
64 Report·bugs·and·patches·to·<config-patches@gnu.org>."64 Report·bugs·and·patches·to·<config-patches@gnu.org>."
  
65 version="\65 version="\
66 GNU·config.sub·($timestamp)66 GNU·config.sub·($timestamp)
  
67 Copyright·1992-2018·Free·Software·Foundation,·Inc.67 Copyright·1992-2020·Free·Software·Foundation,·Inc.
  
68 This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO68 This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO
69 warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE."69 warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE."
  
70 help="70 help="
71 Try·\`$me·--help'·for·more·information."71 Try·\`$me·--help'·for·more·information."
  
Offset 85, 15 lines modifiedOffset 85, 15 lines modified
85 ····--help·|·--h*·|·-h·)85 ····--help·|·--h*·|·-h·)
86 ·······echo·"$usage";·exit·;;86 ·······echo·"$usage";·exit·;;
87 ····--·)·····#·Stop·option·processing87 ····--·)·····#·Stop·option·processing
88 ·······shift;·break·;;88 ·······shift;·break·;;
89 ····-·)»     #·Use·stdin·as·input.89 ····-·)»     #·Use·stdin·as·input.
90 ·······break·;;90 ·······break·;;
91 ····-*·)91 ····-*·)
92 ·······echo·"$me:·invalid·option·$1$help"92 ·······echo·"$me:·invalid·option·$1$help"·>&2
93 ·······exit·1·;;93 ·······exit·1·;;
  
94 ····*local*)94 ····*local*)
95 ·······#·First·pass·through·any·local·machine·types.95 ·······#·First·pass·through·any·local·machine·types.
96 ·······echo·"$1"96 ·······echo·"$1"
97 ·······exit·;;97 ·······exit·;;
  
Offset 106, 1431 lines modifiedOffset 106, 1440 lines modified
106 ·0)·echo·"$me:·missing·argument$help"·>&2106 ·0)·echo·"$me:·missing·argument$help"·>&2
107 ····exit·1;;107 ····exit·1;;
108 ·1)·;;108 ·1)·;;
109 ·*)·echo·"$me:·too·many·arguments$help"·>&2109 ·*)·echo·"$me:·too·many·arguments$help"·>&2
110 ····exit·1;;110 ····exit·1;;
111 esac111 esac
  
112 #·Separate·what·the·user·gave·into·CPU-COMPANY·and·OS·or·KERNEL-OS·(if·any).112 #·Split·fields·of·configuration·type
113 #·Here·we·must·recognize·all·the·valid·KERNEL-OS·combinations.113 #·shellcheck·disable=SC2162
114 maybe_os=`echo·"$1"·|·sed·'s/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`114 IFS="-"·read·field1·field2·field3·field4·<<EOF
115 case·$maybe_os·in115 $1
116 ··nto-qnx*·|·linux-gnu*·|·linux-android*·|·linux-dietlibc·|·linux-newlib*·|·\116 EOF
117 ··linux-musl*·|·linux-uclibc*·|·uclinux-uclibc*·|·uclinux-gnu*·|·kfreebsd*-gnu*·|·\ 
118 ··knetbsd*-gnu*·|·netbsd*-gnu*·|·netbsd*-eabi*·|·\117 #·Separate·into·logical·components·for·further·validation
119 ··kopensolaris*-gnu*·|·cloudabi*-eabi*·|·\118 case·$1·in
120 ··storm-chaos*·|·os2-emx*·|·rtmk-nova*)119 »       *-*-*-*-*)
121 ····os=-$maybe_os120 »       »       echo·Invalid·configuration·\`"$1"\':·more·than·four·components·>&2
122 ····basic_machine=`echo·"$1"·|·sed·'s/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`121 »       »       exit·1
123 ····;; 
124 ··android-linux) 
125 ····os=-linux-android 
126 ····basic_machine=`echo·"$1"·|·sed·'s/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown 
127 ····;; 
128 ··*) 
129 ····basic_machine=`echo·"$1"·|·sed·'s/-[^-]*$//'` 
130 ····if·[·"$basic_machine"·!=·"$1"·] 
131 ····then·os=`echo·"$1"·|·sed·'s/.*-/-/'` 
132 ····else·os=;·fi 
133 ····;; 
134 esac 
  
135 ###·Let's·recognize·common·machines·as·not·being·operating·systems·so 
136 ###·that·things·like·config.sub·decstation-3100·work.··We·also 
137 ###·recognize·some·manufacturers·as·not·being·operating·systems,·so·we 
138 ###·can·provide·default·operating·systems·below. 
139 case·$os·in 
140 »       -sun*os*) 
141 »       »       #·Prevent·following·clause·from·handling·this·invalid·input. 
142 »       »       ;; 
143 »       -dec*·|·-mips*·|·-sequent*·|·-encore*·|·-pc532*·|·-sgi*·|·-sony*·|·\ 
144 »       -att*·|·-7300*·|·-3300*·|·-delta*·|·-motorola*·|·-sun[234]*·|·\ 
145 »       -unicom*·|·-ibm*·|·-next·|·-hp·|·-isi*·|·-apollo·|·-altos*·|·\ 
146 »       -convergent*·|·-ncr*·|·-news·|·-32*·|·-3600*·|·-3100*·|·-hitachi*·|\ 
147 »       -c[123]*·|·-convex*·|·-sun·|·-crds·|·-omron*·|·-dg·|·-ultra·|·-tti*·|·\ 
148 »       -harris·|·-dolphin·|·-highlevel·|·-gould·|·-cbm·|·-ns·|·-masscomp·|·\ 
149 »       -apple·|·-axis·|·-knuth·|·-cray·|·-microblaze*) 
150 »       »       os= 
151 »       »       basic_machine=$1 
152 »       »       ;; 
153 »       -bluegene*) 
154 »       »       os=-cnk 
155 »       »       ;; 
156 »       -sim·|·-cisco·|·-oki·|·-wec·|·-winbond) 
157 »       »       os= 
158 »       »       basic_machine=$1 
159 »       »       ;; 
160 »       -scout) 
161 »       »       ;; 
162 »       -wrs) 
163 »       »       os=-vxworks 
164 »       »       basic_machine=$1 
165 »       »       ;; 
166 »       -chorusos*) 
167 »       »       os=-chorusos 
168 »       »       basic_machine=$1 
169 »       »       ;; 
170 »       -chorusrdb) 
171 »       »       os=-chorusrdb 
172 »       »       basic_machine=$1 
173 »       »       ;; 
174 »       -hiux*) 
175 »       »       os=-hiuxwe2 
176 »       »       ;; 
177 »       -sco6) 
178 »       »       os=-sco5v6 
179 »       »       basic_machine=`echo·"$1"·|·sed·-e·'s/86-.*/86-pc/'` 
180 »       »       ;; 
181 »       -sco5) 
182 »       »       os=-sco3.2v5 
183 »       »       basic_machine=`echo·"$1"·|·sed·-e·'s/86-.*/86-pc/'` 
184 »       »       ;; 
185 »       -sco4) 
Max diff block lines reached; 54640/59705 bytes (91.52%) of diff not shown.
635 B
libsndfile-1.0.30/build-aux/depcomp
    
Offset 1, 13 lines modifiedOffset 1, 13 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·depcomp·-·compile·a·program·generating·dependencies·as·side-effects2 #·depcomp·-·compile·a·program·generating·dependencies·as·side-effects
  
3 scriptversion=2018-03-07.03;·#·UTC3 scriptversion=2018-03-07.03;·#·UTC
  
4 #·Copyright·(C)·1999-2018·Free·Software·Foundation,·Inc.4 #·Copyright·(C)·1999-2020·Free·Software·Foundation,·Inc.
  
5 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify5 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by6 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
7 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)7 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)
8 #·any·later·version.8 #·any·later·version.
  
9 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,9 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
1.01 KB
libsndfile-1.0.30/build-aux/install-sh
    
Offset 447, 15 lines modifiedOffset 447, 26 lines modified
447 ····dsttmp=${dstdirslash}_inst.$$_447 ····dsttmp=${dstdirslash}_inst.$$_
448 ····rmtmp=${dstdirslash}_rm.$$_448 ····rmtmp=${dstdirslash}_rm.$$_
  
449 ····#·Trap·to·clean·up·those·temp·files·at·exit.449 ····#·Trap·to·clean·up·those·temp·files·at·exit.
450 ····trap·'ret=$?;·rm·-f·"$dsttmp"·"$rmtmp"·&&·exit·$ret'·0450 ····trap·'ret=$?;·rm·-f·"$dsttmp"·"$rmtmp"·&&·exit·$ret'·0
  
451 ····#·Copy·the·file·name·to·the·temp·name.451 ····#·Copy·the·file·name·to·the·temp·name.
452 ····(umask·$cp_umask·&&·$doit_exec·$cpprog·"$src"·"$dsttmp")·&&452 ····(umask·$cp_umask·&&
 453 ·····{·test·-z·"$stripcmd"·||·{
 454 »       ·#·Create·$dsttmp·read-write·so·that·cp·doesn't·create·it·read-only,
 455 »       ·#·which·would·cause·strip·to·fail.
 456 »       ·if·test·-z·"$doit";·then
 457 »       ···:·>"$dsttmp"·#·No·need·to·fork-exec·'touch'.
 458 »       ·else
 459 »       ···$doit·touch·"$dsttmp"
 460 »       ·fi
 461 ·······}
 462 ·····}·&&
 463 ·····$doit_exec·$cpprog·"$src"·"$dsttmp")·&&
  
453 ····#·and·set·any·options;·do·chmod·last·to·preserve·setuid·bits.464 ····#·and·set·any·options;·do·chmod·last·to·preserve·setuid·bits.
454 ····#465 ····#
455 ····#·If·any·of·these·fail,·we·abort·the·whole·thing.··If·we·want·to466 ····#·If·any·of·these·fail,·we·abort·the·whole·thing.··If·we·want·to
456 ····#·ignore·errors·from·any·of·these,·just·make·sure·not·to·ignore467 ····#·ignore·errors·from·any·of·these,·just·make·sure·not·to·ignore
457 ····#·errors·from·the·above·"$doit·$cpprog·$src·$dsttmp"·command.468 ····#·errors·from·the·above·"$doit·$cpprog·$src·$dsttmp"·command.
458 ····#469 ····#
23.7 KB
libsndfile-1.0.30/build-aux/ltmain.sh
    
Offset 27, 15 lines modifiedOffset 27, 15 lines modified
27 #27 #
28 #·You·should·have·received·a·copy·of·the·GNU·General·Public·License28 #·You·should·have·received·a·copy·of·the·GNU·General·Public·License
29 #·along·with·this·program.··If·not,·see·<http://www.gnu.org/licenses/>.29 #·along·with·this·program.··If·not,·see·<http://www.gnu.org/licenses/>.
  
  
30 PROGRAM=libtool30 PROGRAM=libtool
31 PACKAGE=libtool31 PACKAGE=libtool
32 VERSION="2.4.6·Debian-2.4.6-9"32 VERSION=2.4.6
33 package_revision=2.4.633 package_revision=2.4.6
  
  
34 ##·------·##34 ##·------·##
35 ##·Usage.·##35 ##·Usage.·##
36 ##·------·##36 ##·------·##
  
Offset 60, 15 lines modifiedOffset 60, 15 lines modified
60 ##·Source·external·libraries.·##60 ##·Source·external·libraries.·##
61 ##·--------------------------·##61 ##·--------------------------·##
  
62 #·Much·of·our·low-level·functionality·needs·to·be·sourced·from·external62 #·Much·of·our·low-level·functionality·needs·to·be·sourced·from·external
63 #·libraries,·which·are·installed·to·$pkgauxdir.63 #·libraries,·which·are·installed·to·$pkgauxdir.
  
64 #·Set·a·version·string·for·this·script.64 #·Set·a·version·string·for·this·script.
65 scriptversion=2015-01-20.17;·#·UTC65 scriptversion=2015-10-04.22;·#·UTC
  
66 #·General·shell·script·boiler·plate,·and·helper·functions.66 #·General·shell·script·boiler·plate,·and·helper·functions.
67 #·Written·by·Gary·V.·Vaughan,·200467 #·Written·by·Gary·V.·Vaughan,·2004
  
68 #·Copyright·(C)·2004-2015·Free·Software·Foundation,·Inc.68 #·Copyright·(C)·2004-2015·Free·Software·Foundation,·Inc.
69 #·This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO69 #·This·is·free·software;·see·the·source·for·copying·conditions.··There·is·NO
70 #·warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.70 #·warranty;·not·even·for·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.
Offset 1087, 14 lines modifiedOffset 1087, 65 lines modified
  
1087 ····test·-n·"$func_relative_path_result"·||·func_relative_path_result=.1087 ····test·-n·"$func_relative_path_result"·||·func_relative_path_result=.
  
1088 ····:1088 ····:
1089 }1089 }
  
  
 1090 #·func_quote·ARG
 1091 #·--------------
 1092 #·Aesthetically·quote·one·ARG,·store·the·result·into·$func_quote_result.··Note
 1093 #·that·we·keep·attention·to·performance·here·(so·far·O(N)·complexity·as·long·as
 1094 #·func_append·is·O(1)).
 1095 func_quote·()
 1096 {
 1097 ····$debug_cmd
  
 1098 ····func_quote_result=$1
  
 1099 ····case·$func_quote_result·in
 1100 ······*[\\\`\"\$]*)
 1101 ········case·$func_quote_result·in
 1102 ··········*[\[\*\?]*)
 1103 ············func_quote_result=`$ECHO·"$func_quote_result"·|·$SED·"$sed_quote_subst"`
 1104 ············return·0
 1105 ············;;
 1106 ········esac
  
 1107 ········func_quote_old_IFS=$IFS
 1108 ········for·_G_char·in·'\'·'`'·'"'·'$'
 1109 ········do
 1110 ··········#·STATE($1)·PREV($2)·SEPARATOR($3)
 1111 ··········set·start·""·""
 1112 ··········func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
 1113 ··········IFS=$_G_char
 1114 ··········for·_G_part·in·$func_quote_result
 1115 ··········do
 1116 ············case·$1·in
 1117 ············quote)
 1118 ··············func_append·func_quote_result·"$3$2"
 1119 ··············set·quote·"$_G_part"·"\\$_G_char"
 1120 ··············;;
 1121 ············start)
 1122 ··············set·first·""·""
 1123 ··············func_quote_result=
 1124 ··············;;
 1125 ············first)
 1126 ··············set·quote·"$_G_part"·""
 1127 ··············;;
 1128 ············esac
 1129 ··········done
 1130 ··········IFS=$func_quote_old_IFS
 1131 ········done
 1132 ········;;
 1133 ······*)·;;
 1134 ····esac
 1135 }
  
  
1090 #·func_quote_for_eval·ARG...1136 #·func_quote_for_eval·ARG...
1091 #·--------------------------1137 #·--------------------------
1092 #·Aesthetically·quote·ARGs·to·be·evaled·later.1138 #·Aesthetically·quote·ARGs·to·be·evaled·later.
1093 #·This·function·returns·two·values:1139 #·This·function·returns·two·values:
1094 #···i)·func_quote_for_eval_result1140 #···i)·func_quote_for_eval_result
1095 #······double-quoted,·suitable·for·a·subsequent·eval1141 #······double-quoted,·suitable·for·a·subsequent·eval
1096 #··ii)·func_quote_for_eval_unquoted_result1142 #··ii)·func_quote_for_eval_unquoted_result
Offset 1103, 20 lines modifiedOffset 1154, 16 lines modified
1103 func_quote_for_eval·()1154 func_quote_for_eval·()
1104 {1155 {
1105 ····$debug_cmd1156 ····$debug_cmd
  
1106 ····func_quote_for_eval_unquoted_result=1157 ····func_quote_for_eval_unquoted_result=
1107 ····func_quote_for_eval_result=1158 ····func_quote_for_eval_result=
1108 ····while·test·0·-lt·$#;·do1159 ····while·test·0·-lt·$#;·do
1109 ······case·$1·in1160 ······func_quote·"$1"
1110 ········*[\\\`\"\$]*)1161 ······_G_unquoted_arg=$func_quote_result
1111 »       ··_G_unquoted_arg=`printf·'%s\n'·"$1"·|$SED·"$sed_quote_subst"`·;; 
1112 ········*) 
1113 ··········_G_unquoted_arg=$1·;; 
1114 ······esac 
1115 ······if·test·-n·"$func_quote_for_eval_unquoted_result";·then1162 ······if·test·-n·"$func_quote_for_eval_unquoted_result";·then
1116 »       func_append·func_quote_for_eval_unquoted_result·"·$_G_unquoted_arg"1163 »       func_append·func_quote_for_eval_unquoted_result·"·$_G_unquoted_arg"
1117 ······else1164 ······else
1118 ········func_append·func_quote_for_eval_unquoted_result·"$_G_unquoted_arg"1165 ········func_append·func_quote_for_eval_unquoted_result·"$_G_unquoted_arg"
1119 ······fi1166 ······fi
  
1120 ······case·$_G_unquoted_arg·in1167 ······case·$_G_unquoted_arg·in
Offset 1366, 15 lines modifiedOffset 1413, 15 lines modified
1366 #·eval:·(add-hook·'before-save-hook·'time-stamp)1413 #·eval:·(add-hook·'before-save-hook·'time-stamp)
1367 #·time-stamp-pattern:·"10/scriptversion=%:y-%02m-%02d.%02H;·#·UTC"1414 #·time-stamp-pattern:·"10/scriptversion=%:y-%02m-%02d.%02H;·#·UTC"
1368 #·time-stamp-time-zone:·"UTC"1415 #·time-stamp-time-zone:·"UTC"
1369 #·End:1416 #·End:
1370 #!·/bin/sh1417 #!·/bin/sh
  
1371 #·Set·a·version·string·for·this·script.1418 #·Set·a·version·string·for·this·script.
1372 scriptversion=2015-10-07.11;·#·UTC1419 scriptversion=2014-01-07.03;·#·UTC
Max diff block lines reached; 20567/24227 bytes (84.89%) of diff not shown.
634 B
libsndfile-1.0.30/build-aux/missing
    
Offset 1, 13 lines modifiedOffset 1, 13 lines modified
1 #!·/bin/sh1 #!·/bin/sh
2 #·Common·wrapper·for·a·few·potentially·missing·GNU·programs.2 #·Common·wrapper·for·a·few·potentially·missing·GNU·programs.
  
3 scriptversion=2018-03-07.03;·#·UTC3 scriptversion=2018-03-07.03;·#·UTC
  
4 #·Copyright·(C)·1996-2018·Free·Software·Foundation,·Inc.4 #·Copyright·(C)·1996-2020·Free·Software·Foundation,·Inc.
5 #·Originally·written·by·Fran,cois·Pinard·<pinard@iro.umontreal.ca>,·1996.5 #·Originally·written·by·Fran,cois·Pinard·<pinard@iro.umontreal.ca>,·1996.
  
6 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify6 #·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
7 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by7 #·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
8 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)8 #·the·Free·Software·Foundation;·either·version·2,·or·(at·your·option)
9 #·any·later·version.9 #·any·later·version.
  
17.1 KB
libsndfile-1.0.30/cmake/SndFileChecks.cmake
    
Offset 1, 271 lines modifiedOffset 1, 271 lines modified
1 include·(CheckFunctionExists).1 include·(CheckFunctionExists)
2 include·(CheckIncludeFile).2 include·(CheckIncludeFile)
3 include·(CheckLibraryExists).3 include·(CheckLibraryExists)
4 include·(CheckSymbolExists).4 include·(CheckSymbolExists)
5 include·(CheckTypeSize).5 include·(CheckTypeSize)
6 include·(TestBigEndian).6 include·(TestBigEndian)
7 \xd 
8 include·(TestInline).7 include·(TestInline)
9 include·(ClipMode).8 include·(ClipMode)
10 include(TestLargeFiles).9 include(TestLargeFiles)
11 \xd 
12 test_large_files·(_LARGEFILES).10 test_large_files·(_LARGEFILES)
13 \xd 
14 if·(LARGE_FILES_DEFINITIONS).11 if·(LARGE_FILES_DEFINITIONS)
15 »       add_definitions(${LARGE_FILES_DEFINITIONS}).12 »       add_definitions(${LARGE_FILES_DEFINITIONS})
16 endif·().13 endif·()
17 \xd 
18 if·(WIN32).14 if·(WIN32)
19 ····set(TYPEOF_SF_COUNT_T·__int64).15 ····set(TYPEOF_SF_COUNT_T·__int64)
20 else·().16 else·()
21 ····set(TYPEOF_SF_COUNT_T·int64_t).17 ····set(TYPEOF_SF_COUNT_T·int64_t)
22 endif·().18 endif·()
23 set·(SF_COUNT_MAX·0x7fffffffffffffffll).19 set·(SF_COUNT_MAX·0x7fffffffffffffffll)
24 \xd 
25 if·(NOT·WIN32).20 if·(NOT·WIN32)
26 »       find_package·(ALSA).21 »       find_package·(ALSA)
27 »       find_package·(Sndio).22 »       find_package·(Sndio)
28 endif·().23 endif·()
29 \xd 
30 if·(VCPKG_TOOLCHAIN·AND·(NOT·CMAKE_VERSION·VERSION_LESS·3.15)).24 if·(VCPKG_TOOLCHAIN·AND·(NOT·CMAKE_VERSION·VERSION_LESS·3.15))
31 »       set·(CMAKE_FIND_PACKAGE_PREFER_CONFIG·ON).25 »       set·(CMAKE_FIND_PACKAGE_PREFER_CONFIG·ON)
32 endif·().26 endif·()
33 \xd 
34 if·(CMAKE_FIND_PACKAGE_PREFER_CONFIG).27 if·(CMAKE_FIND_PACKAGE_PREFER_CONFIG)
35 »       find_package·(Ogg·1.3·CONFIG).28 »       find_package·(Ogg·1.3·CONFIG)
36 »       find_package·(Vorbis·CONFIG·COMPONENTS·Enc).29 »       find_package·(Vorbis·CONFIG·COMPONENTS·Enc)
37 »       find_package·(FLAC·CONFIG).30 »       find_package·(FLAC·CONFIG)
38 »       find_package·(Opus·CONFIG).31 »       find_package·(Opus·CONFIG)
39 \xd 
40 »       include·(FindPackageHandleStandardArgs).32 »       include·(FindPackageHandleStandardArgs)
41 »       find_package_handle_standard_args·(Ogg·CONFIG_MODE).33 »       find_package_handle_standard_args·(Ogg·CONFIG_MODE)
42 »       find_package_handle_standard_args·(Vorbis·CONFIG_MODE).34 »       find_package_handle_standard_args·(Vorbis·CONFIG_MODE)
43 »       find_package_handle_standard_args·(FLAC·CONFIG_MODE).35 »       find_package_handle_standard_args·(FLAC·CONFIG_MODE)
44 »       find_package_handle_standard_args·(Opus·CONFIG_MODE).36 »       find_package_handle_standard_args·(Opus·CONFIG_MODE)
45 else·().37 else·()
46 »       find_package·(Ogg·1.3).38 »       find_package·(Ogg·1.3)
47 »       find_package·(Vorbis·COMPONENTS·Enc).39 »       find_package·(Vorbis·COMPONENTS·Enc)
48 »       find_package·(FLAC).40 »       find_package·(FLAC)
49 »       find_package·(Opus).41 »       find_package·(Opus)
50 endif·().42 endif·()
51 if·(Vorbis_FOUND·AND·FLAC_FOUND·AND·Opus_FOUND).43 if·(Vorbis_FOUND·AND·FLAC_FOUND·AND·Opus_FOUND)
52 »       set·(HAVE_EXTERNAL_XIPH_LIBS·1).44 »       set·(HAVE_EXTERNAL_XIPH_LIBS·1)
53 else·().45 else·()
54 »       set·(HAVE_EXTERNAL_XIPH_LIBS·0).46 »       set·(HAVE_EXTERNAL_XIPH_LIBS·0)
55 endif·().47 endif·()
56 \xd 
57 find_package·(Speex).48 find_package·(Speex)
58 find_package·(SQLite3).49 find_package·(SQLite3)
59 \xd 
60 check_include_file·(byteswap.h»  »  HAVE_BYTESWAP_H).50 check_include_file·(byteswap.h»  »  HAVE_BYTESWAP_H)
61 check_include_file·(dlfcn.h»     »     »     HAVE_DLFCN_H).51 check_include_file·(dlfcn.h»     »     »     HAVE_DLFCN_H)
62 check_include_file·(direct.h»    »    HAVE_DIRECT_H).52 check_include_file·(direct.h»    »    HAVE_DIRECT_H)
63 check_include_file·(endian.h»    »    HAVE_ENDIAN_H).53 check_include_file·(endian.h»    »    HAVE_ENDIAN_H)
64 check_include_file·(inttypes.h»  »  HAVE_INTTYPES_H).54 check_include_file·(inttypes.h»  »  HAVE_INTTYPES_H)
65 check_include_file·(io.h»»»HAVE_IO_H).55 check_include_file·(io.h»»»HAVE_IO_H)
66 check_include_file·(stdint.h»    »    HAVE_STDINT_H).56 check_include_file·(stdint.h»    »    HAVE_STDINT_H)
67 check_include_file·(sys/time.h»  »  HAVE_SYS_TIME_H).57 check_include_file·(sys/time.h»  »  HAVE_SYS_TIME_H)
68 check_include_file·(sys/types.h» » HAVE_SYS_TYPES_H).58 check_include_file·(sys/types.h» » HAVE_SYS_TYPES_H)
69 check_include_file·(unistd.h»    »    HAVE_UNISTD_H).59 check_include_file·(unistd.h»    »    HAVE_UNISTD_H)
70 \xd 
71 #·Never·checked.60 #·Never·checked
72 #·check_include_file·(stdlib.h»   »   HAVE_STDLIB_H).61 #·check_include_file·(stdlib.h»   »   HAVE_STDLIB_H)
73 #·check_include_file·(string.h»   »   HAVE_STRING_H).62 #·check_include_file·(string.h»   »   HAVE_STRING_H)
74 #·check_include_file·(strings.h»  »  HAVE_STRINGS_H).63 #·check_include_file·(strings.h»  »  HAVE_STRINGS_H)
75 #·check_include_file·(sys/stat.h» HAVE_SYS_STAT_H).64 #·check_include_file·(sys/stat.h» HAVE_SYS_STAT_H)
76 #·check_include_file·(memory.h»   »   HAVE_MEMORY_H).65 #·check_include_file·(memory.h»   »   HAVE_MEMORY_H)
77 \xd 
78 if·(BUILD_TESTING).66 if·(BUILD_TESTING)
79 »       check_include_file·(locale.h»    HAVE_LOCALE_H).67 »       check_include_file·(locale.h»    HAVE_LOCALE_H)
80 »       check_include_file·(sys/wait.h»  HAVE_SYS_WAIT_H).68 »       check_include_file·(sys/wait.h»  HAVE_SYS_WAIT_H)
81 endif·().69 endif·()
82 \xd 
83 check_type_size·(int64_t»»»SIZEOF_INT64_T).70 check_type_size·(int64_t»»»SIZEOF_INT64_T)
84 check_type_size·(long»   »   »   »   SIZEOF_LONG).71 check_type_size·(long»   »   »   »   SIZEOF_LONG)
85 check_type_size·(long\·long»      »      »      SIZEOF_LONG_LONG).72 check_type_size·(long\·long»      »      »      SIZEOF_LONG_LONG)
86 check_type_size·(ssize_t»»»SIZEOF_SSIZE_T).73 check_type_size·(ssize_t»»»SIZEOF_SSIZE_T)
87 check_type_size·(wchar_t»»»SIZEOF_WCHAR_T).74 check_type_size·(wchar_t»»»SIZEOF_WCHAR_T)
88 \xd 
89 #·Never·used.75 #·Never·used
90 #·check_type_size·(loff_t»»»SIZEOF_LOFF_T).76 #·check_type_size·(loff_t»»»SIZEOF_LOFF_T)
91 #·check_type_size·(offt64_t»      »      »      SIZEOF_OFF64_T).77 #·check_type_size·(offt64_t»      »      »      SIZEOF_OFF64_T)
92 \xd 
93 #·Never·checked.78 #·Never·checked
94 #·check_type_size·(size_t»»»SIZEOF_SIZE_T).79 #·check_type_size·(size_t»»»SIZEOF_SIZE_T)
95 \xd 
96 #·Used·in·configre.ac.80 #·Used·in·configre.ac
97 #·check_type_size·(double»»»SIZEOF_DOUBLE).81 #·check_type_size·(double»»»SIZEOF_DOUBLE)
98 #·check_type_size·(float» » » SIZEOF_FLOAT).82 #·check_type_size·(float» » » SIZEOF_FLOAT)
99 #·check_type_size·(int»   »   »   »   SIZEOF_INT).83 #·check_type_size·(int»   »   »   »   SIZEOF_INT)
100 #·check_type_size·(short» » » SIZEOF_SHORT).84 #·check_type_size·(short» » » SIZEOF_SHORT)
101 \xd 
102 if·(ENABLE_TESTING).85 if·(ENABLE_TESTING)
103 »       check_type_size·(void*»  »  »  SIZEOF_VOIDP).86 »       check_type_size·(void*»  »  »  SIZEOF_VOIDP)
104 endif().87 endif()
105 \xd 
106 if·((SIZEOF_OFF_T·EQUAL·8)·OR·(SIZEOF_LOFF_T·EQUAL·8)·OR·(SIZEOF_OFF64_T·EQUAL·8)).88 if·((SIZEOF_OFF_T·EQUAL·8)·OR·(SIZEOF_LOFF_T·EQUAL·8)·OR·(SIZEOF_OFF64_T·EQUAL·8))
107 »       set·(TYPEOF_SF_COUNT_T·"int64_t").89 »       set·(TYPEOF_SF_COUNT_T·"int64_t")
108 »       set·(SF_COUNT_MAX·"0x7FFFFFFFFFFFFFFFLL").90 »       set·(SF_COUNT_MAX·"0x7FFFFFFFFFFFFFFFLL")
109 »       set·(SIZEOF_SF_COUNT_T·8).91 »       set·(SIZEOF_SF_COUNT_T·8)
110 else·().92 else·()
111 »       if·(WIN32).93 »       if·(WIN32)
112 »       »       set·(TYPEOF_SF_COUNT_T·"__int64").94 »       »       set·(TYPEOF_SF_COUNT_T·"__int64")
113 »       »       set·(SF_COUNT_MAX·"0x7FFFFFFFFFFFFFFFLL").95 »       »       set·(SF_COUNT_MAX·"0x7FFFFFFFFFFFFFFFLL")
114 »       »       set·(SIZEOF_SF_COUNT_T·8).96 »       »       set·(SIZEOF_SF_COUNT_T·8)
115 »       else·().97 »       else·()
116 »       »       message·("").98 »       »       message·("")
117 »       »       message·("***·The·configure·process·has·determined·that·this·system·is·capable").99 »       »       message·("***·The·configure·process·has·determined·that·this·system·is·capable")
118 »       »       message·("***·of·Large·File·Support·but·has·not·been·able·to·find·a·type·which").100 »       »       message·("***·of·Large·File·Support·but·has·not·been·able·to·find·a·type·which")
119 »       »       message·("***·is·an·unambiguous·64·bit·file·offset.").101 »       »       message·("***·is·an·unambiguous·64·bit·file·offset.")
120 »       »       message·("***·Please·contact·the·author·to·help·resolve·this·problem.").102 »       »       message·("***·Please·contact·the·author·to·help·resolve·this·problem.")
121 »       »       message·("").103 »       »       message·("")
122 »       »       message·(FATAL_ERROR·"Bad·file·offset·type.").104 »       »       message·(FATAL_ERROR·"Bad·file·offset·type.")
123 »       endif·().105 »       endif·()
124 endif·().106 endif·()
125 \xd 
126 check_type_size·(${TYPEOF_SF_COUNT_T}·SIZEOF_SF_COUNT_T).107 check_type_size·(${TYPEOF_SF_COUNT_T}·SIZEOF_SF_COUNT_T)
127 \xd 
Max diff block lines reached; -1/17445 bytes (-0.01%) of diff not shown.
77.7 KB
libsndfile-1.0.30/CMakeLists.txt
    
Offset 1, 1447 lines modifiedOffset 1, 1447 lines modified
1 cmake_minimum_required·(VERSION·3.1..3.18).1 cmake_minimum_required·(VERSION·3.1..3.18)
2 \xd 
3 #·MSVC·runtime·library·flags·are·selected·by·an·abstraction,·CMake·>=·3.15.2 #·MSVC·runtime·library·flags·are·selected·by·an·abstraction,·CMake·>=·3.15
4 #·This·policy·still·need·to·be·set·even·with·cmake_minimum_required()·command·above..3 #·This·policy·still·need·to·be·set·even·with·cmake_minimum_required()·command·above.
5 if·(POLICY·CMP0091).4 if·(POLICY·CMP0091)
6 »       cmake_policy·(SET·CMP0091·NEW).5 »       cmake_policy·(SET·CMP0091·NEW)
7 endif·().6 endif·()
8 \xd 
9 project(sndfile·VERSION·1.0.30).7 project(sndfile·VERSION·1.0.30)
10 \xd 
11 #.8 #
12 #·Variables.9 #·Variables
13 #.10 #
14 \xd 
15 set·(CMAKE_C_STANDARD·99).11 set·(CMAKE_C_STANDARD·99)
16 set·(CMAKE_C_STANDARD_REQUIRED·TRUE).12 set·(CMAKE_C_STANDARD_REQUIRED·TRUE)
17 set_property(GLOBAL·PROPERTY·USE_FOLDERS·ON).13 set_property(GLOBAL·PROPERTY·USE_FOLDERS·ON)
18 \xd 
19 set·(PACKAGE_NAME·lib${PROJECT_NAME}).14 set·(PACKAGE_NAME·lib${PROJECT_NAME})
20 set·(CPACK_PACKAGE_VERSION_MAJOR·${PROJECT_VERSION_MAJOR}).15 set·(CPACK_PACKAGE_VERSION_MAJOR·${PROJECT_VERSION_MAJOR})
21 set·(CPACK_PACKAGE_VERSION_MINOR·${PROJECT_VERSION_MINOR}).16 set·(CPACK_PACKAGE_VERSION_MINOR·${PROJECT_VERSION_MINOR})
22 set·(CPACK_PACKAGE_VERSION_PATCH·${PROJECT_VERSION_PATCH}).17 set·(CPACK_PACKAGE_VERSION_PATCH·${PROJECT_VERSION_PATCH})
23 set·(CPACK_PACKAGE_VERSION_STAGE·"").18 set·(CPACK_PACKAGE_VERSION_STAGE·"")
24 set·(CPACK_PACKAGE_VERSION_FULL·"${PROJECT_VERSION}${CPACK_PACKAGE_VERSION_STAGE}").19 set·(CPACK_PACKAGE_VERSION_FULL·"${PROJECT_VERSION}${CPACK_PACKAGE_VERSION_STAGE}")
25 \xd 
26 #.20 #
27 #·System-wide·includes.21 #·System-wide·includes
28 #.22 #
29 \xd 
30 #·Set·proper·default·documentation·install·directory·based·on·canonical.23 #·Set·proper·default·documentation·install·directory·based·on·canonical
31 #·package·name,·not·CMake·project·name.·This·option·can·still·be·overridden..24 #·package·name,·not·CMake·project·name.·This·option·can·still·be·overridden.
32 if(NOT·CMAKE_INSTALL_DOCDIR).25 if(NOT·CMAKE_INSTALL_DOCDIR)
33 »       set(CMAKE_INSTALL_DOCDIR·"${CMAKE_INSTALL_DATAROOTDIR}/doc/libsndfile").26 »       set(CMAKE_INSTALL_DOCDIR·"${CMAKE_INSTALL_DATAROOTDIR}/doc/libsndfile")
34 endif().27 endif()
35 include·(GNUInstallDirs).28 include·(GNUInstallDirs)
36 include·(FeatureSummary).29 include·(FeatureSummary)
37 include·(CMakeDependentOption).30 include·(CMakeDependentOption)
38 include·(CTest).31 include·(CTest)
39 \xd 
40 #.32 #
41 #·Options.33 #·Options
42 #.34 #
43 \xd 
44 option·(BUILD_SHARED_LIBS·"Build·shared·libraries"·OFF).35 option·(BUILD_SHARED_LIBS·"Build·shared·libraries"·OFF)
45 if·(BUILD_SHARED_LIBS·AND·BUILD_TESTING).36 if·(BUILD_SHARED_LIBS·AND·BUILD_TESTING)
46 »       set·(BUILD_TESTING·OFF).37 »       set·(BUILD_TESTING·OFF)
47 »       message·("Build·testing·required·static·libraries.·To·prevent·build·errors·BUILD_TESTING·disabled.").38 »       message·("Build·testing·required·static·libraries.·To·prevent·build·errors·BUILD_TESTING·disabled.")
48 endif·().39 endif·()
49 option·(BUILD_PROGRAMS·"Build·programs"·ON).40 option·(BUILD_PROGRAMS·"Build·programs"·ON)
50 option·(BUILD_EXAMPLES·"Build·examples"·ON).41 option·(BUILD_EXAMPLES·"Build·examples"·ON)
51 option·(ENABLE_CPACK·"Enable·CPack·support"·ON).42 option·(ENABLE_CPACK·"Enable·CPack·support"·ON)
52 option·(ENABLE_EXPERIMENTAL·"Enable·experimental·code"·OFF).43 option·(ENABLE_EXPERIMENTAL·"Enable·experimental·code"·OFF)
53 option·(ENABLE_BOW_DOCS·"Enable·black-on-white·html·docs"·OFF).44 option·(ENABLE_BOW_DOCS·"Enable·black-on-white·html·docs"·OFF)
54 if·(MSVC·AND·(CMAKE_VERSION·VERSION_LESS·3.15)).45 if·(MSVC·AND·(CMAKE_VERSION·VERSION_LESS·3.15))
55 »       option·(ENABLE_STATIC_RUNTIME·"Enable·static·runtime"·OFF).46 »       option·(ENABLE_STATIC_RUNTIME·"Enable·static·runtime"·OFF)
56 endif·().47 endif·()
57 option·(ENABLE_PACKAGE_CONFIG·"Generate·and·install·package·config·file"·ON).48 option·(ENABLE_PACKAGE_CONFIG·"Generate·and·install·package·config·file"·ON)
58 option·(INSTALL_PKGCONFIG_MODULE·"Generate·and·install·pkg-config·module"·ON).49 option·(INSTALL_PKGCONFIG_MODULE·"Generate·and·install·pkg-config·module"·ON)
59 \xd 
60 list·(APPEND·CMAKE_MODULE_PATH·"${CMAKE_CURRENT_SOURCE_DIR}/cmake").50 list·(APPEND·CMAKE_MODULE_PATH·"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
61 \xd 
62 #.51 #
63 #·Setup·definitions.52 #·Setup·definitions
64 #.53 #
65 \xd 
66 include(SndFileChecks).54 include(SndFileChecks)
67 \xd 
68 \xd 
69 cmake_dependent_option·(BUILD_REGTEST·"Build·regtest"·ON·"SQLITE3_FOUND"·OFF).55 cmake_dependent_option·(BUILD_REGTEST·"Build·regtest"·ON·"SQLITE3_FOUND"·OFF)
70 cmake_dependent_option·(ENABLE_EXTERNAL_LIBS·"Enable·FLAC,·Vorbis,·and·Opus·codecs"·ON·"Vorbis_FOUND;FLAC_FOUND;OPUS_FOUND"·OFF).56 cmake_dependent_option·(ENABLE_EXTERNAL_LIBS·"Enable·FLAC,·Vorbis,·and·Opus·codecs"·ON·"Vorbis_FOUND;FLAC_FOUND;OPUS_FOUND"·OFF)
71 cmake_dependent_option·(ENABLE_CPU_CLIP·"Enable·tricky·cpu·specific·clipper"·ON·"CPU_CLIPS_POSITIVE;CPU_CLIPS_NEGATIVE"·OFF).57 cmake_dependent_option·(ENABLE_CPU_CLIP·"Enable·tricky·cpu·specific·clipper"·ON·"CPU_CLIPS_POSITIVE;CPU_CLIPS_NEGATIVE"·OFF)
72 if·(NOT·ENABLE_CPU_CLIP).58 if·(NOT·ENABLE_CPU_CLIP)
73 »       set·(CPU_CLIPS_POSITIVE·FALSE).59 »       set·(CPU_CLIPS_POSITIVE·FALSE)
74 »       set·(CPU_CLIPS_NEGATIVE·FALSE).60 »       set·(CPU_CLIPS_NEGATIVE·FALSE)
75 endif·().61 endif·()
76 cmake_dependent_option·(ENABLE_COMPATIBLE_LIBSNDFILE_NAME·"Set·DLL·name·to·libsndfile-1.dll·(canonical·name),·sndfile.dll·otherwise"·OFF·"WIN32;BUILD_SHARED_LIBS"·OFF).62 cmake_dependent_option·(ENABLE_COMPATIBLE_LIBSNDFILE_NAME·"Set·DLL·name·to·libsndfile-1.dll·(canonical·name),·sndfile.dll·otherwise"·OFF·"WIN32;BUILD_SHARED_LIBS"·OFF)
77 cmake_dependent_option·(INSTALL_MANPAGES·"Install·man·pages·for·programs"·ON·"BUILD_PROGRAMS·AND·(UNIX·OR·MINGW·OR·CYGWIN)"·OFF).63 cmake_dependent_option·(INSTALL_MANPAGES·"Install·man·pages·for·programs"·ON·"BUILD_PROGRAMS·AND·(UNIX·OR·MINGW·OR·CYGWIN)"·OFF)
78 \xd 
79 set·(HAVE_EXTERNAL_XIPH_LIBS·${ENABLE_EXTERNAL_LIBS}).64 set·(HAVE_EXTERNAL_XIPH_LIBS·${ENABLE_EXTERNAL_LIBS})
80 set·(HAVE_SQLITE3·${BUILD_REGTEST}).65 set·(HAVE_SQLITE3·${BUILD_REGTEST})
81 set·(HAVE_ALSA_ASOUNDLIB_H·${ALSA_FOUND}).66 set·(HAVE_ALSA_ASOUNDLIB_H·${ALSA_FOUND})
82 set·(HAVE_SNDIO_H·${SNDIO_FOUND}).67 set·(HAVE_SNDIO_H·${SNDIO_FOUND})
83 \xd 
84 set·(ENABLE_EXPERIMENTAL_CODE·${ENABLE_EXPERIMENTAL}).68 set·(ENABLE_EXPERIMENTAL_CODE·${ENABLE_EXPERIMENTAL})
85 set·(HAVE_SPEEX·${ENABLE_EXPERIMENTAL}).69 set·(HAVE_SPEEX·${ENABLE_EXPERIMENTAL})
86 set·(HAVE_OPUS·${ENABLE_EXPERIMENTAL}).70 set·(HAVE_OPUS·${ENABLE_EXPERIMENTAL})
87 \xd 
88 add_feature_info·(BUILD_SHARED_LIBS·BUILD_SHARED_LIBS·"build·shared·libraries").71 add_feature_info·(BUILD_SHARED_LIBS·BUILD_SHARED_LIBS·"build·shared·libraries")
89 add_feature_info·(ENABLE_EXTERNAL_LIBS·ENABLE_EXTERNAL_LIBS·"enable·FLAC,·Vorbis,·and·Opus·codecs").72 add_feature_info·(ENABLE_EXTERNAL_LIBS·ENABLE_EXTERNAL_LIBS·"enable·FLAC,·Vorbis,·and·Opus·codecs")
90 add_feature_info·(ENABLE_EXPERIMENTAL·ENABLE_EXPERIMENTAL·"enable·experimental·code").73 add_feature_info·(ENABLE_EXPERIMENTAL·ENABLE_EXPERIMENTAL·"enable·experimental·code")
91 add_feature_info·(BUILD_TESTING·BUILD_TESTING·"build·tests").74 add_feature_info·(BUILD_TESTING·BUILD_TESTING·"build·tests")
92 add_feature_info·(BUILD_REGTEST·BUILD_REGTEST·"build·regtest").75 add_feature_info·(BUILD_REGTEST·BUILD_REGTEST·"build·regtest")
93 add_feature_info·(ENABLE_CPACK·ENABLE_CPACK·"enable·CPack·support").76 add_feature_info·(ENABLE_CPACK·ENABLE_CPACK·"enable·CPack·support")
94 add_feature_info·(ENABLE_CPU_CLIP·ENABLE_CPU_CLIP·"Enable·tricky·cpu·specific·clipper").77 add_feature_info·(ENABLE_CPU_CLIP·ENABLE_CPU_CLIP·"Enable·tricky·cpu·specific·clipper")
95 add_feature_info·(ENABLE_BOW_DOCS·ENABLE_BOW_DOCS·"enable·black-on-white·html·docs").78 add_feature_info·(ENABLE_BOW_DOCS·ENABLE_BOW_DOCS·"enable·black-on-white·html·docs")
96 add_feature_info·(ENABLE_PACKAGE_CONFIG·ENABLE_PACKAGE_CONFIG·"generate·and·install·package·config·file").79 add_feature_info·(ENABLE_PACKAGE_CONFIG·ENABLE_PACKAGE_CONFIG·"generate·and·install·package·config·file")
97 add_feature_info·(INSTALL_PKGCONFIG_MODULE·INSTALL_PKGCONFIG_MODULE·"generate·and·install·pkg-config·module").80 add_feature_info·(INSTALL_PKGCONFIG_MODULE·INSTALL_PKGCONFIG_MODULE·"generate·and·install·pkg-config·module")
98 add_feature_info·(INSTALL_MANPAGES·INSTALL_MANPAGES·"install·man·pages·for·programs").81 add_feature_info·(INSTALL_MANPAGES·INSTALL_MANPAGES·"install·man·pages·for·programs")
99 if·(WIN32·AND·BUILD_SHARED_LIBS).82 if·(WIN32·AND·BUILD_SHARED_LIBS)
100 »       add_feature_info·(ENABLE_COMPATIBLE_LIBSNDFILE_NAME·ENABLE_COMPATIBLE_LIBSNDFILE_NAME·"Set·DLL·name·to·libsndfile-1.dll·(canonical·name),·sndfile.dll·otherwise").83 »       add_feature_info·(ENABLE_COMPATIBLE_LIBSNDFILE_NAME·ENABLE_COMPATIBLE_LIBSNDFILE_NAME·"Set·DLL·name·to·libsndfile-1.dll·(canonical·name),·sndfile.dll·otherwise")
101 endif·().84 endif·()
102 \xd 
103 if·(MSVC·AND·(CMAKE_VERSION·VERSION_LESS·3.15)).85 if·(MSVC·AND·(CMAKE_VERSION·VERSION_LESS·3.15))
104 »       add_feature_info·(ENABLE_STATIC_RUNTIME·ENABLE_STATIC_RUNTIME·"Enable·static·runtime").86 »       add_feature_info·(ENABLE_STATIC_RUNTIME·ENABLE_STATIC_RUNTIME·"Enable·static·runtime")
105 endif·().87 endif·()
106 \xd 
107 set_package_properties·(Ogg·PROPERTIES.88 set_package_properties·(Ogg·PROPERTIES
108 »       TYPE·RECOMMENDED.89 »       TYPE·RECOMMENDED
109 »       URL·"www.xiph.org/ogg/".90 »       URL·"www.xiph.org/ogg/"
110 »       DESCRIPTION·"library·for·manipulating·ogg·bitstreams".91 »       DESCRIPTION·"library·for·manipulating·ogg·bitstreams"
111 »       PURPOSE·"Required·to·enable·Vorbis,·Speex,·and·Opus·support".92 »       PURPOSE·"Required·to·enable·Vorbis,·Speex,·and·Opus·support"
112 »       ).93 »       )
113 set_package_properties·(Vorbis·PROPERTIES.94 set_package_properties·(Vorbis·PROPERTIES
114 »       TYPE·RECOMMENDED.95 »       TYPE·RECOMMENDED
115 »       URL·"www.vorbis.com/".96 »       URL·"www.vorbis.com/"
116 »       DESCRIPTION·"open·source·lossy·audio·codec".97 »       DESCRIPTION·"open·source·lossy·audio·codec"
117 »       PURPOSE·"Enables·Vorbis·support".98 »       PURPOSE·"Enables·Vorbis·support"
118 »       ).99 »       )
119 set_package_properties·(FLAC·PROPERTIES.100 set_package_properties·(FLAC·PROPERTIES
120 »       TYPE·RECOMMENDED.101 »       TYPE·RECOMMENDED
121 »       URL·"www.xiph.org/flac/".102 »       URL·"www.xiph.org/flac/"
122 »       DESCRIPTION·"Free·Lossless·Audio·Codec·Library".103 »       DESCRIPTION·"Free·Lossless·Audio·Codec·Library"
123 »       PURPOSE·"Enables·FLAC·support".104 »       PURPOSE·"Enables·FLAC·support"
124 »       ).105 »       )
125 set_package_properties(Opus·PROPERTIES.106 set_package_properties(Opus·PROPERTIES
126 »       TYPE·RECOMMENDED.107 »       TYPE·RECOMMENDED
127 »       URL»    "www.opus-codec.org/".108 »       URL»    "www.opus-codec.org/"
Max diff block lines reached; -1/79549 bytes (-0.00%) of diff not shown.
22.8 KB
libsndfile-1.0.30/configure
    
Offset 8746, 14 lines modifiedOffset 8746, 19 lines modified
8746 ····;;8746 ····;;
  
8747 ··mint*)8747 ··mint*)
8748 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.8748 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.
8749 ····lt_cv_sys_max_cmd_len=8192;8749 ····lt_cv_sys_max_cmd_len=8192;
8750 ····;;8750 ····;;
  
 8751 ··mint*)
 8752 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.
 8753 ····lt_cv_sys_max_cmd_len=8192;
 8754 ····;;
  
8751 ··amigaos*)8755 ··amigaos*)
8752 ····#·On·AmigaOS·with·pdksh,·this·test·takes·hours,·literally.8756 ····#·On·AmigaOS·with·pdksh,·this·test·takes·hours,·literally.
8753 ····#·So·we·just·punt·and·use·a·minimum·line·length·of·8192.8757 ····#·So·we·just·punt·and·use·a·minimum·line·length·of·8192.
8754 ····lt_cv_sys_max_cmd_len=8192;8758 ····lt_cv_sys_max_cmd_len=8192;
8755 ····;;8759 ····;;
  
8756 ··bitrig*·|·darwin*·|·dragonfly*·|·freebsd*·|·netbsd*·|·openbsd*)8760 ··bitrig*·|·darwin*·|·dragonfly*·|·freebsd*·|·netbsd*·|·openbsd*)
Offset 9218, 15 lines modifiedOffset 9223, 15 lines modified
9218 ··;;9223 ··;;
  
9219 #·This·must·be·glibc/ELF.9224 #·This·must·be·glibc/ELF.
9220 linux*·|·k*bsd*-gnu·|·kopensolaris*-gnu·|·gnu*)9225 linux*·|·k*bsd*-gnu·|·kopensolaris*-gnu·|·gnu*)
9221 ··lt_cv_deplibs_check_method=pass_all9226 ··lt_cv_deplibs_check_method=pass_all
9222 ··;;9227 ··;;
  
9223 netbsd*·|·netbsdelf*-gnu)9228 netbsd*)
9224 ··if·echo·__ELF__·|·$CC·-E·-·|·$GREP·__ELF__·>·/dev/null;·then9229 ··if·echo·__ELF__·|·$CC·-E·-·|·$GREP·__ELF__·>·/dev/null;·then
9225 ····lt_cv_deplibs_check_method='match_pattern·/lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'9230 ····lt_cv_deplibs_check_method='match_pattern·/lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
9226 ··else9231 ··else
9227 ····lt_cv_deplibs_check_method='match_pattern·/lib[^/]+(\.so|_pic\.a)$'9232 ····lt_cv_deplibs_check_method='match_pattern·/lib[^/]+(\.so|_pic\.a)$'
9228 ··fi9233 ··fi
9229 ··;;9234 ··;;
  
Offset 10078, 16 lines modifiedOffset 10083, 19 lines modified
10078 ··if·{·{·eval·echo·"\"\$as_me\":${as_lineno-$LINENO}:·\"$ac_compile\"";·}·>&510083 ··if·{·{·eval·echo·"\"\$as_me\":${as_lineno-$LINENO}:·\"$ac_compile\"";·}·>&5
10079 ··(eval·$ac_compile)·2>&510084 ··(eval·$ac_compile)·2>&5
10080 ··ac_status=$?10085 ··ac_status=$?
10081 ··$as_echo·"$as_me:${as_lineno-$LINENO}:·\$?·=·$ac_status"·>&510086 ··$as_echo·"$as_me:${as_lineno-$LINENO}:·\$?·=·$ac_status"·>&5
10082 ··test·$ac_status·=·0;·};·then10087 ··test·$ac_status·=·0;·};·then
10083 ····#·Now·try·to·grab·the·symbols.10088 ····#·Now·try·to·grab·the·symbols.
10084 ····nlist=conftest.nm10089 ····nlist=conftest.nm
10085 ····$ECHO·"$as_me:$LINENO:·$NM·conftest.$ac_objext·|·$lt_cv_sys_global_symbol_pipe·>·$nlist"·>&510090 ····if·{·{·eval·echo·"\"\$as_me\":${as_lineno-$LINENO}:·\"$NM·conftest.$ac_objext·\|·"$lt_cv_sys_global_symbol_pipe"·\>·$nlist\"";·}·>&5
10086 ····if·eval·"$NM"·conftest.$ac_objext·\|·"$lt_cv_sys_global_symbol_pipe"·\>·$nlist·2>&5·&&·test·-s·"$nlist";·then10091 ··(eval·$NM·conftest.$ac_objext·\|·"$lt_cv_sys_global_symbol_pipe"·\>·$nlist)·2>&5
 10092 ··ac_status=$?
 10093 ··$as_echo·"$as_me:${as_lineno-$LINENO}:·\$?·=·$ac_status"·>&5
 10094 ··test·$ac_status·=·0;·}·&&·test·-s·"$nlist";·then
10087 ······#·Try·sorting·and·uniquifying·the·output.10095 ······#·Try·sorting·and·uniquifying·the·output.
10088 ······if·sort·"$nlist"·|·uniq·>·"$nlist"T;·then10096 ······if·sort·"$nlist"·|·uniq·>·"$nlist"T;·then
10089 »       mv·-f·"$nlist"T·"$nlist"10097 »       mv·-f·"$nlist"T·"$nlist"
10090 ······else10098 ······else
10091 »       rm·-f·"$nlist"T10099 »       rm·-f·"$nlist"T
10092 ······fi10100 ······fi
  
Offset 10505, 18 lines modifiedOffset 10513, 18 lines modified
10505 »       case·$host·in10513 »       case·$host·in
10506 »       ··x86_64-*kfreebsd*-gnu)10514 »       ··x86_64-*kfreebsd*-gnu)
10507 »       ····LD="${LD-ld}·-m·elf_x86_64_fbsd"10515 »       ····LD="${LD-ld}·-m·elf_x86_64_fbsd"
10508 »       ····;;10516 »       ····;;
10509 »       ··x86_64-*linux*)10517 »       ··x86_64-*linux*)
10510 »       ····LD="${LD-ld}·-m·elf_x86_64"10518 »       ····LD="${LD-ld}·-m·elf_x86_64"
10511 »       ····;;10519 »       ····;;
10512 »       ··powerpcle-*linux*)10520 »       ··powerpcle-*linux*|powerpc64le-*linux*)
10513 »       ····LD="${LD-ld}·-m·elf64lppc"10521 »       ····LD="${LD-ld}·-m·elf64lppc"
10514 »       ····;;10522 »       ····;;
10515 »       ··powerpc-*linux*)10523 »       ··powerpc-*linux*|powerpc64-*linux*)
10516 »       ····LD="${LD-ld}·-m·elf64ppc"10524 »       ····LD="${LD-ld}·-m·elf64ppc"
10517 »       ····;;10525 »       ····;;
10518 »       ··s390*-*linux*|s390*-*tpf*)10526 »       ··s390*-*linux*|s390*-*tpf*)
10519 »       ····LD="${LD-ld}·-m·elf64_s390"10527 »       ····LD="${LD-ld}·-m·elf64_s390"
10520 »       ····;;10528 »       ····;;
10521 »       ··sparc*-*linux*)10529 »       ··sparc*-*linux*)
10522 »       ····LD="${LD-ld}·-m·elf64_sparc"10530 »       ····LD="${LD-ld}·-m·elf64_sparc"
Offset 12945, 17 lines modifiedOffset 12953, 14 lines modified
12945 ··interix*)12953 ··interix*)
12946 ····#·we·just·hope/assume·this·is·gcc·and·not·c89·(=·MSVC++)12954 ····#·we·just·hope/assume·this·is·gcc·and·not·c89·(=·MSVC++)
12947 ····with_gnu_ld=yes12955 ····with_gnu_ld=yes
12948 ····;;12956 ····;;
12949 ··openbsd*·|·bitrig*)12957 ··openbsd*·|·bitrig*)
12950 ····with_gnu_ld=no12958 ····with_gnu_ld=no
12951 ····;;12959 ····;;
12952 ··linux*·|·k*bsd*-gnu·|·gnu*) 
12953 ····link_all_deplibs=no 
12954 ····;; 
12955 ··esac12960 ··esac
  
12956 ··ld_shlibs=yes12961 ··ld_shlibs=yes
  
12957 ··#·On·some·targets,·GNU·ld·is·compatible·enough·with·the·native·linker12962 ··#·On·some·targets,·GNU·ld·is·compatible·enough·with·the·native·linker
12958 ··#·that·we're·better·off·using·the·native·interface·for·both.12963 ··#·that·we're·better·off·using·the·native·interface·for·both.
12959 ··lt_use_gnu_ld_interface=no12964 ··lt_use_gnu_ld_interface=no
Offset 13202, 15 lines modifiedOffset 13207, 15 lines modified
13202 »       ··;;13207 »       ··;;
13203 »       esac13208 »       esac
13204 ······else13209 ······else
13205 ········ld_shlibs=no13210 ········ld_shlibs=no
13206 ······fi13211 ······fi
13207 ······;;13212 ······;;
  
13208 ····netbsd*·|·netbsdelf*-gnu)13213 ····netbsd*)
13209 ······if·echo·__ELF__·|·$CC·-E·-·|·$GREP·__ELF__·>/dev/null;·then13214 ······if·echo·__ELF__·|·$CC·-E·-·|·$GREP·__ELF__·>/dev/null;·then
13210 »       archive_cmds='$LD·-Bshareable·$libobjs·$deplibs·$linker_flags·-o·$lib'13215 »       archive_cmds='$LD·-Bshareable·$libobjs·$deplibs·$linker_flags·-o·$lib'
13211 »       wlarc=13216 »       wlarc=
13212 ······else13217 ······else
13213 »       archive_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·-o·$lib'13218 »       archive_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·-o·$lib'
13214 »       archive_expsym_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·$wl-retain-symbols-file·$wl$export_symbols·-o·$lib'13219 »       archive_expsym_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·$wl-retain-symbols-file·$wl$export_symbols·-o·$lib'
13215 ······fi13220 ······fi
Offset 13872, 15 lines modifiedOffset 13877, 14 lines modified
13872 ···········LDFLAGS=$save_LDFLAGS13877 ···········LDFLAGS=$save_LDFLAGS
13873 fi13878 fi
13874 {·$as_echo·"$as_me:${as_lineno-$LINENO}:·result:·$lt_cv_irix_exported_symbol"·>&513879 {·$as_echo·"$as_me:${as_lineno-$LINENO}:·result:·$lt_cv_irix_exported_symbol"·>&5
13875 $as_echo·"$lt_cv_irix_exported_symbol"·>&6;·}13880 $as_echo·"$lt_cv_irix_exported_symbol"·>&6;·}
13876 »       if·test·yes·=·"$lt_cv_irix_exported_symbol";·then13881 »       if·test·yes·=·"$lt_cv_irix_exported_symbol";·then
13877 ··········archive_expsym_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·`test·-n·"$verstring"·&&·func_echo_all·"$wl-set_version·$wl$verstring"`·$wl-update_registry·$wl$output_objdir/so_locations·$wl-exports_file·$wl$export_symbols·-o·$lib'13882 ··········archive_expsym_cmds='$CC·-shared·$pic_flag·$libobjs·$deplibs·$compiler_flags·$wl-soname·$wl$soname·`test·-n·"$verstring"·&&·func_echo_all·"$wl-set_version·$wl$verstring"`·$wl-update_registry·$wl$output_objdir/so_locations·$wl-exports_file·$wl$export_symbols·-o·$lib'
13878 »       fi13883 »       fi
13879 »       link_all_deplibs=no 
13880 ······else13884 ······else
13881 »       archive_cmds='$CC·-shared·$libobjs·$deplibs·$compiler_flags·-soname·$soname·`test·-n·"$verstring"·&&·func_echo_all·"-set_version·$verstring"`·-update_registry·$output_objdir/so_locations·-o·$lib'13885 »       archive_cmds='$CC·-shared·$libobjs·$deplibs·$compiler_flags·-soname·$soname·`test·-n·"$verstring"·&&·func_echo_all·"-set_version·$verstring"`·-update_registry·$output_objdir/so_locations·-o·$lib'
13882 »       archive_expsym_cmds='$CC·-shared·$libobjs·$deplibs·$compiler_flags·-soname·$soname·`test·-n·"$verstring"·&&·func_echo_all·"-set_version·$verstring"`·-update_registry·$output_objdir/so_locations·-exports_file·$export_symbols·-o·$lib'13886 »       archive_expsym_cmds='$CC·-shared·$libobjs·$deplibs·$compiler_flags·-soname·$soname·`test·-n·"$verstring"·&&·func_echo_all·"-set_version·$verstring"`·-update_registry·$output_objdir/so_locations·-exports_file·$export_symbols·-o·$lib'
13883 ······fi13887 ······fi
13884 ······archive_cmds_need_lc='no'13888 ······archive_cmds_need_lc='no'
13885 ······hardcode_libdir_flag_spec='$wl-rpath·$wl$libdir'13889 ······hardcode_libdir_flag_spec='$wl-rpath·$wl$libdir'
13886 ······hardcode_libdir_separator=:13890 ······hardcode_libdir_separator=:
Offset 13894, 15 lines modifiedOffset 13898, 15 lines modified
13894 »       #·Fabrice·Bellard·et·al's·Tiny·C·Compiler13898 »       #·Fabrice·Bellard·et·al's·Tiny·C·Compiler
13895 »       ld_shlibs=yes13899 »       ld_shlibs=yes
Max diff block lines reached; 18469/23287 bytes (79.31%) of diff not shown.
79.0 KB
libsndfile-1.0.30/doc/api.html
    
Offset 1, 1012 lines modifiedOffset 1, 1012 lines modified
1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">.1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">
2 <HTML>.2 <HTML>
3 \xd 
4 <HEAD>.3 <HEAD>
5 »       <TITLE>.4 »       <TITLE>
6 »       The·libsndfile·API.5 »       The·libsndfile·API
7 »       </TITLE>.6 »       </TITLE>
8 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">.7 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">
9 »       <META·NAME="Description"·CONTENT="The·libsndfile·API.">.8 »       <META·NAME="Description"·CONTENT="The·libsndfile·API.">
10 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·libsndfile·sound·audio·dsp·Linux">.9 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·libsndfile·sound·audio·dsp·Linux">
11 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">.10 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">
12 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">.11 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">
13 </HEAD>.12 </HEAD>
14 \xd 
15 <BODY>.13 <BODY>
16 \xd 
17 <BR>.14 <BR>
18 <H1><B>libsndfile</B></H1>.15 <H1><B>libsndfile</B></H1>
19 <P>.16 <P>
20 »       Libsndfile·is·a·library·designed·to·allow·the·reading·and·writing·of·many.17 »       Libsndfile·is·a·library·designed·to·allow·the·reading·and·writing·of·many
21 »       different·sampled·sound·file·formats·(such·as·MS·Windows·WAV·and·the·Apple/SGI.18 »       different·sampled·sound·file·formats·(such·as·MS·Windows·WAV·and·the·Apple/SGI
22 »       AIFF·format)·through·one·standard·library·interface..19 »       AIFF·format)·through·one·standard·library·interface.
23 </P>.20 </P>
24 <!--·pepper·-->.21 <!--·pepper·-->
25 <P>.22 <P>
26 »       During·read·and·write·operations,·formats·are·seamlessly·converted·between·the.23 »       During·read·and·write·operations,·formats·are·seamlessly·converted·between·the
27 »       format·the·application·program·has·requested·or·supplied·and·the·file's·data.24 »       format·the·application·program·has·requested·or·supplied·and·the·file's·data
28 »       format.·The·application·programmer·can·remain·blissfully·unaware·of·issues.25 »       format.·The·application·programmer·can·remain·blissfully·unaware·of·issues
29 »       such·as·file·endian-ness·and·data·format.·See·<A·HREF="#note1">Note·1</A>·and.26 »       such·as·file·endian-ness·and·data·format.·See·<A·HREF="#note1">Note·1</A>·and
30 »       <A·HREF="#note2">Note·2</A>..27 »       <A·HREF="#note2">Note·2</A>.
31 </P>.28 </P>
32 <!--·pepper·-->.29 <!--·pepper·-->
33 <P>.30 <P>
34 »       Every·effort·is·made·to·keep·these·documents·up-to-date,·error·free·and.31 »       Every·effort·is·made·to·keep·these·documents·up-to-date,·error·free·and
35 »       unambiguous..32 »       unambiguous.
36 »       However,·since·maintaining·the·documentation·is·the·least·fun·part·of·working.33 »       However,·since·maintaining·the·documentation·is·the·least·fun·part·of·working
37 »       on·libsndfile,·these·docs·can·and·do·fall·behind·the·behaviour·of·the·library..34 »       on·libsndfile,·these·docs·can·and·do·fall·behind·the·behaviour·of·the·library.
38 »       If·any·errors,·omissions·or·ambiguities·are·found,·please·notify·me·(erikd).35 »       If·any·errors,·omissions·or·ambiguities·are·found,·please·notify·me·(erikd)
39 »       at·mega-nerd·dot·com..36 »       at·mega-nerd·dot·com.
40 </P>.37 </P>
41 <!--·pepper·-->.38 <!--·pepper·-->
42 <P>.39 <P>
43 »       To·supplement·this·reference·documentation,·there·are·simple·example·programs.40 »       To·supplement·this·reference·documentation,·there·are·simple·example·programs
44 »       included·in·the·source·code·tarball..41 »       included·in·the·source·code·tarball.
45 »       The·test·suite·which·is·also·part·of·the·source·code·tarball·is·also·a·good.42 »       The·test·suite·which·is·also·part·of·the·source·code·tarball·is·also·a·good
46 »       place·to·look·for·the·correct·usage·of·the·library·functions..43 »       place·to·look·for·the·correct·usage·of·the·library·functions.
47 </P>.44 </P>
48 <!--·pepper·-->.45 <!--·pepper·-->
49 <P>.46 <P>
50 »       <B>·Finally,·if·you·think·there·is·some·feature·missing·from·libsndfile,·check·that.47 »       <B>·Finally,·if·you·think·there·is·some·feature·missing·from·libsndfile,·check·that
51 »       it·isn't·already·implemented·(and·documented).48 »       it·isn't·already·implemented·(and·documented)
52 »       »       <A·HREF="command.html">here</A>..49 »       »       <A·HREF="command.html">here</A>.
53 »       </B>.50 »       </B>
54 </P>.51 </P>
55 \xd 
56 <H2><B>Synopsis</B></H2>.52 <H2><B>Synopsis</B></H2>
57 <P>.53 <P>
58 The·functions·of·libsndfile·are·defined·as·follows:.54 The·functions·of·libsndfile·are·defined·as·follows:
59 </P>.55 </P>
60 <!--·pepper·-->.56 <!--·pepper·-->
61 <PRE>.57 <PRE>
62 ······#include·&lt;stdio.h&gt;.58 ······#include·&lt;stdio.h&gt;
63 ······#include·&lt;sndfile.h&gt;.59 ······#include·&lt;sndfile.h&gt;
64 \xd 
65 ······SNDFILE*····<A·HREF="#open">sf_open</A>··········(const·char·*path,·int·mode,·SF_INFO·*sfinfo)·;.60 ······SNDFILE*····<A·HREF="#open">sf_open</A>··········(const·char·*path,·int·mode,·SF_INFO·*sfinfo)·;
66 ······SNDFILE*····<A·HREF="#open">sf_wchar_open</A>····(LPCWSTR·wpath,·int·mode,·SF_INFO·*sfinfo)·;.61 ······SNDFILE*····<A·HREF="#open">sf_wchar_open</A>····(LPCWSTR·wpath,·int·mode,·SF_INFO·*sfinfo)·;
67 ······SNDFILE*····<A·HREF="#open_fd">sf_open_fd</A>·······(int·fd,·int·mode,·SF_INFO·*sfinfo,·int·close_desc)·;.62 ······SNDFILE*····<A·HREF="#open_fd">sf_open_fd</A>·······(int·fd,·int·mode,·SF_INFO·*sfinfo,·int·close_desc)·;
68 ······SNDFILE*·»       ··<A·HREF="#open_virtual">sf_open_virtual</A>··(SF_VIRTUAL_IO·*sfvirtual,·int·mode,·SF_INFO·*sfinfo,·void·*user_data)·;.63 ······SNDFILE*·»       ··<A·HREF="#open_virtual">sf_open_virtual</A>··(SF_VIRTUAL_IO·*sfvirtual,·int·mode,·SF_INFO·*sfinfo,·void·*user_data)·;
69 ······int·········<A·HREF="#check">sf_format_check</A>··(const·SF_INFO·*info)·;.64 ······int·········<A·HREF="#check">sf_format_check</A>··(const·SF_INFO·*info)·;
70 \xd 
71 ······sf_count_t··<A·HREF="#seek">sf_seek</A>··········(SNDFILE·*sndfile,·sf_count_t·frames,·int·whence)·;.65 ······sf_count_t··<A·HREF="#seek">sf_seek</A>··········(SNDFILE·*sndfile,·sf_count_t·frames,·int·whence)·;
72 \xd 
73 ······int·········<A·HREF="command.html">sf_command</A>·······(SNDFILE·*sndfile,·int·cmd,·void·*data,·int·datasize)·;.66 ······int·········<A·HREF="command.html">sf_command</A>·······(SNDFILE·*sndfile,·int·cmd,·void·*data,·int·datasize)·;
74 \xd 
75 ······int·········<A·HREF="#error">sf_error</A>·········(SNDFILE·*sndfile)·;.67 ······int·········<A·HREF="#error">sf_error</A>·········(SNDFILE·*sndfile)·;
76 ······const·char*·<A·HREF="#error">sf_strerror</A>······(SNDFILE·*sndfile)·;.68 ······const·char*·<A·HREF="#error">sf_strerror</A>······(SNDFILE·*sndfile)·;
77 ······const·char*·<A·HREF="#error">sf_error_number</A>··(int·errnum)·;.69 ······const·char*·<A·HREF="#error">sf_error_number</A>··(int·errnum)·;
78 \xd 
79 ······int·········<A·HREF="#error">sf_perror</A>········(SNDFILE·*sndfile)·;.70 ······int·········<A·HREF="#error">sf_perror</A>········(SNDFILE·*sndfile)·;
80 ······int·········<A·HREF="#error">sf_error_str</A>·····(SNDFILE·*sndfile,·char*·str,·size_t·len)·;.71 ······int·········<A·HREF="#error">sf_error_str</A>·····(SNDFILE·*sndfile,·char*·str,·size_t·len)·;
81 \xd 
82 ······int·········<A·HREF="#close">sf_close</A>·········(SNDFILE·*sndfile)·;.72 ······int·········<A·HREF="#close">sf_close</A>·········(SNDFILE·*sndfile)·;
83 ······void········<A·HREF="#write_sync">sf_write_sync</A>····(SNDFILE·*sndfile)·;.73 ······void········<A·HREF="#write_sync">sf_write_sync</A>····(SNDFILE·*sndfile)·;
84 \xd 
85 ······sf_count_t··<A·HREF="#read">sf_read_short</A>····(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·items)·;.74 ······sf_count_t··<A·HREF="#read">sf_read_short</A>····(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·items)·;
86 ······sf_count_t··<A·HREF="#read">sf_read_int</A>······(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·items)·;.75 ······sf_count_t··<A·HREF="#read">sf_read_int</A>······(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·items)·;
87 ······sf_count_t··<A·HREF="#read">sf_read_float</A>····(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·items)·;.76 ······sf_count_t··<A·HREF="#read">sf_read_float</A>····(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·items)·;
88 ······sf_count_t··<A·HREF="#read">sf_read_double</A>···(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·items)·;.77 ······sf_count_t··<A·HREF="#read">sf_read_double</A>···(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·items)·;
89 \xd 
90 ······sf_count_t··<A·HREF="#readf">sf_readf_short</A>···(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·frames)·;.78 ······sf_count_t··<A·HREF="#readf">sf_readf_short</A>···(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·frames)·;
91 ······sf_count_t··<A·HREF="#readf">sf_readf_int</A>·····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·frames)·;.79 ······sf_count_t··<A·HREF="#readf">sf_readf_int</A>·····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·frames)·;
92 ······sf_count_t··<A·HREF="#readf">sf_readf_float</A>···(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·frames)·;.80 ······sf_count_t··<A·HREF="#readf">sf_readf_float</A>···(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·frames)·;
93 ······sf_count_t··<A·HREF="#readf">sf_readf_double</A>··(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·frames)·;.81 ······sf_count_t··<A·HREF="#readf">sf_readf_double</A>··(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·frames)·;
94 \xd 
95 ······sf_count_t··<A·HREF="#write">sf_write_short</A>···(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·items)·;.82 ······sf_count_t··<A·HREF="#write">sf_write_short</A>···(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·items)·;
96 ······sf_count_t··<A·HREF="#write">sf_write_int</A>·····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·items)·;.83 ······sf_count_t··<A·HREF="#write">sf_write_int</A>·····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·items)·;
97 ······sf_count_t··<A·HREF="#write">sf_write_float</A>···(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·items)·;.84 ······sf_count_t··<A·HREF="#write">sf_write_float</A>···(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·items)·;
98 ······sf_count_t··<A·HREF="#write">sf_write_double</A>··(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·items)·;.85 ······sf_count_t··<A·HREF="#write">sf_write_double</A>··(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·items)·;
99 \xd 
100 ······sf_count_t··<A·HREF="#writef">sf_writef_short</A>··(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·frames)·;.86 ······sf_count_t··<A·HREF="#writef">sf_writef_short</A>··(SNDFILE·*sndfile,·short·*ptr,·sf_count_t·frames)·;
101 ······sf_count_t··<A·HREF="#writef">sf_writef_int</A>····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·frames)·;.87 ······sf_count_t··<A·HREF="#writef">sf_writef_int</A>····(SNDFILE·*sndfile,·int·*ptr,·sf_count_t·frames)·;
102 ······sf_count_t··<A·HREF="#writef">sf_writef_float</A>··(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·frames)·;.88 ······sf_count_t··<A·HREF="#writef">sf_writef_float</A>··(SNDFILE·*sndfile,·float·*ptr,·sf_count_t·frames)·;
103 ······sf_count_t··<A·HREF="#writef">sf_writef_double</A>·(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·frames)·;.89 ······sf_count_t··<A·HREF="#writef">sf_writef_double</A>·(SNDFILE·*sndfile,·double·*ptr,·sf_count_t·frames)·;
104 \xd 
105 ······sf_count_t··<A·HREF="#raw">sf_read_raw</A>······(SNDFILE·*sndfile,·void·*ptr,·sf_count_t·bytes)·;.90 ······sf_count_t··<A·HREF="#raw">sf_read_raw</A>······(SNDFILE·*sndfile,·void·*ptr,·sf_count_t·bytes)·;
106 ······sf_count_t··<A·HREF="#raw">sf_write_raw</A>·····(SNDFILE·*sndfile,·void·*ptr,·sf_count_t·bytes)·;.91 ······sf_count_t··<A·HREF="#raw">sf_write_raw</A>·····(SNDFILE·*sndfile,·void·*ptr,·sf_count_t·bytes)·;
107 \xd 
108 ······const·char*·<A·HREF="#string">sf_get_string</A>····(SNDFILE·*sndfile,·int·str_type)·;.92 ······const·char*·<A·HREF="#string">sf_get_string</A>····(SNDFILE·*sndfile,·int·str_type)·;
109 ······int·········<A·HREF="#string">sf_set_string</A>····(SNDFILE·*sndfile,·int·str_type,·const·char*·str)·;.93 ······int·········<A·HREF="#string">sf_set_string</A>····(SNDFILE·*sndfile,·int·str_type,·const·char*·str)·;
110 \xd 
111 ······const·char*·<A·HREF="#version_string">sf_set_string</A>·····(void)·;.94 ······const·char*·<A·HREF="#version_string">sf_set_string</A>·····(void)·;
112 \xd 
113 ······int·········<A·HREF="#current_byterate">sf_current_byterate</A>·····(SNDFILE·*sndfile)·;.95 ······int·········<A·HREF="#current_byterate">sf_current_byterate</A>·····(SNDFILE·*sndfile)·;
114 \xd 
115 ······int·····················<A·HREF="#set_chunk">sf_set_chunk</A>···········(SNDFILE·*·sndfile,·const·SF_CHUNK_INFO·*·chunk_info)·;.96 ······int·····················<A·HREF="#set_chunk">sf_set_chunk</A>···········(SNDFILE·*·sndfile,·const·SF_CHUNK_INFO·*·chunk_info)·;
116 ······SF_CHUNK_ITERATOR·*·····<A·HREF="#get_chunk_iterator">sf_get_chunk_iterator</A>··(SNDFILE·*·sndfile,·const·SF_CHUNK_INFO·*·chunk_info)·;.97 ······SF_CHUNK_ITERATOR·*·····<A·HREF="#get_chunk_iterator">sf_get_chunk_iterator</A>··(SNDFILE·*·sndfile,·const·SF_CHUNK_INFO·*·chunk_info)·;
117 ······SF_CHUNK_ITERATOR·*·····<A·HREF="#next_chunk_iterator">sf_next_chunk_iterator</A>·(SF_CHUNK_ITERATOR·*·iterator)·;.98 ······SF_CHUNK_ITERATOR·*·····<A·HREF="#next_chunk_iterator">sf_next_chunk_iterator</A>·(SF_CHUNK_ITERATOR·*·iterator)·;
118 ······int·····················<A·HREF="#get_chunk_size">sf_get_chunk_size</A>······(const·SF_CHUNK_ITERATOR·*·it,·SF_CHUNK_INFO·*·chunk_info)·;.99 ······int·····················<A·HREF="#get_chunk_size">sf_get_chunk_size</A>······(const·SF_CHUNK_ITERATOR·*·it,·SF_CHUNK_INFO·*·chunk_info)·;
119 ······int·····················<A·HREF="#get_chunk_data">sf_get_chunk_data</A>······(const·SF_CHUNK_ITERATOR·*·it,·SF_CHUNK_INFO·*·chunk_info)·;.100 ······int·····················<A·HREF="#get_chunk_data">sf_get_chunk_data</A>······(const·SF_CHUNK_ITERATOR·*·it,·SF_CHUNK_INFO·*·chunk_info)·;
120 </PRE>.101 </PRE>
121 <!--·pepper·-->.102 <!--·pepper·-->
122 <P>.103 <P>
123 SNDFILE*·is·an·anonymous·pointer·to·data·which·is·private·to·the·library..104 SNDFILE*·is·an·anonymous·pointer·to·data·which·is·private·to·the·library.
124 </P>.105 </P>
125 \xd 
126 \xd 
127 <A·NAME="open"></A>.106 <A·NAME="open"></A>
Max diff block lines reached; -1/80796 bytes (-0.00%) of diff not shown.
123 KB
libsndfile-1.0.30/doc/command.html
    
Offset 1, 2093 lines modifiedOffset 1, 2093 lines modified
1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">.1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">
2 <HTML>.2 <HTML>
3 \xd 
4 <HEAD>.3 <HEAD>
5 »       <TITLE>.4 »       <TITLE>
6 »       libsndfile·:·the·sf_command·function..5 »       libsndfile·:·the·sf_command·function.
7 »       </TITLE>.6 »       </TITLE>
8 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">.7 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">
9 »       <!--·Another·version·at·the·bottom·of·the·page.··-->.8 »       <!--·Another·version·at·the·bottom·of·the·page.··-->
10 »       <META·NAME="Description"·CONTENT="The·libsndfile·API.">.9 »       <META·NAME="Description"·CONTENT="The·libsndfile·API.">
11 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·libsndfile·sound·audio·dsp·Linux">.10 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·libsndfile·sound·audio·dsp·Linux">
12 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">.11 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">
13 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">.12 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">
14 </HEAD>.13 </HEAD>
15 \xd 
16 <BODY>.14 <BODY>
17 \xd 
18 <H1><B>sf_command</B></H1>.15 <H1><B>sf_command</B></H1>
19 <PRE>.16 <PRE>
20 \xd 
21 ········int····sf_command·(SNDFILE·*sndfile,·int·cmd,·void·*data,·int·datasize)·;.17 ········int····sf_command·(SNDFILE·*sndfile,·int·cmd,·void·*data,·int·datasize)·;
22 </PRE>.18 </PRE>
23 <P>.19 <P>
24 »       This·function·allows·the·caller·to·retrieve·information·from·or·change·aspects·of·the.20 »       This·function·allows·the·caller·to·retrieve·information·from·or·change·aspects·of·the
25 »       library·behaviour..21 »       library·behaviour.
26 »       Examples·include·retrieving·a·string·containing·the·library·version·or·changing·the.22 »       Examples·include·retrieving·a·string·containing·the·library·version·or·changing·the
27 »       scaling·applied·to·floating·point·sample·data·during·read·and·write..23 »       scaling·applied·to·floating·point·sample·data·during·read·and·write.
28 »       Most·of·these·operations·are·performed·on·a·per-file·basis..24 »       Most·of·these·operations·are·performed·on·a·per-file·basis.
29 </P>.25 </P>
30 <P>.26 <P>
31 »       The·cmd·parameter·is·an·integer·identifier·which·is·defined·in·&lt;sndfile.h&gt;..27 »       The·cmd·parameter·is·an·integer·identifier·which·is·defined·in·&lt;sndfile.h&gt;.
32 »       All·of·the·valid·command·identifiers·have·names·beginning·with·"SFC_"..28 »       All·of·the·valid·command·identifiers·have·names·beginning·with·"SFC_".
33 »       Data·is·passed·to·and·returned·from·the·library·by·use·of·a·void·pointer..29 »       Data·is·passed·to·and·returned·from·the·library·by·use·of·a·void·pointer.
34 »       The·library·will·not·read·or·write·more·than·datasize·bytes·from·the·void·pointer..30 »       The·library·will·not·read·or·write·more·than·datasize·bytes·from·the·void·pointer.
35 »       For·some·calls·no·data·is·required·in·which·case·data·should·be·NULL·and·datasize.31 »       For·some·calls·no·data·is·required·in·which·case·data·should·be·NULL·and·datasize
36 »       may·be·used·for·some·other·purpose..32 »       may·be·used·for·some·other·purpose.
37 </P>.33 </P>
38 <P>.34 <P>
39 »       The·available·commands·are·as·follows:.35 »       The·available·commands·are·as·follows:
40 </P>.36 </P>
41 \xd 
42 <CENTER>.37 <CENTER>
43 <TABLE·BORDER="0"·WIDTH="90%"·CELLPADDING="4">.38 <TABLE·BORDER="0"·WIDTH="90%"·CELLPADDING="4">
44 <TR>.39 <TR>
45 »       <TD><A·HREF="#SFC_GET_LIB_VERSION">SFC_GET_LIB_VERSION</A></TD>.40 »       <TD><A·HREF="#SFC_GET_LIB_VERSION">SFC_GET_LIB_VERSION</A></TD>
46 »       <TD>Retrieve·the·version·of·the·library.</TD>.41 »       <TD>Retrieve·the·version·of·the·library.</TD>
47 </TR>.42 </TR>
48 <TR>.43 <TR>
49 »       <TD><A·HREF="#SFC_GET_LOG_INFO">SFC_GET_LOG_INFO</A></TD>.44 »       <TD><A·HREF="#SFC_GET_LOG_INFO">SFC_GET_LOG_INFO</A></TD>
50 »       <TD>Retrieve·the·internal·per-file·operation·log.</TD>.45 »       <TD>Retrieve·the·internal·per-file·operation·log.</TD>
51 </TR>.46 </TR>
52 <TR>.47 <TR>
53 »       <TD><A·HREF="#SFC_GET_CURRENT_SF_INFO">SFC_GET_CURRENT_SF_INFO</A></TD>.48 »       <TD><A·HREF="#SFC_GET_CURRENT_SF_INFO">SFC_GET_CURRENT_SF_INFO</A></TD>
54 »       <TD>Retrieve·<CODE>SF_INFO</CODE>·struct·of·opened·file.</TD>.49 »       <TD>Retrieve·<CODE>SF_INFO</CODE>·struct·of·opened·file.</TD>
55 </TR>.50 </TR>
56 <TR>.51 <TR>
57 »       <TD><A·HREF="#SFC_CALC_SIGNAL_MAX">SFC_CALC_SIGNAL_MAX</A></TD>.52 »       <TD><A·HREF="#SFC_CALC_SIGNAL_MAX">SFC_CALC_SIGNAL_MAX</A></TD>
58 »       <TD>Calculate·the·measured·maximum·signal·value.</TD>.53 »       <TD>Calculate·the·measured·maximum·signal·value.</TD>
59 </TR>.54 </TR>
60 <TR>.55 <TR>
61 »       <TD><A·HREF="#SFC_CALC_NORM_SIGNAL_MAX">SFC_CALC_NORM_SIGNAL_MAX</A></TD>.56 »       <TD><A·HREF="#SFC_CALC_NORM_SIGNAL_MAX">SFC_CALC_NORM_SIGNAL_MAX</A></TD>
62 »       <TD>Calculate·the·measured·normalised·maximum·signal·value.</TD>.57 »       <TD>Calculate·the·measured·normalised·maximum·signal·value.</TD>
63 </TR>.58 </TR>
64 <TR>.59 <TR>
65 »       <TD><A·HREF="#SFC_CALC_MAX_ALL_CHANNELS">SFC_CALC_MAX_ALL_CHANNELS</A></TD>.60 »       <TD><A·HREF="#SFC_CALC_MAX_ALL_CHANNELS">SFC_CALC_MAX_ALL_CHANNELS</A></TD>
66 »       <TD>Calculate·the·peak·value·for·each·channel.</TD>.61 »       <TD>Calculate·the·peak·value·for·each·channel.</TD>
67 </TR>.62 </TR>
68 <TR>.63 <TR>
69 »       <TD><A·HREF="#SFC_CALC_NORM_MAX_ALL_CHANNELS">SFC_CALC_NORM_MAX_ALL_CHANNELS</A></TD>.64 »       <TD><A·HREF="#SFC_CALC_NORM_MAX_ALL_CHANNELS">SFC_CALC_NORM_MAX_ALL_CHANNELS</A></TD>
70 »       <TD>Calculate·the·normalised·peak·for·each·channel.</TD>.65 »       <TD>Calculate·the·normalised·peak·for·each·channel.</TD>
71 </TR>.66 </TR>
72 \xd 
73 <TR>.67 <TR>
74 »       <TD><A·HREF="#SFC_GET_SIGNAL_MAX">SFC_GET_SIGNAL_MAX</A></TD>.68 »       <TD><A·HREF="#SFC_GET_SIGNAL_MAX">SFC_GET_SIGNAL_MAX</A></TD>
75 »       <TD>Retrieve·the·peak·value·for·the·file·(as·stored·in·the·file·header).</TD>.69 »       <TD>Retrieve·the·peak·value·for·the·file·(as·stored·in·the·file·header).</TD>
76 </TR>.70 </TR>
77 <TR>.71 <TR>
78 »       <TD><A·HREF="#SFC_GET_MAX_ALL_CHANNELS">SFC_GET_MAX_ALL_CHANNELS</A></TD>.72 »       <TD><A·HREF="#SFC_GET_MAX_ALL_CHANNELS">SFC_GET_MAX_ALL_CHANNELS</A></TD>
79 »       <TD>Retrieve·the·peak·value·for·each·channel··(as·stored·in·the·file·header).</TD>.73 »       <TD>Retrieve·the·peak·value·for·each·channel··(as·stored·in·the·file·header).</TD>
80 </TR>.74 </TR>
81 \xd 
82 <TR>.75 <TR>
83 »       <TD><A·HREF="#SFC_SET_NORM_FLOAT">SFC_SET_NORM_FLOAT</A></TD>.76 »       <TD><A·HREF="#SFC_SET_NORM_FLOAT">SFC_SET_NORM_FLOAT</A></TD>
84 »       <TD>Modify·the·normalisation·behaviour·of·the·floating·point·reading·and·writing·functions.</TD>.77 »       <TD>Modify·the·normalisation·behaviour·of·the·floating·point·reading·and·writing·functions.</TD>
85 </TR>.78 </TR>
86 <TR>.79 <TR>
87 »       <TD><A·HREF="#SFC_SET_NORM_DOUBLE">SFC_SET_NORM_DOUBLE</A></TD>.80 »       <TD><A·HREF="#SFC_SET_NORM_DOUBLE">SFC_SET_NORM_DOUBLE</A></TD>
88 »       <TD>Modify·the·normalisation·behaviour·of·the·double·precision·floating·point·reading·and·writing·functions.</TD>.81 »       <TD>Modify·the·normalisation·behaviour·of·the·double·precision·floating·point·reading·and·writing·functions.</TD>
89 </TR>.82 </TR>
90 <TR>.83 <TR>
91 »       <TD><A·HREF="#SFC_GET_NORM_FLOAT">SFC_GET_NORM_FLOAT</A></TD>.84 »       <TD><A·HREF="#SFC_GET_NORM_FLOAT">SFC_GET_NORM_FLOAT</A></TD>
92 »       <TD>Retrieve·the·current·normalisation·behaviour·of·the·floating·point·reading·and·writing·functions.</TD>.85 »       <TD>Retrieve·the·current·normalisation·behaviour·of·the·floating·point·reading·and·writing·functions.</TD>
93 </TR>.86 </TR>
94 <TR>.87 <TR>
95 »       <TD><A·HREF="#SFC_GET_NORM_DOUBLE">SFC_GET_NORM_DOUBLE</A></TD>.88 »       <TD><A·HREF="#SFC_GET_NORM_DOUBLE">SFC_GET_NORM_DOUBLE</A></TD>
96 »       <TD>Retrieve·the·current·normalisation·behaviour·of·the·double·precision·floating·point·reading·and·writing·functions.</TD>.89 »       <TD>Retrieve·the·current·normalisation·behaviour·of·the·double·precision·floating·point·reading·and·writing·functions.</TD>
97 </TR>.90 </TR>
98 <TR>.91 <TR>
99 »       <TD><A·HREF="#SFC_SET_SCALE_FLOAT_INT_READ">SFC_SET_SCALE_FLOAT_INT_READ</A></TD>.92 »       <TD><A·HREF="#SFC_SET_SCALE_FLOAT_INT_READ">SFC_SET_SCALE_FLOAT_INT_READ</A></TD>
100 »       <TD>Set/clear·the·scale·factor·when·integer·(short/int)·data·is·read·from·a·file.93 »       <TD>Set/clear·the·scale·factor·when·integer·(short/int)·data·is·read·from·a·file
101 »       containing·floating·point·data.</TD>.94 »       containing·floating·point·data.</TD>
102 </TR>.95 </TR>
103 \xd 
104 <TR>.96 <TR>
105 »       <TD><A·HREF="#SFC_SET_SCALE_INT_FLOAT_WRITE">SFC_SET_SCALE_INT_FLOAT_WRITE</A></TD>.97 »       <TD><A·HREF="#SFC_SET_SCALE_INT_FLOAT_WRITE">SFC_SET_SCALE_INT_FLOAT_WRITE</A></TD>
106 »       <TD>Set/clear·the·scale·factor·when·integer·(short/int)·data·is·written·to·a·file.98 »       <TD>Set/clear·the·scale·factor·when·integer·(short/int)·data·is·written·to·a·file
107 »       as·floating·point·data.</TD>.99 »       as·floating·point·data.</TD>
108 </TR>.100 </TR>
109 \xd 
110 <TR>.101 <TR>
111 »       <TD><A·HREF="#SFC_GET_SIMPLE_FORMAT_COUNT">SFC_GET_SIMPLE_FORMAT_COUNT</A></TD>.102 »       <TD><A·HREF="#SFC_GET_SIMPLE_FORMAT_COUNT">SFC_GET_SIMPLE_FORMAT_COUNT</A></TD>
112 »       <TD>Retrieve·the·number·of·simple·formats·supported·by·libsndfile.</TD>.103 »       <TD>Retrieve·the·number·of·simple·formats·supported·by·libsndfile.</TD>
113 </TR>.104 </TR>
114 <TR>.105 <TR>
115 »       <TD><A·HREF="#SFC_GET_SIMPLE_FORMAT">SFC_GET_SIMPLE_FORMAT</A></TD>.106 »       <TD><A·HREF="#SFC_GET_SIMPLE_FORMAT">SFC_GET_SIMPLE_FORMAT</A></TD>
116 »       <TD>Retrieve·information·about·a·simple·format.</TD>.107 »       <TD>Retrieve·information·about·a·simple·format.</TD>
117 </TR>.108 </TR>
118 \xd 
119 <TR>.109 <TR>
120 »       <TD><A·HREF="#SFC_GET_FORMAT_INFO">SFC_GET_FORMAT_INFO</A></TD>.110 »       <TD><A·HREF="#SFC_GET_FORMAT_INFO">SFC_GET_FORMAT_INFO</A></TD>
121 »       <TD>Retrieve·information·about·a·major·or·subtype·format.</TD>.111 »       <TD>Retrieve·information·about·a·major·or·subtype·format.</TD>
122 </TR>.112 </TR>
123 \xd 
124 <TR>.113 <TR>
125 »       <TD><A·HREF="#SFC_GET_FORMAT_MAJOR_COUNT">SFC_GET_FORMAT_MAJOR_COUNT</A></TD>.114 »       <TD><A·HREF="#SFC_GET_FORMAT_MAJOR_COUNT">SFC_GET_FORMAT_MAJOR_COUNT</A></TD>
126 »       <TD>Retrieve·the·number·of·major·formats.</TD>.115 »       <TD>Retrieve·the·number·of·major·formats.</TD>
127 </TR>.116 </TR>
Max diff block lines reached; -1/126287 bytes (-0.00%) of diff not shown.
25.6 KB
libsndfile-1.0.30/doc/formats.html
    
Offset 1, 545 lines modifiedOffset 1, 545 lines modified
1 <!DOCTYPE·html>.1 <!DOCTYPE·html>
2 <html·lang="en">.2 <html·lang="en">
3 \xd 
4 <head>.3 <head>
5 ··<TITLE>.4 ··<TITLE>
6 ····libsndfile:·Supported·formats.5 ····libsndfile:·Supported·formats
7 ··</TITLE>.6 ··</TITLE>
8 ··<meta·name="Author"·content="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">.7 ··<meta·name="Author"·content="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">
9 ··<meta·name="Version"·content="libsndfile-1.0.30">.8 ··<meta·name="Version"·content="libsndfile-1.0.30">
10 ··<meta·name="viewport"·content="width=device-width,·initial-scale=1.0">.9 ··<meta·name="viewport"·content="width=device-width,·initial-scale=1.0">
11 ··<meta·charset="UTF-8">.10 ··<meta·charset="UTF-8">
12 ··<link·rel="stylesheet"·href="libsndfile.css"·type="text/css"·media="all">.11 ··<link·rel="stylesheet"·href="libsndfile.css"·type="text/css"·media="all">
13 ··<link·rel="stylesheet"·href="print.css"·type="text/css"·media="print">.12 ··<link·rel="stylesheet"·href="print.css"·type="text/css"·media="print">
14 ··<style·type="text/css">.13 ··<style·type="text/css">
15 ····td,.14 ····td,
16 ····th·{.15 ····th·{
17 ······text-align:·center;.16 ······text-align:·center;
18 ······font-size:·small;.17 ······font-size:·small;
19 ····}.18 ····}
20 \xd 
21 ····td:first-child·{.19 ····td:first-child·{
22 ······text-align:·left.20 ······text-align:·left
23 ····}.21 ····}
24 ··</style>.22 ··</style>
25 </head>.23 </head>
26 \xd 
27 <body>.24 <body>
28 ··<h1>libsndfile·:·Supported·formats</h1>.25 ··<h1>libsndfile·:·Supported·formats</h1>
29 ··<p>.26 ··<p>
30 ····The·following·table·lists·the·file·formats·and·encodings·that·libsndfile.27 ····The·following·table·lists·the·file·formats·and·encodings·that·libsndfile
31 ····can·read·and·write..28 ····can·read·and·write.
32 ····The·file·formats·are·arranged·across·the·top·and·encodings·along·the·left.29 ····The·file·formats·are·arranged·across·the·top·and·encodings·along·the·left
33 ····edge..30 ····edge.
34 ··</p>.31 ··</p>
35 \xd 
36 ··<table·border="1"·cellpadding="2">.32 ··<table·border="1"·cellpadding="2">
37 ····<thead>.33 ····<thead>
38 ······<tr>.34 ······<tr>
39 ········<td>&nbsp;</td>.35 ········<td>&nbsp;</td>
40 ········<td>Microsoft·WAV</td>.36 ········<td>Microsoft·WAV</td>
41 ········<td>SGI·/·Apple·AIFF·/·AIFC</td>.37 ········<td>SGI·/·Apple·AIFF·/·AIFC</td>
42 ········<td>Sun·/·DEC·/·NeXT·AU·/·SND</td>.38 ········<td>Sun·/·DEC·/·NeXT·AU·/·SND</td>
43 ········<td>Headerless·RAW</td>.39 ········<td>Headerless·RAW</td>
44 ········<td>Paris·Audio·File·PAF</td>.40 ········<td>Paris·Audio·File·PAF</td>
45 ········<td>Commodore·Amiga·IFF·/·SVX</td>.41 ········<td>Commodore·Amiga·IFF·/·SVX</td>
46 ········<td>Sphere·Nist·WAV</td>.42 ········<td>Sphere·Nist·WAV</td>
47 ········<td>IRCAM·SF</td>.43 ········<td>IRCAM·SF</td>
48 ········<td>Creative·VOC</td>.44 ········<td>Creative·VOC</td>
49 ········<td>Soundforge·W64</td>.45 ········<td>Soundforge·W64</td>
50 ········<td><a·href="octave.html">GNU·Octave&nbsp;2.0</a>·MAT4</td>.46 ········<td><a·href="octave.html">GNU·Octave&nbsp;2.0</a>·MAT4</td>
51 ········<td><a·href="octave.html">GNU·Octave&nbsp;2.1</a>·MAT5</td>.47 ········<td><a·href="octave.html">GNU·Octave&nbsp;2.1</a>·MAT5</td>
52 ········<td>Portable·Voice·Format·PVF</td>.48 ········<td>Portable·Voice·Format·PVF</td>
53 ········<td>Fasttracker&nbsp;2·XI</td>.49 ········<td>Fasttracker&nbsp;2·XI</td>
54 ········<td>HMM·Tool·Kit·HTK</td>.50 ········<td>HMM·Tool·Kit·HTK</td>
55 ········<td>Apple·CAF</td>.51 ········<td>Apple·CAF</td>
56 ········<td>Sound·Designer&nbsp;II·SD2</td>.52 ········<td>Sound·Designer&nbsp;II·SD2</td>
57 ········<td>Free·Lossless·Audio·Codec·FLAC</td>.53 ········<td>Free·Lossless·Audio·Codec·FLAC</td>
58 ······</tr>.54 ······</tr>
59 ····</thead>.55 ····</thead>
60 ····<tbody>.56 ····<tbody>
61 ······<tr>.57 ······<tr>
62 ········<td>Unsigned·8·bit·PCM</td>.58 ········<td>Unsigned·8·bit·PCM</td>
63 ········<td>R/W</td>.59 ········<td>R/W</td>
64 ········<td>R/W</td>.60 ········<td>R/W</td>
65 ········<td>&nbsp;</td>.61 ········<td>&nbsp;</td>
66 ········<td>R/W</td>.62 ········<td>R/W</td>
67 ········<td>&nbsp;</td>.63 ········<td>&nbsp;</td>
68 ········<td>&nbsp;</td>.64 ········<td>&nbsp;</td>
69 ········<td>&nbsp;</td>.65 ········<td>&nbsp;</td>
70 ········<td>&nbsp;</td>.66 ········<td>&nbsp;</td>
71 ········<td>R/W</td>.67 ········<td>R/W</td>
72 ········<td>R/W</td>.68 ········<td>R/W</td>
73 ········<td>&nbsp;</td>.69 ········<td>&nbsp;</td>
74 ········<td>R/W</td>.70 ········<td>R/W</td>
75 ········<td>&nbsp;</td>.71 ········<td>&nbsp;</td>
76 ········<td>&nbsp;</td>.72 ········<td>&nbsp;</td>
77 ········<td>&nbsp;</td>.73 ········<td>&nbsp;</td>
78 ········<td>&nbsp;</td>.74 ········<td>&nbsp;</td>
79 ········<td>&nbsp;</td>.75 ········<td>&nbsp;</td>
80 ········<td>&nbsp;</td>.76 ········<td>&nbsp;</td>
81 ······</tr>.77 ······</tr>
82 \xd 
83 ······<tr>.78 ······<tr>
84 ········<td>Signed·8·bit·PCM</td>.79 ········<td>Signed·8·bit·PCM</td>
85 ········<td>&nbsp;</td>.80 ········<td>&nbsp;</td>
86 ········<td>R/W</td>.81 ········<td>R/W</td>
87 ········<td>R/W</td>.82 ········<td>R/W</td>
88 ········<td>R/W</td>.83 ········<td>R/W</td>
89 ········<td>R/W</td>.84 ········<td>R/W</td>
90 ········<td>R/W</td>.85 ········<td>R/W</td>
91 ········<td>R/W</td>.86 ········<td>R/W</td>
92 ········<td>&nbsp;</td>.87 ········<td>&nbsp;</td>
93 ········<td>&nbsp;</td>.88 ········<td>&nbsp;</td>
94 ········<td>&nbsp;</td>.89 ········<td>&nbsp;</td>
95 ········<td>&nbsp;</td>.90 ········<td>&nbsp;</td>
96 ········<td>&nbsp;</td>.91 ········<td>&nbsp;</td>
97 ········<td>R/W</td>.92 ········<td>R/W</td>
98 ········<td>&nbsp;</td>.93 ········<td>&nbsp;</td>
99 ········<td>&nbsp;</td>.94 ········<td>&nbsp;</td>
100 ········<td>R/W</td>.95 ········<td>R/W</td>
101 ········<td>R/W</td>.96 ········<td>R/W</td>
102 ········<td>R/W</td>.97 ········<td>R/W</td>
103 ······</tr>.98 ······</tr>
104 \xd 
105 ······<tr>.99 ······<tr>
106 ········<td>Signed·16·bit·PCM</td>.100 ········<td>Signed·16·bit·PCM</td>
107 ········<td>R/W</td>.101 ········<td>R/W</td>
108 ········<td>R/W</td>.102 ········<td>R/W</td>
109 ········<td>R/W</td>.103 ········<td>R/W</td>
110 ········<td>R/W</td>.104 ········<td>R/W</td>
111 ········<td>R/W</td>.105 ········<td>R/W</td>
112 ········<td>R/W</td>.106 ········<td>R/W</td>
113 ········<td>R/W</td>.107 ········<td>R/W</td>
114 ········<td>R/W</td>.108 ········<td>R/W</td>
115 ········<td>R/W</td>.109 ········<td>R/W</td>
116 ········<td>R/W</td>.110 ········<td>R/W</td>
117 ········<td>R/W</td>.111 ········<td>R/W</td>
118 ········<td>R/W</td>.112 ········<td>R/W</td>
119 ········<td>R/W</td>.113 ········<td>R/W</td>
120 ········<td>&nbsp;</td>.114 ········<td>&nbsp;</td>
121 ········<td>R/W</td>.115 ········<td>R/W</td>
122 ········<td>R/W</td>.116 ········<td>R/W</td>
123 ········<td>R/W</td>.117 ········<td>R/W</td>
124 ········<td>R/W</td>.118 ········<td>R/W</td>
125 ······</tr>.119 ······</tr>
126 \xd 
127 ······<tr>.120 ······<tr>
Max diff block lines reached; -1/26187 bytes (-0.00%) of diff not shown.
25.6 KB
libsndfile-1.0.30/doc/index.html
    
Offset 1, 290 lines modifiedOffset 1, 290 lines modified
1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">.1 <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.0·Transitional//EN">
2 <HTML>.2 <HTML>
3 \xd 
4 <HEAD>.3 <HEAD>
5 »       <TITLE>.4 »       <TITLE>
6 »       libsndfile.5 »       libsndfile
7 »       </TITLE>.6 »       </TITLE>
8 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">.7 »       <META·NAME="Author"······CONTENT="Erik·de·Castro·Lopo·(erikd·AT·mega-nerd·DOT·com)">
9 ····<META·NAME="Version"·····CONTENT="libsndfile-1.0.30">.8 ····<META·NAME="Version"·····CONTENT="libsndfile-1.0.30">
10 »       <META·NAME="Description"·CONTENT="The·libsndfile·Home·Page">.9 »       <META·NAME="Description"·CONTENT="The·libsndfile·Home·Page">
11 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·SVX·PAF·NIST·W64·libsndfile·sound·audio·dsp·Linux">.10 »       <META·NAME="Keywords"····CONTENT="WAV·AIFF·AU·SVX·PAF·NIST·W64·libsndfile·sound·audio·dsp·Linux">
12 »       <META·NAME="ROBOTS"·»     ·CONTENT="NOFOLLOW">.11 »       <META·NAME="ROBOTS"·»     ·CONTENT="NOFOLLOW">
13 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">.12 »       <LINK·REL="stylesheet"·HREF="libsndfile.css"·TYPE="text/css"·MEDIA="all">
14 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">.13 »       <LINK·REL="stylesheet"·HREF="print.css"·TYPE="text/css"·MEDIA="print">
15 </HEAD>.14 </HEAD>
16 \xd 
17 <BODY>.15 <BODY>
18 <!--·pepper·-->.16 <!--·pepper·-->
19 <CENTER>.17 <CENTER>
20 »       <IMG·SRC="libsndfile.jpg"·HEIGHT=98·WIDTH=367·ALT="libsndfile.jpg">.18 »       <IMG·SRC="libsndfile.jpg"·HEIGHT=98·WIDTH=367·ALT="libsndfile.jpg">
21 </CENTER>.19 </CENTER>
22 <!--·pepper·-->.20 <!--·pepper·-->
23 <CENTER>.21 <CENTER>
24 »       »       <A·HREF="#History">History</A>·-+-.22 »       »       <A·HREF="#History">History</A>·-+-
25 »       »       <A·HREF="#Features">Features</A>·-+-.23 »       »       <A·HREF="#Features">Features</A>·-+-
26 »       »       <A·HREF="#Similar">Similar·or·Related·Projects</A>·-+-.24 »       »       <A·HREF="#Similar">Similar·or·Related·Projects</A>·-+-
27 »       »       <A·HREF="NEWS">News</A>.25 »       »       <A·HREF="NEWS">News</A>
28 »       »       <br>.26 »       »       <br>
29 »       »       <A·HREF="development.html">Development</A>·-+-.27 »       »       <A·HREF="development.html">Development</A>·-+-
30 »       »       <A·HREF="api.html">Programming·Interface</A>·-+-.28 »       »       <A·HREF="api.html">Programming·Interface</A>·-+-
31 »       »       <A·HREF="bugs.html">Bug·Reporting</A>·-+-.29 »       »       <A·HREF="bugs.html">Bug·Reporting</A>·-+-
32 »       »       <A·HREF="#Download">Download</A>.30 »       »       <A·HREF="#Download">Download</A>
33 »       »       <br>.31 »       »       <br>
34 »       »       <A·HREF="FAQ.html">FAQ</A>·-+-.32 »       »       <A·HREF="FAQ.html">FAQ</A>·-+-
35 »       »       <A·HREF="lists.html">Mailing·Lists</A>·-+-.33 »       »       <A·HREF="lists.html">Mailing·Lists</A>·-+-
36 »       »       <A·HREF="ChangeLog">Change·Log</A>·-+-.34 »       »       <A·HREF="ChangeLog">Change·Log</A>·-+-
37 »       »       <A·HREF="#Licensing">Licensing·Information</A>·-+-.35 »       »       <A·HREF="#Licensing">Licensing·Information</A>·-+-
38 »       »       <A·HREF="#SeeAlso">See·Also</A>.36 »       »       <A·HREF="#SeeAlso">See·Also</A>
39 </CENTER>.37 </CENTER>
40 \xd 
41 <br><br>.38 <br><br>
42 <P>.39 <P>
43 »       Libsndfile·is·a·C·library·for·reading·and·writing·files·containing·sampled·sound.40 »       Libsndfile·is·a·C·library·for·reading·and·writing·files·containing·sampled·sound
44 »       (such·as·MS·Windows·WAV·and·the·Apple/SGI·AIFF·format)·through·one·standard.41 »       (such·as·MS·Windows·WAV·and·the·Apple/SGI·AIFF·format)·through·one·standard
45 »       library·interface.·It·is·released·in·source·code·format·under·the.42 »       library·interface.·It·is·released·in·source·code·format·under·the
46 »       »       <A·HREF="http://www.gnu.org/copyleft/lesser.html">Gnu·Lesser·General·Public·License</A>..43 »       »       <A·HREF="http://www.gnu.org/copyleft/lesser.html">Gnu·Lesser·General·Public·License</A>.
47 </P>.44 </P>
48 <!--·pepper·-->.45 <!--·pepper·-->
49 <P>.46 <P>
50 »       The·library·was·written·to·compile·and·run·on·a·Linux·system·but·should·compile.47 »       The·library·was·written·to·compile·and·run·on·a·Linux·system·but·should·compile
51 »       and·run·on·just·about·any·Unix·(including·MacOS·X)..48 »       and·run·on·just·about·any·Unix·(including·MacOS·X).
52 »       There·are·also·pre-compiled·binaries·available·for·32·and·64·bit·windows..49 »       There·are·also·pre-compiled·binaries·available·for·32·and·64·bit·windows.
53 </P>.50 </P>
54 <P>.51 <P>
55 »       It·was·designed·to·handle·both·little-endian·(such·as·WAV)·and·big-endian.52 »       It·was·designed·to·handle·both·little-endian·(such·as·WAV)·and·big-endian
56 »       (such·as·AIFF)·data,·and·to·compile·and·run·correctly·on·little-endian·(such·as·Intel.53 »       (such·as·AIFF)·data,·and·to·compile·and·run·correctly·on·little-endian·(such·as·Intel
57 »       and·DEC/Compaq·Alpha)·processor·systems·as·well·as·big-endian·processor·systems·such.54 »       and·DEC/Compaq·Alpha)·processor·systems·as·well·as·big-endian·processor·systems·such
58 »       as·Motorola·68k,·Power·PC,·MIPS·and·Sparc..55 »       as·Motorola·68k,·Power·PC,·MIPS·and·Sparc.
59 »       Hopefully·the·design·of·the·library·will·also·make·it·easy·to·extend·for·reading·and.56 »       Hopefully·the·design·of·the·library·will·also·make·it·easy·to·extend·for·reading·and
60 »       writing·new·sound·file·formats..57 »       writing·new·sound·file·formats.
61 </P>.58 </P>
62 <!--·pepper·-->.59 <!--·pepper·-->
63 <P>.60 <P>
64 ····It·has·been·compiled·and·tested·(at·one·time·or·another)·on·the·following·systems:.61 ····It·has·been·compiled·and·tested·(at·one·time·or·another)·on·the·following·systems:
65 </P>.62 </P>
66 <!--·pepper·-->.63 <!--·pepper·-->
67 <UL>.64 <UL>
68 »       <LI>Every·platform·supported·by·Debian·GNU/Linux·including·x86_64-linux-gnu,.65 »       <LI>Every·platform·supported·by·Debian·GNU/Linux·including·x86_64-linux-gnu,
69 »       »       i486-linux-gnu,·powerpc-linux-gnu,·sparc-linux-gnu,·alpha-linux-gnu,.66 »       »       i486-linux-gnu,·powerpc-linux-gnu,·sparc-linux-gnu,·alpha-linux-gnu,
70 »       »       mips-linux-gnu·and·armel-linux-gnu.</LI>.67 »       »       mips-linux-gnu·and·armel-linux-gnu.</LI>
71 »       <LI>powerpc-apple-darwin7.0·(Mac·OS·X·10.3)</LI>.68 »       <LI>powerpc-apple-darwin7.0·(Mac·OS·X·10.3)</LI>
72 »       <LI>sparc-sun-solaris2.8·(using·gcc)</LI>.69 »       <LI>sparc-sun-solaris2.8·(using·gcc)</LI>
73 »       <LI>mips-sgi-irix5.3·(using·gcc)</LI>.70 »       <LI>mips-sgi-irix5.3·(using·gcc)</LI>
74 »       <LI>QNX·6.0</LI>.71 »       <LI>QNX·6.0</LI>
75 »       <LI>i386-unknown-openbsd2.9</LI>.72 »       <LI>i386-unknown-openbsd2.9</LI>
76 </UL>.73 </UL>
77 <!--·pepper·-->.74 <!--·pepper·-->
78 <P>.75 <P>
79 »       At·the·moment,·each·new·release·is·being·tested·on·i386·Linux,·x86_64·Linux,.76 »       At·the·moment,·each·new·release·is·being·tested·on·i386·Linux,·x86_64·Linux,
80 »       PowerPC·Linux,·Win32·and·Win64..77 »       PowerPC·Linux,·Win32·and·Win64.
81 </P>.78 </P>
82 <!--·pepper·-->.79 <!--·pepper·-->
83 \xd 
84 <A·NAME="Capabilities"></A>.80 <A·NAME="Capabilities"></A>
85 <A·NAME="Features"></A>.81 <A·NAME="Features"></A>
86 <H1><B>Features</B></H1>.82 <H1><B>Features</B></H1>
87 <P>.83 <P>
88 »       libsndfile·has·the·following·main·features·:.84 »       libsndfile·has·the·following·main·features·:
89 </P>.85 </P>
90 »       <UL>.86 »       <UL>
91 »       <lI>·Ability·to·read·and·write·a·large·number·of·<A·HREF="formats.html">.87 »       <lI>·Ability·to·read·and·write·a·large·number·of·<A·HREF="formats.html">
92 »       »       file·formats</A>..88 »       »       file·formats</A>.
93 »       <LI>·A·simple,·elegant·and·easy·to·use·Applications·Programming·Interface..89 »       <LI>·A·simple,·elegant·and·easy·to·use·Applications·Programming·Interface.
94 »       <LI>·Usable·on·Unix,·Win32,·MacOS·and·others..90 »       <LI>·Usable·on·Unix,·Win32,·MacOS·and·others.
95 »       <LI>·On·the·fly·format·conversion,·including·endian-ness·swapping,·type·conversion.91 »       <LI>·On·the·fly·format·conversion,·including·endian-ness·swapping,·type·conversion
96 »       »       »       and·bitwidth·scaling..92 »       »       »       and·bitwidth·scaling.
97 »       <LI>·Optional·normalisation·when·reading·floating·point·data·from·files·containing.93 »       <LI>·Optional·normalisation·when·reading·floating·point·data·from·files·containing
98 »       »       »       integer·data..94 »       »       »       integer·data.
99 »       <LI>·Ability·to·open·files·in·read/write·mode..95 »       <LI>·Ability·to·open·files·in·read/write·mode.
100 »       <LI>·The·ability·to·write·the·file·header·without·closing·the·file·(only·on·files.96 »       <LI>·The·ability·to·write·the·file·header·without·closing·the·file·(only·on·files
101 »       »       »       open·for·write·or·read/write)..97 »       »       »       open·for·write·or·read/write).
102 »       <LI>·Ability·to·query·the·library·about·all·supported·formats·and·retrieve·text.98 »       <LI>·Ability·to·query·the·library·about·all·supported·formats·and·retrieve·text
103 »       »       »       strings·describing·each·format..99 »       »       »       strings·describing·each·format.
104 »       </UL>.100 »       </UL>
105 <P>.101 <P>
106 »       libsndfile·has·a·comprehensive·test·suite·so·that·each·release·is·as·bug·free.102 »       libsndfile·has·a·comprehensive·test·suite·so·that·each·release·is·as·bug·free
107 »       as·possible..103 »       as·possible.
108 »       When·new·bugs·are·found,·new·tests·are·added·to·the·test·suite·to·ensure·that.104 »       When·new·bugs·are·found,·new·tests·are·added·to·the·test·suite·to·ensure·that
109 »       these·bugs·don't·creep·back·into·the·code..105 »       these·bugs·don't·creep·back·into·the·code.
110 »       When·new·features·are·added,·tests·are·added·to·the·test·suite·to·make·sure·that.106 »       When·new·features·are·added,·tests·are·added·to·the·test·suite·to·make·sure·that
111 »       these·features·continue·to·work·correctly·even·when·they·are·old·features..107 »       these·features·continue·to·work·correctly·even·when·they·are·old·features.
112 ·</P>.108 ·</P>
113 <!--·pepper·-->.109 <!--·pepper·-->
114 \xd 
115 <A·NAME="History"></A>.110 <A·NAME="History"></A>
116 <H1><B>History</B></H1>.111 <H1><B>History</B></H1>
117 <P>.112 <P>
118 »       My·first·attempt·at·reading·and·writing·WAV·files·was·in·1990·or·so·under·Windows.113 »       My·first·attempt·at·reading·and·writing·WAV·files·was·in·1990·or·so·under·Windows
119 »       3.1..114 »       3.1.
120 »       I·started·using·Linux·in·early·1995·and·contributed·some·code·to·the.115 »       I·started·using·Linux·in·early·1995·and·contributed·some·code·to·the
121 »       »       <A·HREF="http://www.vaxxine.com/ve3wwg/gnuwave.html">wavplay</A>.116 »       »       <A·HREF="http://www.vaxxine.com/ve3wwg/gnuwave.html">wavplay</A>
122 »       program..117 »       program.
123 »       That·contributed·code·would·eventually·mutate·into·this·library..118 »       That·contributed·code·would·eventually·mutate·into·this·library.
124 »       As·one·of·my·interests·is·Digital·Signal·Processing·(DSP)·I·decided·that·as·well·as.119 »       As·one·of·my·interests·is·Digital·Signal·Processing·(DSP)·I·decided·that·as·well·as
125 »       reading·data·from·an·audio·file·in·the·native·format·(typically·16·bit·short·integers).120 »       reading·data·from·an·audio·file·in·the·native·format·(typically·16·bit·short·integers)
126 »       it·would·also·be·useful·to·be·able·to·have·the·library·do·the·conversion·to·floating.121 »       it·would·also·be·useful·to·be·able·to·have·the·library·do·the·conversion·to·floating
127 »       point·numbers·for·DSP·applications..122 »       point·numbers·for·DSP·applications.
Max diff block lines reached; -1/26194 bytes (-0.00%) of diff not shown.
3.93 KB
libsndfile-1.0.30/doc/libsndfile.css
    
Offset 1, 99 lines modifiedOffset 1, 99 lines modified
1 body·{.1 body·{
2 »       background·:·black·;.2 »       background·:·black·;
3 »       color·:·white·;.3 »       color·:·white·;
4 »       font-family·:·arial,·helvetica,·sans-serif·;.4 »       font-family·:·arial,·helvetica,·sans-serif·;
5 »       line-height:·1.5·;.5 »       line-height:·1.5·;
6 }.6 }
7 td·{.7 td·{
8 »       font-family·:·arial,·helvetica,·sans-serif·;.8 »       font-family·:·arial,·helvetica,·sans-serif·;
9 »       background·:·black·;.9 »       background·:·black·;
10 »       color·:·white·;.10 »       color·:·white·;
11 }.11 }
12 center·{.12 center·{
13 »       font-family·:·arial,·helvetica,·sans-serif·;.13 »       font-family·:·arial,·helvetica,·sans-serif·;
14 }.14 }
15 p·{.15 p·{
16 »       font-family·:·arial,·helvetica,·sans-serif·;.16 »       font-family·:·arial,·helvetica,·sans-serif·;
17 »       text-align·:·left·;.17 »       text-align·:·left·;
18 »       margin-left·:·3%·;.18 »       margin-left·:·3%·;
19 »       margin-right·:·3%·;.19 »       margin-right·:·3%·;
20 }.20 }
21 .indent_block·{.21 .indent_block·{
22 »       font-family·:·arial,·helvetica,·sans-serif·;.22 »       font-family·:·arial,·helvetica,·sans-serif·;
23 »       text-align·:·left·;.23 »       text-align·:·left·;
24 »       margin-left·:·10%·;.24 »       margin-left·:·10%·;
25 »       margin-right·:·10%·;.25 »       margin-right·:·10%·;
26 }.26 }
27 br·{.27 br·{
28 »       font-family·:·arial,·helvetica,·sans-serif·;.28 »       font-family·:·arial,·helvetica,·sans-serif·;
29 }.29 }
30 form·{.30 form·{
31 »       font-family·:·arial,·helvetica,·sans-serif·;.31 »       font-family·:·arial,·helvetica,·sans-serif·;
32 }.32 }
33 ul·{.33 ul·{
34 »       font-family·:·arial,·helvetica,·sans-serif·;.34 »       font-family·:·arial,·helvetica,·sans-serif·;
35 »       text-align·:·left·;.35 »       text-align·:·left·;
36 »       margin-left·:·3%·;.36 »       margin-left·:·3%·;
37 »       margin-right·:·6%·;.37 »       margin-right·:·6%·;
38 }.38 }
39 ol·{.39 ol·{
40 »       font-family·:·arial,·helvetica,·sans-serif·;.40 »       font-family·:·arial,·helvetica,·sans-serif·;
41 »       text-align·:·left·;.41 »       text-align·:·left·;
42 »       margin-left·:·3%·;.42 »       margin-left·:·3%·;
43 »       margin-right·:·6%·;.43 »       margin-right·:·6%·;
44 }.44 }
45 dl·{.45 dl·{
46 »       font-family·:·arial,·helvetica,·sans-serif·;.46 »       font-family·:·arial,·helvetica,·sans-serif·;
47 »       text-align·:·left·;.47 »       text-align·:·left·;
48 »       margin-left·:·3%·;.48 »       margin-left·:·3%·;
49 »       margin-right·:·3%·;.49 »       margin-right·:·3%·;
50 }.50 }
51 h1·{.51 h1·{
52 »       font-size·:·xx-large·;.52 »       font-size·:·xx-large·;
53 »       background·:·black·;.53 »       background·:·black·;
54 »       color·:·#5050FF·;.54 »       color·:·#5050FF·;
55 »       text-align·:·left·;.55 »       text-align·:·left·;
56 »       margin-left·:·3%·;.56 »       margin-left·:·3%·;
57 »       margin-right·:·3%·;.57 »       margin-right·:·3%·;
58 }.58 }
59 h2·{.59 h2·{
60 »       font-size·:·x-large·;.60 »       font-size·:·x-large·;
61 »       background·:·black·;.61 »       background·:·black·;
62 »       color·:·#5050FF·;.62 »       color·:·#5050FF·;
63 »       text-align·:·left·;.63 »       text-align·:·left·;
64 »       margin-left·:·3%·;.64 »       margin-left·:·3%·;
65 »       margin-right·:·3%·;.65 »       margin-right·:·3%·;
66 }.66 }
67 h3·{.67 h3·{
68 »       font-size·:·large·;.68 »       font-size·:·large·;
69 »       background·:·black·;.69 »       background·:·black·;
70 »       color·:·#5050FF·;.70 »       color·:·#5050FF·;
71 »       text-align·:·left·;.71 »       text-align·:·left·;
72 »       margin-left·:·3%·;.72 »       margin-left·:·3%·;
73 »       margin-right·:·3%·;.73 »       margin-right·:·3%·;
74 }.74 }
75 h4·{.75 h4·{
76 »       font-size·:·medium·;.76 »       font-size·:·medium·;
77 »       background·:·black·;.77 »       background·:·black·;
78 »       color·:·#5050FF·;.78 »       color·:·#5050FF·;
79 »       text-align·:·left·;.79 »       text-align·:·left·;
80 »       margin-left·:·3%·;.80 »       margin-left·:·3%·;
81 »       margin-right·:·3%·;.81 »       margin-right·:·3%·;
82 }.82 }
83 pre·{.83 pre·{
84 »       font-family·:·courier,·monospace·;.84 »       font-family·:·courier,·monospace·;
85 »       font-size·:·medium·;.85 »       font-size·:·medium·;
86 »       margin-left·:·6%·;.86 »       margin-left·:·6%·;
87 »       margin-right·:·6%·;.87 »       margin-right·:·6%·;
88 }.88 }
89 code,.89 code,
90 kbd,.90 kbd,
91 samp,.91 samp,
92 var·{.92 var·{
93 »       font-family:·"Courier·New",·monospace,·serif;.93 »       font-family:·"Courier·New",·monospace,·serif;
94 »       font-size:·1em;.94 »       font-size:·1em;
95 }.95 }
96 a:link·{·color·:·#9090FF·;·}.96 a:link·{·color·:·#9090FF·;·}
97 a:visited·{·color·:·#5050FF·;·}.97 a:visited·{·color·:·#5050FF·;·}
98 a:active·{·color·:·#FF00FF·;·}.98 a:active·{·color·:·#FF00FF·;·}
99 a:hover·{·background-color·:·#202080·;·}.99 a:hover·{·background-color·:·#202080·;·}
4.09 KB
libsndfile-1.0.30/doc/libsndfile.css.in
    
Offset 1, 99 lines modifiedOffset 1, 99 lines modified
1 body·{.1 body·{
2 »       background·:·@HTML_BGCOLOUR@·;.2 »       background·:·@HTML_BGCOLOUR@·;
3 »       color·:·@HTML_FGCOLOUR@·;.3 »       color·:·@HTML_FGCOLOUR@·;
4 »       font-family·:·arial,·helvetica,·sans-serif·;.4 »       font-family·:·arial,·helvetica,·sans-serif·;
5 »       line-height:·1.5·;.5 »       line-height:·1.5·;
6 }.6 }
7 td·{.7 td·{
8 »       font-family·:·arial,·helvetica,·sans-serif·;.8 »       font-family·:·arial,·helvetica,·sans-serif·;
9 »       background·:·@HTML_BGCOLOUR@·;.9 »       background·:·@HTML_BGCOLOUR@·;
10 »       color·:·@HTML_FGCOLOUR@·;.10 »       color·:·@HTML_FGCOLOUR@·;
11 }.11 }
12 center·{.12 center·{
13 »       font-family·:·arial,·helvetica,·sans-serif·;.13 »       font-family·:·arial,·helvetica,·sans-serif·;
14 }.14 }
15 p·{.15 p·{
16 »       font-family·:·arial,·helvetica,·sans-serif·;.16 »       font-family·:·arial,·helvetica,·sans-serif·;
17 »       text-align·:·left·;.17 »       text-align·:·left·;
18 »       margin-left·:·3%·;.18 »       margin-left·:·3%·;
19 »       margin-right·:·3%·;.19 »       margin-right·:·3%·;
20 }.20 }
21 .indent_block·{.21 .indent_block·{
22 »       font-family·:·arial,·helvetica,·sans-serif·;.22 »       font-family·:·arial,·helvetica,·sans-serif·;
23 »       text-align·:·left·;.23 »       text-align·:·left·;
24 »       margin-left·:·10%·;.24 »       margin-left·:·10%·;
25 »       margin-right·:·10%·;.25 »       margin-right·:·10%·;
26 }.26 }
27 br·{.27 br·{
28 »       font-family·:·arial,·helvetica,·sans-serif·;.28 »       font-family·:·arial,·helvetica,·sans-serif·;
29 }.29 }
30 form·{.30 form·{
31 »       font-family·:·arial,·helvetica,·sans-serif·;.31 »       font-family·:·arial,·helvetica,·sans-serif·;
32 }.32 }
33 ul·{.33 ul·{
34 »       font-family·:·arial,·helvetica,·sans-serif·;.34 »       font-family·:·arial,·helvetica,·sans-serif·;
35 »       text-align·:·left·;.35 »       text-align·:·left·;
36 »       margin-left·:·3%·;.36 »       margin-left·:·3%·;
37 »       margin-right·:·6%·;.37 »       margin-right·:·6%·;
38 }.38 }
39 ol·{.39 ol·{
40 »       font-family·:·arial,·helvetica,·sans-serif·;.40 »       font-family·:·arial,·helvetica,·sans-serif·;
41 »       text-align·:·left·;.41 »       text-align·:·left·;
42 »       margin-left·:·3%·;.42 »       margin-left·:·3%·;
43 »       margin-right·:·6%·;.43 »       margin-right·:·6%·;
44 }.44 }
45 dl·{.45 dl·{
46 »       font-family·:·arial,·helvetica,·sans-serif·;.46 »       font-family·:·arial,·helvetica,·sans-serif·;
47 »       text-align·:·left·;.47 »       text-align·:·left·;
48 »       margin-left·:·3%·;.48 »       margin-left·:·3%·;
49 »       margin-right·:·3%·;.49 »       margin-right·:·3%·;
50 }.50 }
51 h1·{.51 h1·{
52 »       font-size·:·xx-large·;.52 »       font-size·:·xx-large·;
53 »       background·:·@HTML_BGCOLOUR@·;.53 »       background·:·@HTML_BGCOLOUR@·;
54 »       color·:·#5050FF·;.54 »       color·:·#5050FF·;
55 »       text-align·:·left·;.55 »       text-align·:·left·;
56 »       margin-left·:·3%·;.56 »       margin-left·:·3%·;
57 »       margin-right·:·3%·;.57 »       margin-right·:·3%·;
58 }.58 }
59 h2·{.59 h2·{
60 »       font-size·:·x-large·;.60 »       font-size·:·x-large·;
61 »       background·:·@HTML_BGCOLOUR@·;.61 »       background·:·@HTML_BGCOLOUR@·;
62 »       color·:·#5050FF·;.62 »       color·:·#5050FF·;
63 »       text-align·:·left·;.63 »       text-align·:·left·;
64 »       margin-left·:·3%·;.64 »       margin-left·:·3%·;
65 »       margin-right·:·3%·;.65 »       margin-right·:·3%·;
66 }.66 }
67 h3·{.67 h3·{
68 »       font-size·:·large·;.68 »       font-size·:·large·;
69 »       background·:·@HTML_BGCOLOUR@·;.69 »       background·:·@HTML_BGCOLOUR@·;
70 »       color·:·#5050FF·;.70 »       color·:·#5050FF·;
71 »       text-align·:·left·;.71 »       text-align·:·left·;
72 »       margin-left·:·3%·;.72 »       margin-left·:·3%·;
73 »       margin-right·:·3%·;.73 »       margin-right·:·3%·;
74 }.74 }
75 h4·{.75 h4·{
76 »       font-size·:·medium·;.76 »       font-size·:·medium·;
77 »       background·:·@HTML_BGCOLOUR@·;.77 »       background·:·@HTML_BGCOLOUR@·;
78 »       color·:·#5050FF·;.78 »       color·:·#5050FF·;
79 »       text-align·:·left·;.79 »       text-align·:·left·;
80 »       margin-left·:·3%·;.80 »       margin-left·:·3%·;
81 »       margin-right·:·3%·;.81 »       margin-right·:·3%·;
82 }.82 }
83 pre·{.83 pre·{
84 »       font-family·:·courier,·monospace·;.84 »       font-family·:·courier,·monospace·;
85 »       font-size·:·medium·;.85 »       font-size·:·medium·;
86 »       margin-left·:·6%·;.86 »       margin-left·:·6%·;
87 »       margin-right·:·6%·;.87 »       margin-right·:·6%·;
88 }.88 }
89 code,.89 code,
90 kbd,.90 kbd,
91 samp,.91 samp,
92 var·{.92 var·{
93 »       font-family:·"Courier·New",·monospace,·serif;.93 »       font-family:·"Courier·New",·monospace,·serif;
94 »       font-size:·1em;.94 »       font-size:·1em;
95 }.95 }
96 a:link·{·color·:·#9090FF·;·}.96 a:link·{·color·:·#9090FF·;·}
97 a:visited·{·color·:·#5050FF·;·}.97 a:visited·{·color·:·#5050FF·;·}
98 a:active·{·color·:·#FF00FF·;·}.98 a:active·{·color·:·#FF00FF·;·}
99 a:hover·{·background-color·:·#202080·;·}.99 a:hover·{·background-color·:·#202080·;·}
59.8 KB
libsndfile-1.0.30/include/sndfile.h.in
    
Offset 1, 872 lines modifiedOffset 1, 872 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 /*.18 /*
20 **·sndfile.h·--·system-wide·definitions.19 **·sndfile.h·--·system-wide·definitions
21 **.20 **
22 **·API·documentation·is·in·the·doc/·directory·of·the·source·code·tarball.21 **·API·documentation·is·in·the·doc/·directory·of·the·source·code·tarball
23 **·and·at·http://www.mega-nerd.com/libsndfile/api.html..22 **·and·at·http://www.mega-nerd.com/libsndfile/api.html.
24 */.23 */
25 \xd 
26 #ifndef·SNDFILE_H.24 #ifndef·SNDFILE_H
27 #define·SNDFILE_H.25 #define·SNDFILE_H
28 \xd 
29 /*·This·is·the·version·1.0.X·header·file.·*/.26 /*·This·is·the·version·1.0.X·header·file.·*/
30 #define»SNDFILE_1.27 #define»SNDFILE_1
31 \xd 
32 #include·<stdio.h>.28 #include·<stdio.h>
33 #include·<stdint.h>.29 #include·<stdint.h>
34 #include·<sys/types.h>.30 #include·<sys/types.h>
35 \xd 
36 #ifdef·__cplusplus.31 #ifdef·__cplusplus
37 extern·"C"·{.32 extern·"C"·{
38 #endif» /*·__cplusplus·*/.33 #endif» /*·__cplusplus·*/
39 \xd 
40 /*·The·following·file·types·can·be·read·and·written..34 /*·The·following·file·types·can·be·read·and·written.
41 **·A·file·type·would·consist·of·a·major·type·(ie·SF_FORMAT_WAV)·bitwise.35 **·A·file·type·would·consist·of·a·major·type·(ie·SF_FORMAT_WAV)·bitwise
42 **·ORed·with·a·minor·type·(ie·SF_FORMAT_PCM).·SF_FORMAT_TYPEMASK·and.36 **·ORed·with·a·minor·type·(ie·SF_FORMAT_PCM).·SF_FORMAT_TYPEMASK·and
43 **·SF_FORMAT_SUBMASK·can·be·used·to·separate·the·major·and·minor·file.37 **·SF_FORMAT_SUBMASK·can·be·used·to·separate·the·major·and·minor·file
44 **·types..38 **·types.
45 */.39 */
46 \xd 
47 enum.40 enum
48 {»      /*·Major·formats.·*/.41 {»      /*·Major·formats.·*/
49 »       SF_FORMAT_WAV»  »  »  =·0x010000,»»/*·Microsoft·WAV·format·(little·endian·default).·*/.42 »       SF_FORMAT_WAV»  »  »  =·0x010000,»»/*·Microsoft·WAV·format·(little·endian·default).·*/
50 »       SF_FORMAT_AIFF» » » =·0x020000,»       »       /*·Apple/SGI·AIFF·format·(big·endian).·*/.43 »       SF_FORMAT_AIFF» » » =·0x020000,»       »       /*·Apple/SGI·AIFF·format·(big·endian).·*/
51 »       SF_FORMAT_AU»   »   »   =·0x030000,» » /*·Sun/NeXT·AU·format·(big·endian).·*/.44 »       SF_FORMAT_AU»   »   »   =·0x030000,» » /*·Sun/NeXT·AU·format·(big·endian).·*/
52 »       SF_FORMAT_RAW»  »  »  =·0x040000,»»/*·RAW·PCM·data.·*/.45 »       SF_FORMAT_RAW»  »  »  =·0x040000,»»/*·RAW·PCM·data.·*/
53 »       SF_FORMAT_PAF»  »  »  =·0x050000,»»/*·Ensoniq·PARIS·file·format.·*/.46 »       SF_FORMAT_PAF»  »  »  =·0x050000,»»/*·Ensoniq·PARIS·file·format.·*/
54 »       SF_FORMAT_SVX»  »  »  =·0x060000,»»/*·Amiga·IFF·/·SVX8·/·SV16·format.·*/.47 »       SF_FORMAT_SVX»  »  »  =·0x060000,»»/*·Amiga·IFF·/·SVX8·/·SV16·format.·*/
55 »       SF_FORMAT_NIST» » » =·0x070000,»       »       /*·Sphere·NIST·format.·*/.48 »       SF_FORMAT_NIST» » » =·0x070000,»       »       /*·Sphere·NIST·format.·*/
56 »       SF_FORMAT_VOC»  »  »  =·0x080000,»»/*·VOC·files.·*/.49 »       SF_FORMAT_VOC»  »  »  =·0x080000,»»/*·VOC·files.·*/
57 »       SF_FORMAT_IRCAM»»»=·0x0A0000,»      »      /*·Berkeley/IRCAM/CARL·*/.50 »       SF_FORMAT_IRCAM»»»=·0x0A0000,»      »      /*·Berkeley/IRCAM/CARL·*/
58 »       SF_FORMAT_W64»  »  »  =·0x0B0000,»»/*·Sonic·Foundry's·64·bit·RIFF/WAV·*/.51 »       SF_FORMAT_W64»  »  »  =·0x0B0000,»»/*·Sonic·Foundry's·64·bit·RIFF/WAV·*/
59 »       SF_FORMAT_MAT4» » » =·0x0C0000,»       »       /*·Matlab·(tm)·V4.2·/·GNU·Octave·2.0·*/.52 »       SF_FORMAT_MAT4» » » =·0x0C0000,»       »       /*·Matlab·(tm)·V4.2·/·GNU·Octave·2.0·*/
60 »       SF_FORMAT_MAT5» » » =·0x0D0000,»       »       /*·Matlab·(tm)·V5.0·/·GNU·Octave·2.1·*/.53 »       SF_FORMAT_MAT5» » » =·0x0D0000,»       »       /*·Matlab·(tm)·V5.0·/·GNU·Octave·2.1·*/
61 »       SF_FORMAT_PVF»  »  »  =·0x0E0000,»»/*·Portable·Voice·Format·*/.54 »       SF_FORMAT_PVF»  »  »  =·0x0E0000,»»/*·Portable·Voice·Format·*/
62 »       SF_FORMAT_XI»   »   »   =·0x0F0000,» » /*·Fasttracker·2·Extended·Instrument·*/.55 »       SF_FORMAT_XI»   »   »   =·0x0F0000,» » /*·Fasttracker·2·Extended·Instrument·*/
63 »       SF_FORMAT_HTK»  »  »  =·0x100000,»»/*·HMM·Tool·Kit·format·*/.56 »       SF_FORMAT_HTK»  »  »  =·0x100000,»»/*·HMM·Tool·Kit·format·*/
64 »       SF_FORMAT_SDS»  »  »  =·0x110000,»»/*·Midi·Sample·Dump·Standard·*/.57 »       SF_FORMAT_SDS»  »  »  =·0x110000,»»/*·Midi·Sample·Dump·Standard·*/
65 »       SF_FORMAT_AVR»  »  »  =·0x120000,»»/*·Audio·Visual·Research·*/.58 »       SF_FORMAT_AVR»  »  »  =·0x120000,»»/*·Audio·Visual·Research·*/
66 »       SF_FORMAT_WAVEX»»»=·0x130000,»      »      /*·MS·WAVE·with·WAVEFORMATEX·*/.59 »       SF_FORMAT_WAVEX»»»=·0x130000,»      »      /*·MS·WAVE·with·WAVEFORMATEX·*/
67 »       SF_FORMAT_SD2»  »  »  =·0x160000,»»/*·Sound·Designer·2·*/.60 »       SF_FORMAT_SD2»  »  »  =·0x160000,»»/*·Sound·Designer·2·*/
68 »       SF_FORMAT_FLAC» » » =·0x170000,»       »       /*·FLAC·lossless·file·format·*/.61 »       SF_FORMAT_FLAC» » » =·0x170000,»       »       /*·FLAC·lossless·file·format·*/
69 »       SF_FORMAT_CAF»  »  »  =·0x180000,»»/*·Core·Audio·File·format·*/.62 »       SF_FORMAT_CAF»  »  »  =·0x180000,»»/*·Core·Audio·File·format·*/
70 »       SF_FORMAT_WVE»  »  »  =·0x190000,»»/*·Psion·WVE·format·*/.63 »       SF_FORMAT_WVE»  »  »  =·0x190000,»»/*·Psion·WVE·format·*/
71 »       SF_FORMAT_OGG»  »  »  =·0x200000,»»/*·Xiph·OGG·container·*/.64 »       SF_FORMAT_OGG»  »  »  =·0x200000,»»/*·Xiph·OGG·container·*/
72 »       SF_FORMAT_MPC2K»»»=·0x210000,»      »      /*·Akai·MPC·2000·sampler·*/.65 »       SF_FORMAT_MPC2K»»»=·0x210000,»      »      /*·Akai·MPC·2000·sampler·*/
73 »       SF_FORMAT_RF64» » » =·0x220000,»       »       /*·RF64·WAV·file·*/.66 »       SF_FORMAT_RF64» » » =·0x220000,»       »       /*·RF64·WAV·file·*/
74 \xd 
75 »       /*·Subtypes·from·here·on.·*/.67 »       /*·Subtypes·from·here·on.·*/
76 \xd 
77 »       SF_FORMAT_PCM_S8»       »       =·0x0001,»       »       /*·Signed·8·bit·data·*/.68 »       SF_FORMAT_PCM_S8»       »       =·0x0001,»       »       /*·Signed·8·bit·data·*/
78 »       SF_FORMAT_PCM_16»       »       =·0x0002,»       »       /*·Signed·16·bit·data·*/.69 »       SF_FORMAT_PCM_16»       »       =·0x0002,»       »       /*·Signed·16·bit·data·*/
79 »       SF_FORMAT_PCM_24»       »       =·0x0003,»       »       /*·Signed·24·bit·data·*/.70 »       SF_FORMAT_PCM_24»       »       =·0x0003,»       »       /*·Signed·24·bit·data·*/
80 »       SF_FORMAT_PCM_32»       »       =·0x0004,»       »       /*·Signed·32·bit·data·*/.71 »       SF_FORMAT_PCM_32»       »       =·0x0004,»       »       /*·Signed·32·bit·data·*/
81 \xd 
82 »       SF_FORMAT_PCM_U8»       »       =·0x0005,»       »       /*·Unsigned·8·bit·data·(WAV·and·RAW·only)·*/.72 »       SF_FORMAT_PCM_U8»       »       =·0x0005,»       »       /*·Unsigned·8·bit·data·(WAV·and·RAW·only)·*/
83 \xd 
84 »       SF_FORMAT_FLOAT»»»=·0x0006,»»/*·32·bit·float·data·*/.73 »       SF_FORMAT_FLOAT»»»=·0x0006,»»/*·32·bit·float·data·*/
85 »       SF_FORMAT_DOUBLE»       »       =·0x0007,»       »       /*·64·bit·float·data·*/.74 »       SF_FORMAT_DOUBLE»       »       =·0x0007,»       »       /*·64·bit·float·data·*/
86 \xd 
87 »       SF_FORMAT_ULAW» » » =·0x0010,» » /*·U-Law·encoded.·*/.75 »       SF_FORMAT_ULAW» » » =·0x0010,» » /*·U-Law·encoded.·*/
88 »       SF_FORMAT_ALAW» » » =·0x0011,» » /*·A-Law·encoded.·*/.76 »       SF_FORMAT_ALAW» » » =·0x0011,» » /*·A-Law·encoded.·*/
89 »       SF_FORMAT_IMA_ADPCM»    »    =·0x0012,»    »    /*·IMA·ADPCM.·*/.77 »       SF_FORMAT_IMA_ADPCM»    »    =·0x0012,»    »    /*·IMA·ADPCM.·*/
90 »       SF_FORMAT_MS_ADPCM»     »     =·0x0013,»     »     /*·Microsoft·ADPCM.·*/.78 »       SF_FORMAT_MS_ADPCM»     »     =·0x0013,»     »     /*·Microsoft·ADPCM.·*/
91 \xd 
92 »       SF_FORMAT_GSM610»       »       =·0x0020,»       »       /*·GSM·6.10·encoding.·*/.79 »       SF_FORMAT_GSM610»       »       =·0x0020,»       »       /*·GSM·6.10·encoding.·*/
93 »       SF_FORMAT_VOX_ADPCM»    »    =·0x0021,»    »    /*·OKI·/·Dialogix·ADPCM·*/.80 »       SF_FORMAT_VOX_ADPCM»    »    =·0x0021,»    »    /*·OKI·/·Dialogix·ADPCM·*/
94 \xd 
95 »       SF_FORMAT_NMS_ADPCM_16» =·0x0022,» » /*·16kbs·NMS·G721-variant·encoding.·*/.81 »       SF_FORMAT_NMS_ADPCM_16» =·0x0022,» » /*·16kbs·NMS·G721-variant·encoding.·*/
96 »       SF_FORMAT_NMS_ADPCM_24» =·0x0023,» » /*·24kbs·NMS·G721-variant·encoding.·*/.82 »       SF_FORMAT_NMS_ADPCM_24» =·0x0023,» » /*·24kbs·NMS·G721-variant·encoding.·*/
97 »       SF_FORMAT_NMS_ADPCM_32» =·0x0024,» » /*·32kbs·NMS·G721-variant·encoding.·*/.83 »       SF_FORMAT_NMS_ADPCM_32» =·0x0024,» » /*·32kbs·NMS·G721-variant·encoding.·*/
98 \xd 
99 »       SF_FORMAT_G721_32»      »      =·0x0030,»      »      /*·32kbs·G721·ADPCM·encoding.·*/.84 »       SF_FORMAT_G721_32»      »      =·0x0030,»      »      /*·32kbs·G721·ADPCM·encoding.·*/
100 »       SF_FORMAT_G723_24»      »      =·0x0031,»      »      /*·24kbs·G723·ADPCM·encoding.·*/.85 »       SF_FORMAT_G723_24»      »      =·0x0031,»      »      /*·24kbs·G723·ADPCM·encoding.·*/
101 »       SF_FORMAT_G723_40»      »      =·0x0032,»      »      /*·40kbs·G723·ADPCM·encoding.·*/.86 »       SF_FORMAT_G723_40»      »      =·0x0032,»      »      /*·40kbs·G723·ADPCM·encoding.·*/
102 \xd 
103 »       SF_FORMAT_DWVW_12»      »      =·0x0040,·»      »      /*·12·bit·Delta·Width·Variable·Word·encoding.·*/.87 »       SF_FORMAT_DWVW_12»      »      =·0x0040,·»      »      /*·12·bit·Delta·Width·Variable·Word·encoding.·*/
104 »       SF_FORMAT_DWVW_16»      »      =·0x0041,·»      »      /*·16·bit·Delta·Width·Variable·Word·encoding.·*/.88 »       SF_FORMAT_DWVW_16»      »      =·0x0041,·»      »      /*·16·bit·Delta·Width·Variable·Word·encoding.·*/
105 »       SF_FORMAT_DWVW_24»      »      =·0x0042,·»      »      /*·24·bit·Delta·Width·Variable·Word·encoding.·*/.89 »       SF_FORMAT_DWVW_24»      »      =·0x0042,·»      »      /*·24·bit·Delta·Width·Variable·Word·encoding.·*/
106 »       SF_FORMAT_DWVW_N»       »       =·0x0043,·»       »       /*·N·bit·Delta·Width·Variable·Word·encoding.·*/.90 »       SF_FORMAT_DWVW_N»       »       =·0x0043,·»       »       /*·N·bit·Delta·Width·Variable·Word·encoding.·*/
107 \xd 
108 »       SF_FORMAT_DPCM_8»       »       =·0x0050,»       »       /*·8·bit·differential·PCM·(XI·only)·*/.91 »       SF_FORMAT_DPCM_8»       »       =·0x0050,»       »       /*·8·bit·differential·PCM·(XI·only)·*/
109 »       SF_FORMAT_DPCM_16»      »      =·0x0051,»      »      /*·16·bit·differential·PCM·(XI·only)·*/.92 »       SF_FORMAT_DPCM_16»      »      =·0x0051,»      »      /*·16·bit·differential·PCM·(XI·only)·*/
110 \xd 
111 »       SF_FORMAT_VORBIS»       »       =·0x0060,»       »       /*·Xiph·Vorbis·encoding.·*/.93 »       SF_FORMAT_VORBIS»       »       =·0x0060,»       »       /*·Xiph·Vorbis·encoding.·*/
112 »       SF_FORMAT_OPUS» » » =·0x0064,» » /*·Xiph/Skype·Opus·encoding.·*/.94 »       SF_FORMAT_OPUS» » » =·0x0064,» » /*·Xiph/Skype·Opus·encoding.·*/
113 \xd 
114 »       SF_FORMAT_ALAC_16»      »      =·0x0070,»      »      /*·Apple·Lossless·Audio·Codec·(16·bit).·*/.95 »       SF_FORMAT_ALAC_16»      »      =·0x0070,»      »      /*·Apple·Lossless·Audio·Codec·(16·bit).·*/
115 »       SF_FORMAT_ALAC_20»      »      =·0x0071,»      »      /*·Apple·Lossless·Audio·Codec·(20·bit).·*/.96 »       SF_FORMAT_ALAC_20»      »      =·0x0071,»      »      /*·Apple·Lossless·Audio·Codec·(20·bit).·*/
116 »       SF_FORMAT_ALAC_24»      »      =·0x0072,»      »      /*·Apple·Lossless·Audio·Codec·(24·bit).·*/.97 »       SF_FORMAT_ALAC_24»      »      =·0x0072,»      »      /*·Apple·Lossless·Audio·Codec·(24·bit).·*/
117 »       SF_FORMAT_ALAC_32»      »      =·0x0073,»      »      /*·Apple·Lossless·Audio·Codec·(32·bit).·*/.98 »       SF_FORMAT_ALAC_32»      »      =·0x0073,»      »      /*·Apple·Lossless·Audio·Codec·(32·bit).·*/
118 \xd 
119 »       /*·Endian-ness·options.·*/.99 »       /*·Endian-ness·options.·*/
120 \xd 
121 »       SF_ENDIAN_FILE» » » =·0x00000000,»     /*·Default·file·endian-ness.·*/.100 »       SF_ENDIAN_FILE» » » =·0x00000000,»     /*·Default·file·endian-ness.·*/
122 »       SF_ENDIAN_LITTLE»       »       =·0x10000000,»   /*·Force·little·endian-ness.·*/.101 »       SF_ENDIAN_LITTLE»       »       =·0x10000000,»   /*·Force·little·endian-ness.·*/
123 »       SF_ENDIAN_BIG»  »  »  =·0x20000000,»      /*·Force·big·endian-ness.·*/.102 »       SF_ENDIAN_BIG»  »  »  =·0x20000000,»      /*·Force·big·endian-ness.·*/
124 »       SF_ENDIAN_CPU»  »  »  =·0x30000000,»      /*·Force·CPU·endian-ness.·*/.103 »       SF_ENDIAN_CPU»  »  »  =·0x30000000,»      /*·Force·CPU·endian-ness.·*/
125 \xd 
126 »       SF_FORMAT_SUBMASK»      »      =·0x0000FFFF,.104 »       SF_FORMAT_SUBMASK»      »      =·0x0000FFFF,
127 »       SF_FORMAT_TYPEMASK»     »     =·0x0FFF0000,.105 »       SF_FORMAT_TYPEMASK»     »     =·0x0FFF0000,
Max diff block lines reached; -1/61134 bytes (-0.00%) of diff not shown.
26.4 KB
libsndfile-1.0.30/include/sndfile.hh
    
Offset 1, 452 lines modifiedOffset 1, 452 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2005-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2005-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·All·rights·reserved..4 **·All·rights·reserved.
5 **.5 **
6 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without.6 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without
7 **·modification,·are·permitted·provided·that·the·following·conditions·are.7 **·modification,·are·permitted·provided·that·the·following·conditions·are
8 **·met:.8 **·met:
9 **.9 **
10 **·····*·Redistributions·of·source·code·must·retain·the·above·copyright.10 **·····*·Redistributions·of·source·code·must·retain·the·above·copyright
11 **·······notice,·this·list·of·conditions·and·the·following·disclaimer..11 **·······notice,·this·list·of·conditions·and·the·following·disclaimer.
12 **·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright.12 **·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright
13 **·······notice,·this·list·of·conditions·and·the·following·disclaimer·in.13 **·······notice,·this·list·of·conditions·and·the·following·disclaimer·in
14 **·······the·documentation·and/or·other·materials·provided·with·the.14 **·······the·documentation·and/or·other·materials·provided·with·the
15 **·······distribution..15 **·······distribution.
16 **·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used.16 **·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used
17 **·······to·endorse·or·promote·products·derived·from·this·software·without.17 **·······to·endorse·or·promote·products·derived·from·this·software·without
18 **·······specific·prior·written·permission..18 **·······specific·prior·written·permission.
19 **.19 **
20 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS.20 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS
21 **·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED.21 **·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED
22 **·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR.22 **·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR
23 **·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR.23 **·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR
24 **·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,.24 **·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,
25 **·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,.25 **·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,
26 **·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;.26 **·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;
27 **·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,.27 **·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,
28 **·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR.28 **·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR
29 **·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF.29 **·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF
30 **·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE..30 **·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE.
31 */.31 */
32 \xd 
33 /*.32 /*
34 **·The·above·modified·BSD·style·license·(GPL·and·LGPL·compatible)·applies·to.33 **·The·above·modified·BSD·style·license·(GPL·and·LGPL·compatible)·applies·to
35 **·this·file.·It·does·not·apply·to·libsndfile·itself·which·is·released·under.34 **·this·file.·It·does·not·apply·to·libsndfile·itself·which·is·released·under
36 **·the·GNU·LGPL·or·the·libsndfile·test·suite·which·is·released·under·the·GNU.35 **·the·GNU·LGPL·or·the·libsndfile·test·suite·which·is·released·under·the·GNU
37 **·GPL..36 **·GPL.
38 **·This·means·that·this·header·file·can·be·used·under·this·modified·BSD·style.37 **·This·means·that·this·header·file·can·be·used·under·this·modified·BSD·style
39 **·license,·but·the·LGPL·still·holds·for·the·libsndfile·library·itself..38 **·license,·but·the·LGPL·still·holds·for·the·libsndfile·library·itself.
40 */.39 */
41 \xd 
42 /*.40 /*
43 **·sndfile.hh·--·A·lightweight·C++·wrapper·for·the·libsndfile·API..41 **·sndfile.hh·--·A·lightweight·C++·wrapper·for·the·libsndfile·API.
44 **.42 **
45 **·All·the·methods·are·inlines·and·all·functionality·is·contained·in·this.43 **·All·the·methods·are·inlines·and·all·functionality·is·contained·in·this
46 **·file.·There·is·no·separate·implementation·file..44 **·file.·There·is·no·separate·implementation·file.
47 **.45 **
48 **·API·documentation·is·in·the·doc/·directory·of·the·source·code·tarball.46 **·API·documentation·is·in·the·doc/·directory·of·the·source·code·tarball
49 **·and·at·http://www.mega-nerd.com/libsndfile/api.html..47 **·and·at·http://www.mega-nerd.com/libsndfile/api.html.
50 */.48 */
51 \xd 
52 #ifndef·SNDFILE_HH.49 #ifndef·SNDFILE_HH
53 #define·SNDFILE_HH.50 #define·SNDFILE_HH
54 \xd 
55 #include·<sndfile.h>.51 #include·<sndfile.h>
56 \xd 
57 #include·<string>.52 #include·<string>
58 #include·<new>·//·for·std::nothrow.53 #include·<new>·//·for·std::nothrow
59 \xd 
60 #if·__cplusplus·<·201100.54 #if·__cplusplus·<·201100
61 #ifndef·nullptr.55 #ifndef·nullptr
62 #define·nullptr·NULL.56 #define·nullptr·NULL
63 #endif.57 #endif
64 #endif.58 #endif
65 \xd 
66 class·SndfileHandle.59 class·SndfileHandle
67 {»      private·:.60 {»      private·:
68 »       »       struct·SNDFILE_ref.61 »       »       struct·SNDFILE_ref
69 »       »       {»      SNDFILE_ref·(void)·;.62 »       »       {»      SNDFILE_ref·(void)·;
70 »       »       »       ~SNDFILE_ref·(void)·;.63 »       »       »       ~SNDFILE_ref·(void)·;
71 \xd 
72 »       »       »       SNDFILE·*sf·;.64 »       »       »       SNDFILE·*sf·;
73 »       »       »       SF_INFO·sfinfo·;.65 »       »       »       SF_INFO·sfinfo·;
74 »       »       »       int·ref·;.66 »       »       »       int·ref·;
75 »       »       »       }·;.67 »       »       »       }·;
76 \xd 
77 »       »       SNDFILE_ref·*p·;.68 »       »       SNDFILE_ref·*p·;
78 \xd 
79 »       public·:.69 »       public·:
80 »       »       »       /*·Default·constructor·*/.70 »       »       »       /*·Default·constructor·*/
81 »       »       »       SndfileHandle·(void)·:·p·(nullptr)·{}·;.71 »       »       »       SndfileHandle·(void)·:·p·(nullptr)·{}·;
82 »       »       »       SndfileHandle·(const·char·*path,·int·mode·=·SFM_READ,.72 »       »       »       SndfileHandle·(const·char·*path,·int·mode·=·SFM_READ,
83 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;.73 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;
84 »       »       »       SndfileHandle·(std::string·const·&·path,·int·mode·=·SFM_READ,.74 »       »       »       SndfileHandle·(std::string·const·&·path,·int·mode·=·SFM_READ,
85 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;.75 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;
86 »       »       »       SndfileHandle·(int·fd,·bool·close_desc,·int·mode·=·SFM_READ,.76 »       »       »       SndfileHandle·(int·fd,·bool·close_desc,·int·mode·=·SFM_READ,
87 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;.77 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;
88 »       »       »       SndfileHandle·(SF_VIRTUAL_IO·&sfvirtual,·void·*user_data,·int·mode·=·SFM_READ,.78 »       »       »       SndfileHandle·(SF_VIRTUAL_IO·&sfvirtual,·void·*user_data,·int·mode·=·SFM_READ,
89 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;.79 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;
90 \xd 
91 #ifdef·ENABLE_SNDFILE_WINDOWS_PROTOTYPES.80 #ifdef·ENABLE_SNDFILE_WINDOWS_PROTOTYPES
92 »       »       »       SndfileHandle·(LPCWSTR·wpath,·int·mode·=·SFM_READ,.81 »       »       »       SndfileHandle·(LPCWSTR·wpath,·int·mode·=·SFM_READ,
93 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;.82 »       »       »       »       »       »       »       int·format·=·0,·int·channels·=·0,·int·samplerate·=·0)·;
94 #endif.83 #endif
95 \xd 
96 »       »       »       ~SndfileHandle·(void)·;.84 »       »       »       ~SndfileHandle·(void)·;
97 \xd 
98 »       »       »       SndfileHandle·(const·SndfileHandle·&orig)·;.85 »       »       »       SndfileHandle·(const·SndfileHandle·&orig)·;
99 »       »       »       SndfileHandle·&·operator·=·(const·SndfileHandle·&rhs)·;.86 »       »       »       SndfileHandle·&·operator·=·(const·SndfileHandle·&rhs)·;
100 \xd 
101 »       »       /*·Mainly·for·debugging/testing.·*/.87 »       »       /*·Mainly·for·debugging/testing.·*/
102 »       »       int·refCount·(void)·const·{·return·(p·==·nullptr)·?·0·:·p->ref·;·}.88 »       »       int·refCount·(void)·const·{·return·(p·==·nullptr)·?·0·:·p->ref·;·}
103 \xd 
104 »       »       operator·bool·()·const·{·return·(p·!=·nullptr)·;·}.89 »       »       operator·bool·()·const·{·return·(p·!=·nullptr)·;·}
105 \xd 
106 »       »       bool·operator·==·(const·SndfileHandle·&rhs)·const·{·return·(p·==·rhs.p)·;·}.90 »       »       bool·operator·==·(const·SndfileHandle·&rhs)·const·{·return·(p·==·rhs.p)·;·}
107 \xd 
108 »       »       sf_count_t»     frames·(void)·const»    »    {·return·p·?·p->sfinfo.frames·:·0·;·}.91 »       »       sf_count_t»     frames·(void)·const»    »    {·return·p·?·p->sfinfo.frames·:·0·;·}
109 »       »       int»    »    »    format·(void)·const»   »   {·return·p·?·p->sfinfo.format·:·0·;·}.92 »       »       int»    »    »    format·(void)·const»   »   {·return·p·?·p->sfinfo.format·:·0·;·}
110 »       »       int»    »    »    channels·(void)·const» {·return·p·?·p->sfinfo.channels·:·0·;·}.93 »       »       int»    »    »    channels·(void)·const» {·return·p·?·p->sfinfo.channels·:·0·;·}
111 »       »       int»    »    »    samplerate·(void)·const·{·return·p·?·p->sfinfo.samplerate·:·0·;·}.94 »       »       int»    »    »    samplerate·(void)·const·{·return·p·?·p->sfinfo.samplerate·:·0·;·}
112 \xd 
113 »       »       int·error·(void)·const·;.95 »       »       int·error·(void)·const·;
114 »       »       const·char·*·strError·(void)·const·;.96 »       »       const·char·*·strError·(void)·const·;
115 \xd 
116 »       »       int·command·(int·cmd,·void·*data,·int·datasize)·;.97 »       »       int·command·(int·cmd,·void·*data,·int·datasize)·;
117 \xd 
118 »       »       sf_count_t»     seek·(sf_count_t·frames,·int·whence)·;.98 »       »       sf_count_t»     seek·(sf_count_t·frames,·int·whence)·;
119 \xd 
120 »       »       void·writeSync·(void)·;.99 »       »       void·writeSync·(void)·;
121 \xd 
122 »       »       int·setString·(int·str_type,·const·char*·str)·;.100 »       »       int·setString·(int·str_type,·const·char*·str)·;
123 \xd 
124 »       »       const·char*·getString·(int·str_type)·const·;.101 »       »       const·char*·getString·(int·str_type)·const·;
125 \xd 
126 »       »       static·int·formatCheck·(int·format,·int·channels,·int·samplerate)·;.102 »       »       static·int·formatCheck·(int·format,·int·channels,·int·samplerate)·;
127 \xd 
Max diff block lines reached; -1/26912 bytes (-0.00%) of diff not shown.
15.9 KB
libsndfile-1.0.30/m4/libtool.m4
    
Offset 724, 14 lines modifiedOffset 724, 15 lines modified
724 ····cfgfile=${ofile}T724 ····cfgfile=${ofile}T
725 ····trap·"$RM·\"$cfgfile\";·exit·1"·1·2·15725 ····trap·"$RM·\"$cfgfile\";·exit·1"·1·2·15
726 ····$RM·"$cfgfile"726 ····$RM·"$cfgfile"
  
727 ····cat·<<_LT_EOF·>>·"$cfgfile"727 ····cat·<<_LT_EOF·>>·"$cfgfile"
728 #!·$SHELL728 #!·$SHELL
729 #·Generated·automatically·by·$as_me·($PACKAGE)·$VERSION729 #·Generated·automatically·by·$as_me·($PACKAGE)·$VERSION
 730 #·Libtool·was·configured·on·host·`(hostname·||·uname·-n)·2>/dev/null·|·sed·1q`:
730 #·NOTE:·Changes·made·to·this·file·will·be·lost:·look·at·ltmain.sh.731 #·NOTE:·Changes·made·to·this·file·will·be·lost:·look·at·ltmain.sh.
  
731 #·Provide·generalized·library-building·support·services.732 #·Provide·generalized·library-building·support·services.
732 #·Written·by·Gordon·Matzigkeit,·1996733 #·Written·by·Gordon·Matzigkeit,·1996
  
733 _LT_COPYING734 _LT_COPYING
734 _LT_LIBTOOL_TAGS735 _LT_LIBTOOL_TAGS
Offset 1412, 18 lines modifiedOffset 1413, 18 lines modified
1412 »       case·$host·in1413 »       case·$host·in
1413 »       ··x86_64-*kfreebsd*-gnu)1414 »       ··x86_64-*kfreebsd*-gnu)
1414 »       ····LD="${LD-ld}·-m·elf_x86_64_fbsd"1415 »       ····LD="${LD-ld}·-m·elf_x86_64_fbsd"
1415 »       ····;;1416 »       ····;;
1416 »       ··x86_64-*linux*)1417 »       ··x86_64-*linux*)
1417 »       ····LD="${LD-ld}·-m·elf_x86_64"1418 »       ····LD="${LD-ld}·-m·elf_x86_64"
1418 »       ····;;1419 »       ····;;
1419 »       ··powerpcle-*linux*)1420 »       ··powerpcle-*linux*|powerpc64le-*linux*)
1420 »       ····LD="${LD-ld}·-m·elf64lppc"1421 »       ····LD="${LD-ld}·-m·elf64lppc"
1421 »       ····;;1422 »       ····;;
1422 »       ··powerpc-*linux*)1423 »       ··powerpc-*linux*|powerpc64-*linux*)
1423 »       ····LD="${LD-ld}·-m·elf64ppc"1424 »       ····LD="${LD-ld}·-m·elf64ppc"
1424 »       ····;;1425 »       ····;;
1425 »       ··s390*-*linux*|s390*-*tpf*)1426 »       ··s390*-*linux*|s390*-*tpf*)
1426 »       ····LD="${LD-ld}·-m·elf64_s390"1427 »       ····LD="${LD-ld}·-m·elf64_s390"
1427 »       ····;;1428 »       ····;;
1428 »       ··sparc*-*linux*)1429 »       ··sparc*-*linux*)
1429 »       ····LD="${LD-ld}·-m·elf64_sparc"1430 »       ····LD="${LD-ld}·-m·elf64_sparc"
Offset 1703, 14 lines modifiedOffset 1704, 19 lines modified
1703 ····;;1704 ····;;
  
1704 ··mint*)1705 ··mint*)
1705 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.1706 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.
1706 ····lt_cv_sys_max_cmd_len=8192;1707 ····lt_cv_sys_max_cmd_len=8192;
1707 ····;;1708 ····;;
  
 1709 ··mint*)
 1710 ····#·On·MiNT·this·can·take·a·long·time·and·run·out·of·memory.
 1711 ····lt_cv_sys_max_cmd_len=8192;
 1712 ····;;
  
1708 ··amigaos*)1713 ··amigaos*)
1709 ····#·On·AmigaOS·with·pdksh,·this·test·takes·hours,·literally.1714 ····#·On·AmigaOS·with·pdksh,·this·test·takes·hours,·literally.
1710 ····#·So·we·just·punt·and·use·a·minimum·line·length·of·8192.1715 ····#·So·we·just·punt·and·use·a·minimum·line·length·of·8192.
1711 ····lt_cv_sys_max_cmd_len=8192;1716 ····lt_cv_sys_max_cmd_len=8192;
1712 ····;;1717 ····;;
  
1713 ··bitrig*·|·darwin*·|·dragonfly*·|·freebsd*·|·netbsd*·|·openbsd*)1718 ··bitrig*·|·darwin*·|·dragonfly*·|·freebsd*·|·netbsd*·|·openbsd*)
Offset 2631, 19 lines modifiedOffset 2637, 19 lines modified
2631 ··;;2637 ··;;
  
2632 darwin*·|·rhapsody*)2638 darwin*·|·rhapsody*)
2633 ··dynamic_linker="$host_os·dyld"2639 ··dynamic_linker="$host_os·dyld"
2634 ··version_type=darwin2640 ··version_type=darwin
2635 ··need_lib_prefix=no2641 ··need_lib_prefix=no
2636 ··need_version=no2642 ··need_version=no
2637 ··library_names_spec='$libname$release$major$shared_ext·$libname$shared_ext'2643 ··library_names_spec='$libname$release$versuffix$shared_ext·$libname$release$major$shared_ext·$libname$shared_ext'
2638 ··soname_spec='$libname$release$major$shared_ext'2644 ··soname_spec='$libname$release$major$shared_ext'
2639 ··shlibpath_overrides_runpath=yes2645 ··shlibpath_overrides_runpath=yes
2640 ··shlibpath_var=DYLD_LIBRARY_PATH2646 ··shlibpath_var=DYLD_LIBRARY_PATH
2641 ··shrext_cmds='`test·.$module·=·.yes·&&·echo·.so·||·echo·.dylib`'2647 ··shrext_cmds='`test·.$module·=·.yes·&&·echo·.bundle·||·echo·.dylib`'
2642 m4_if([$1],·[],[2648 m4_if([$1],·[],[
2643 ··sys_lib_search_path_spec="$sys_lib_search_path_spec·/usr/local/lib"])2649 ··sys_lib_search_path_spec="$sys_lib_search_path_spec·/usr/local/lib"])
2644 ··sys_lib_dlsearch_path_spec='/usr/local/lib·/lib·/usr/lib'2650 ··sys_lib_dlsearch_path_spec='/usr/local/lib·/lib·/usr/lib'
2645 ··;;2651 ··;;
  
2646 dgux*)2652 dgux*)
2647 ··version_type=linux·#·correct·to·gnu/linux·during·the·next·big·refactor2653 ··version_type=linux·#·correct·to·gnu/linux·during·the·next·big·refactor
Offset 2661, 26 lines modifiedOffset 2667, 39 lines modified
2661 ····objformat=`/usr/bin/objformat`2667 ····objformat=`/usr/bin/objformat`
2662 ··else2668 ··else
2663 ····case·$host_os·in2669 ····case·$host_os·in
2664 ····freebsd[[23]].*)·objformat=aout·;;2670 ····freebsd[[23]].*)·objformat=aout·;;
2665 ····*)·objformat=elf·;;2671 ····*)·objformat=elf·;;
2666 ····esac2672 ····esac
2667 ··fi2673 ··fi
2668 ··version_type=freebsd-$objformat2674 ··#·Handle·Gentoo/FreeBSD·as·it·was·Linux
 2675 ··case·$host_vendor·in
 2676 ····gentoo)
 2677 ······version_type=linux·;;
 2678 ····*)
 2679 ······version_type=freebsd-$objformat·;;
 2680 ··esac
  
2669 ··case·$version_type·in2681 ··case·$version_type·in
2670 ····freebsd-elf*)2682 ····freebsd-elf*)
2671 ······library_names_spec='$libname$release$shared_ext$versuffix·$libname$release$shared_ext$major·$libname$shared_ext'2683 ······library_names_spec='$libname$release$shared_ext$versuffix·$libname$release$shared_ext$major·$libname$shared_ext'
2672 ······soname_spec='$libname$release$shared_ext$major'2684 ······soname_spec='$libname$release$shared_ext$major'
2673 ······need_version=no2685 ······need_version=no
2674 ······need_lib_prefix=no2686 ······need_lib_prefix=no
2675 ······;;2687 ······;;
2676 ····freebsd-*)2688 ····freebsd-*)
2677 ······library_names_spec='$libname$release$shared_ext$versuffix·$libname$shared_ext$versuffix'2689 ······library_names_spec='$libname$release$shared_ext$versuffix·$libname$shared_ext$versuffix'
2678 ······need_version=yes2690 ······need_version=yes
2679 ······;;2691 ······;;
 2692 ····linux)
 2693 ······library_names_spec='${libname}${release}${shared_ext}$versuffix·${libname}${release}${shared_ext}$major·${libname}${shared_ext}'
 2694 ······soname_spec='${libname}${release}${shared_ext}$major'
 2695 ······need_lib_prefix=no
 2696 ······need_version=no
 2697 ······;;
2680 ··esac2698 ··esac
2681 ··shlibpath_var=LD_LIBRARY_PATH2699 ··shlibpath_var=LD_LIBRARY_PATH
2682 ··case·$host_os·in2700 ··case·$host_os·in
2683 ··freebsd2.*)2701 ··freebsd2.*)
2684 ····shlibpath_overrides_runpath=yes2702 ····shlibpath_overrides_runpath=yes
2685 ····;;2703 ····;;
2686 ··freebsd3.[[01]]*·|·freebsdelf3.[[01]]*)2704 ··freebsd3.[[01]]*·|·freebsdelf3.[[01]]*)
Offset 2882, 26 lines modifiedOffset 2901, 14 lines modified
2882 ··#·GNU·dynamic·linker.··Since·this·was·broken·with·cross·compilers,2901 ··#·GNU·dynamic·linker.··Since·this·was·broken·with·cross·compilers,
2883 ··#·most·powerpc-linux·boxes·support·dynamic·linking·these·days·and2902 ··#·most·powerpc-linux·boxes·support·dynamic·linking·these·days·and
2884 ··#·people·can·always·--disable-shared,·the·test·was·removed,·and·we2903 ··#·people·can·always·--disable-shared,·the·test·was·removed,·and·we
2885 ··#·assume·the·GNU/Linux·dynamic·linker·is·in·use.2904 ··#·assume·the·GNU/Linux·dynamic·linker·is·in·use.
2886 ··dynamic_linker='GNU/Linux·ld.so'2905 ··dynamic_linker='GNU/Linux·ld.so'
2887 ··;;2906 ··;;
  
2888 netbsdelf*-gnu) 
2889 ··version_type=linux 
2890 ··need_lib_prefix=no 
2891 ··need_version=no 
2892 ··library_names_spec='${libname}${release}${shared_ext}$versuffix·${libname}${release}${shared_ext}$major·${libname}${shared_ext}' 
Max diff block lines reached; 11886/16235 bytes (73.21%) of diff not shown.
4.35 KB
libsndfile-1.0.30/Makefile.in
    
Offset 1, 11 lines modifiedOffset 1, 11 lines modified
1 #·Makefile.in·generated·by·automake·1.16.1·from·Makefile.am.1 #·Makefile.in·generated·by·automake·1.16.2·from·Makefile.am.
2 #·@configure_input@2 #·@configure_input@
  
3 #·Copyright·(C)·1994-2018·Free·Software·Foundation,·Inc.3 #·Copyright·(C)·1994-2020·Free·Software·Foundation,·Inc.
  
4 #·This·Makefile.in·is·free·software;·the·Free·Software·Foundation4 #·This·Makefile.in·is·free·software;·the·Free·Software·Foundation
5 #·gives·unlimited·permission·to·copy·and/or·distribute·it,5 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
6 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.6 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
7 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,7 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
8 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without8 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without
Offset 3479, 14 lines modifiedOffset 3479, 18 lines modified
3479 »       tardir=$(distdir)·&&·$(am__tar)·|·lzip·-c·$${LZIP_OPT--9}·>$(distdir).tar.lz3479 »       tardir=$(distdir)·&&·$(am__tar)·|·lzip·-c·$${LZIP_OPT--9}·>$(distdir).tar.lz
3480 »       $(am__post_remove_distdir)3480 »       $(am__post_remove_distdir)
  
3481 dist-xz:·distdir3481 dist-xz:·distdir
3482 »       tardir=$(distdir)·&&·$(am__tar)·|·XZ_OPT=$${XZ_OPT--e}·xz·-c·>$(distdir).tar.xz3482 »       tardir=$(distdir)·&&·$(am__tar)·|·XZ_OPT=$${XZ_OPT--e}·xz·-c·>$(distdir).tar.xz
3483 »       $(am__post_remove_distdir)3483 »       $(am__post_remove_distdir)
  
 3484 dist-zstd:·distdir
 3485 »       tardir=$(distdir)·&&·$(am__tar)·|·zstd·-c·$${ZSTD_CLEVEL-$${ZSTD_OPT--19}}·>$(distdir).tar.zst
 3486 »       $(am__post_remove_distdir)
  
3484 dist-tarZ:·distdir3487 dist-tarZ:·distdir
3485 »       @echo·WARNING:·"Support·for·distribution·archives·compressed·with"·\3488 »       @echo·WARNING:·"Support·for·distribution·archives·compressed·with"·\
3486 »       »       ·······"legacy·program·'compress'·is·deprecated."·>&23489 »       »       ·······"legacy·program·'compress'·is·deprecated."·>&2
3487 »       @echo·WARNING:·"It·will·be·removed·altogether·in·Automake·2.0"·>&23490 »       @echo·WARNING:·"It·will·be·removed·altogether·in·Automake·2.0"·>&2
3488 »       tardir=$(distdir)·&&·$(am__tar)·|·compress·-c·>$(distdir).tar.Z3491 »       tardir=$(distdir)·&&·$(am__tar)·|·compress·-c·>$(distdir).tar.Z
3489 »       $(am__post_remove_distdir)3492 »       $(am__post_remove_distdir)
  
Offset 3521, 14 lines modifiedOffset 3525, 16 lines modified
3521 »       ··xz·-dc·$(distdir).tar.xz·|·$(am__untar)·;;\3525 »       ··xz·-dc·$(distdir).tar.xz·|·$(am__untar)·;;\
3522 »       *.tar.Z*)·\3526 »       *.tar.Z*)·\
3523 »       ··uncompress·-c·$(distdir).tar.Z·|·$(am__untar)·;;\3527 »       ··uncompress·-c·$(distdir).tar.Z·|·$(am__untar)·;;\
3524 »       *.shar.gz*)·\3528 »       *.shar.gz*)·\
3525 »       ··eval·GZIP=·gzip·$(GZIP_ENV)·-dc·$(distdir).shar.gz·|·unshar·;;\3529 »       ··eval·GZIP=·gzip·$(GZIP_ENV)·-dc·$(distdir).shar.gz·|·unshar·;;\
3526 »       *.zip*)·\3530 »       *.zip*)·\
3527 »       ··unzip·$(distdir).zip·;;\3531 »       ··unzip·$(distdir).zip·;;\
 3532 »       *.tar.zst*)·\
 3533 »       ··zstd·-dc·$(distdir).tar.zst·|·$(am__untar)·;;\
3528 »       esac3534 »       esac
3529 »       chmod·-R·a-w·$(distdir)3535 »       chmod·-R·a-w·$(distdir)
3530 »       chmod·u+w·$(distdir)3536 »       chmod·u+w·$(distdir)
3531 »       mkdir·$(distdir)/_build·$(distdir)/_build/sub·$(distdir)/_inst3537 »       mkdir·$(distdir)/_build·$(distdir)/_build/sub·$(distdir)/_inst
3532 »       chmod·a-w·$(distdir)3538 »       chmod·a-w·$(distdir)
3533 »       test·-d·$(distdir)/_build·||·exit·0;·\3539 »       test·-d·$(distdir)/_build·||·exit·0;·\
3534 »       dc_install_base=`$(am__cd)·$(distdir)/_inst·&&·pwd·|·sed·-e·'s,^[^:\\/]:[\\/],/,'`·\3540 »       dc_install_base=`$(am__cd)·$(distdir)/_inst·&&·pwd·|·sed·-e·'s,^[^:\\/]:[\\/],/,'`·\
Offset 4086, 29 lines modifiedOffset 4092, 30 lines modified
4086 .PHONY:·$(am__recursive_targets)·CTAGS·GTAGS·TAGS·all·all-am·\4092 .PHONY:·$(am__recursive_targets)·CTAGS·GTAGS·TAGS·all·all-am·\
4087 »       am--depfiles·am--refresh·check·check-TESTS·check-am·clean·\4093 »       am--depfiles·am--refresh·check·check-TESTS·check-am·clean·\
4088 »       clean-binPROGRAMS·clean-checkPROGRAMS·clean-cscope·\4094 »       clean-binPROGRAMS·clean-checkPROGRAMS·clean-cscope·\
4089 »       clean-generic·clean-libLTLIBRARIES·clean-libtool·clean-local·\4095 »       clean-generic·clean-libLTLIBRARIES·clean-libtool·clean-local·\
4090 »       clean-noinstLTLIBRARIES·clean-noinstPROGRAMS·cscope·\4096 »       clean-noinstLTLIBRARIES·clean-noinstPROGRAMS·cscope·\
4091 »       cscopelist-am·ctags·ctags-am·dist·dist-all·dist-bzip2·\4097 »       cscopelist-am·ctags·ctags-am·dist·dist-all·dist-bzip2·\
4092 »       dist-gzip·dist-lzip·dist-shar·dist-tarZ·dist-xz·dist-zip·\4098 »       dist-gzip·dist-lzip·dist-shar·dist-tarZ·dist-xz·dist-zip·\
4093 »       distcheck·distclean·distclean-compile·distclean-generic·\4099 »       dist-zstd·distcheck·distclean·distclean-compile·\
4094 »       distclean-hdr·distclean-libtool·distclean-tags·distcleancheck·\4100 »       distclean-generic·distclean-hdr·distclean-libtool·\
4095 »       distdir·distuninstallcheck·dvi·dvi-am·html·html-am·info·\4101 »       distclean-tags·distcleancheck·distdir·distuninstallcheck·dvi·\
4096 »       info-am·install·install-am·install-binPROGRAMS·install-data·\4102 »       dvi-am·html·html-am·info·info-am·install·install-am·\
4097 »       install-data-am·install-dist_htmlDATA·install-dvi·\4103 »       install-binPROGRAMS·install-data·install-data-am·\
4098 »       install-dvi-am·install-exec·install-exec-am·install-html·\4104 »       install-dist_htmlDATA·install-dvi·install-dvi-am·install-exec·\
4099 »       install-html-am·install-includeHEADERS·install-info·\4105 »       install-exec-am·install-html·install-html-am·\
4100 »       install-info-am·install-libLTLIBRARIES·install-man·\4106 »       install-includeHEADERS·install-info·install-info-am·\
4101 »       install-man1·install-nodist_includeHEADERS·install-pdf·\4107 »       install-libLTLIBRARIES·install-man·install-man1·\
4102 »       install-pdf-am·install-pkgconfigDATA·install-ps·install-ps-am·\4108 »       install-nodist_includeHEADERS·install-pdf·install-pdf-am·\
4103 »       install-strip·installcheck·installcheck-am·installdirs·\4109 »       install-pkgconfigDATA·install-ps·install-ps-am·install-strip·\
4104 »       installdirs-am·maintainer-clean·maintainer-clean-generic·\4110 »       installcheck·installcheck-am·installdirs·installdirs-am·\
4105 »       mostlyclean·mostlyclean-compile·mostlyclean-generic·\4111 »       maintainer-clean·maintainer-clean-generic·mostlyclean·\
4106 »       mostlyclean-libtool·pdf·pdf-am·ps·ps-am·tags·tags-am·uninstall·\4112 »       mostlyclean-compile·mostlyclean-generic·mostlyclean-libtool·\
4107 »       uninstall-am·uninstall-binPROGRAMS·uninstall-dist_htmlDATA·\4113 »       pdf·pdf-am·ps·ps-am·tags·tags-am·uninstall·uninstall-am·\
 4114 »       uninstall-binPROGRAMS·uninstall-dist_htmlDATA·\
4108 »       uninstall-includeHEADERS·uninstall-libLTLIBRARIES·\4115 »       uninstall-includeHEADERS·uninstall-libLTLIBRARIES·\
4109 »       uninstall-man·uninstall-man1·uninstall-nodist_includeHEADERS·\4116 »       uninstall-man·uninstall-man1·uninstall-nodist_includeHEADERS·\
4110 »       uninstall-pkgconfigDATA4117 »       uninstall-pkgconfigDATA
  
4111 .PRECIOUS:·Makefile4118 .PRECIOUS:·Makefile
  
  
18.6 KB
libsndfile-1.0.30/NEWS
    
Offset 1, 247 lines modifiedOffset 1, 247 lines modified
1 Version·1.0.30·(2020-09-18).1 Version·1.0.30·(2020-09-18)
2 \xd 
3 ··*·Fix·critical·CMake·bug·with·broken·ABI·of·shared·libsndfile·library..2 ··*·Fix·critical·CMake·bug·with·broken·ABI·of·shared·libsndfile·library.
4 ··*·CMake·build·system·considered·to·be·stable..3 ··*·CMake·build·system·considered·to·be·stable.
5 ··*·Move·sndfile.h.in·from·src/·to·include/·directory.·To·avoid·problems,.4 ··*·Move·sndfile.h.in·from·src/·to·include/·directory.·To·avoid·problems,
6 ····delete·old·generated·sndfile.h·from·$(top_builddir)/src..5 ····delete·old·generated·sndfile.h·from·$(top_builddir)/src.
7 ··*·Huge·documentation·update..6 ··*·Huge·documentation·update.
8 ··*·Fix·opus·test·failures·on·BE·platforms,·thanks·to.7 ··*·Fix·opus·test·failures·on·BE·platforms,·thanks·to
9 ····Arthur·Taylor·<art@ified.ca>..8 ····Arthur·Taylor·<art@ified.ca>.
10 ··*·Fix·bug·when·sf_open_fd()·function·sometimes·leaves·filehandle·open,·even.9 ··*·Fix·bug·when·sf_open_fd()·function·sometimes·leaves·filehandle·open,·even
11 ····if·`close_desc`·parameter·is·TRUE,·thanks·to·@umläute..10 ····if·`close_desc`·parameter·is·TRUE,·thanks·to·@umläute.
12 ··*·Fix·infinite·loops·on·some·pathological·SD2·files,·thanks·to.11 ··*·Fix·infinite·loops·on·some·pathological·SD2·files,·thanks·to
13 ····Jeremy·Friesner·<jaf@meyersound.com>..12 ····Jeremy·Friesner·<jaf@meyersound.com>.
14 ··*·Switch·to·GitHub·Actions·for·continuous·integration..13 ··*·Switch·to·GitHub·Actions·for·continuous·integration.
15 ··*·Add·OSS-Fuzz·tests·to·GitHub·Actions·workflow,·thanks·to.14 ··*·Add·OSS-Fuzz·tests·to·GitHub·Actions·workflow,·thanks·to
16 ····Max·Dymond·<cmeister2@gmail.com>..15 ····Max·Dymond·<cmeister2@gmail.com>.
17 ··*·Fix·memory·leak·in·wavlike_read_bext_chunk()·function,·credit·to·OSS-Fuzz..16 ··*·Fix·memory·leak·in·wavlike_read_bext_chunk()·function,·credit·to·OSS-Fuzz.
18 ··*·Fix·undefined·behavior·in·avr-read_header()·function,·credit·to·OSS-Fuzz..17 ··*·Fix·undefined·behavior·in·avr-read_header()·function,·credit·to·OSS-Fuzz.
19 ··*·Add·INSTALL_PKGCONFIG_MODULE·CMake·option·to·control·sndfile.pc·file.18 ··*·Add·INSTALL_PKGCONFIG_MODULE·CMake·option·to·control·sndfile.pc·file
20 ····installation,·see·README.md·for·details..19 ····installation,·see·README.md·for·details.
21 ··*·Add·INSTALL_MANPAGES·CMake·option,·see·README.md·for·details..20 ··*·Add·INSTALL_MANPAGES·CMake·option,·see·README.md·for·details.
22 ··*·Fix·ENABLE_COMPATIBLE_LIBSNDFILE_NAME·CMake·option,·now·it·works·on·MinGW.21 ··*·Fix·ENABLE_COMPATIBLE_LIBSNDFILE_NAME·CMake·option,·now·it·works·on·MinGW
23 ····platform·too..22 ····platform·too.
24 ··*·Fix·ENABLE_CPACK·CMake·option,·see·README.md·for·details..23 ··*·Fix·ENABLE_CPACK·CMake·option,·see·README.md·for·details.
25 ··*·Fix·ENABLE_STATIC_RUNTIME·and·CMAKE_MSVC_RUNTIME_LIBRARY·behavior,·see.24 ··*·Fix·ENABLE_STATIC_RUNTIME·and·CMAKE_MSVC_RUNTIME_LIBRARY·behavior,·see
26 ····README.md·for·details..25 ····README.md·for·details.
27 ··*·Fix·CMake·man·pages·installation·bug·when·sndfile-deinterleave.1·and.26 ··*·Fix·CMake·man·pages·installation·bug·when·sndfile-deinterleave.1·and
28 ····sndfile-metadata-set.1·were·not·installed..27 ····sndfile-metadata-set.1·were·not·installed.
29 ··*·Fix·sndfile-regtest·paths·handling·on·Windows·platform,·thanks·to.28 ··*·Fix·sndfile-regtest·paths·handling·on·Windows·platform,·thanks·to
30 ····Gisle·Vanem·<gvanem@yahoo.no>..29 ····Gisle·Vanem·<gvanem@yahoo.no>.
31 \xd 
32 Version·1.0.29·(2020-08-15).30 Version·1.0.29·(2020-08-15)
33 ··*·Add·support·for·Opus·files..31 ··*·Add·support·for·Opus·files.
34 ··*·Autotool·build·system·improvements..32 ··*·Autotool·build·system·improvements.
35 ··*·CMake·build·system·improvements..33 ··*·CMake·build·system·improvements.
36 ··*·Fixes·for:·CVE-2017-12562,·CVE-2017-17456,·CVE-2017-17457,·CVE-2018-19661,.34 ··*·Fixes·for:·CVE-2017-12562,·CVE-2017-17456,·CVE-2017-17457,·CVE-2018-19661,
37 ····CVE-2018-19662,·CVE-2018-19758·and·CVE-2019-3832..35 ····CVE-2018-19662,·CVE-2018-19758·and·CVE-2019-3832.
38 ··*·Add·BWF·v2·loudness·parameters..36 ··*·Add·BWF·v2·loudness·parameters.
39 ··*·Wave64:·Permit·and·skip·arbitrary·chunks·prior·to·the·data·chunk..37 ··*·Wave64:·Permit·and·skip·arbitrary·chunks·prior·to·the·data·chunk.
40 ··*·Fix·ASAN·crash·in·wavlike_ima_seek()..38 ··*·Fix·ASAN·crash·in·wavlike_ima_seek().
41 ··*·Fix·IMA-ADPCM·encoding·for·AIFF·files..39 ··*·Fix·IMA-ADPCM·encoding·for·AIFF·files.
42 ··*·sndfile-convert:·Handle·gsm,·vox·and·opus·extensions·the·same·way..40 ··*·sndfile-convert:·Handle·gsm,·vox·and·opus·extensions·the·same·way.
43 ··*·Add·SFC_SET_OGG_PAGE_LATENCY_MS·command·to·get·Ogg·page·latency·for·Ogg·Opus.41 ··*·Add·SFC_SET_OGG_PAGE_LATENCY_MS·command·to·get·Ogg·page·latency·for·Ogg·Opus
44 ····files..42 ····files.
45 ··*·Fix·parsing·of·some·SD2·files..43 ··*·Fix·parsing·of·some·SD2·files.
46 ··*·Documentation·updates..44 ··*·Documentation·updates.
47 ··*·Minor·bug·fixes·and·improvements..45 ··*·Minor·bug·fixes·and·improvements.
48 \xd 
49 Version·1.0.28·(2017-04-02).46 Version·1.0.28·(2017-04-02)
50 ··*·Fix·buffer·overruns·in·FLAC·and·ID3·handling·code..47 ··*·Fix·buffer·overruns·in·FLAC·and·ID3·handling·code.
51 ··*·Move·to·variable·length·header·storage..48 ··*·Move·to·variable·length·header·storage.
52 ··*·Fix·detection·of·Large·File·Support·for·32·bit·systems..49 ··*·Fix·detection·of·Large·File·Support·for·32·bit·systems.
53 ··*·Remove·large·stack·allocations·in·ALAC·handling·code..50 ··*·Remove·large·stack·allocations·in·ALAC·handling·code.
54 ··*·Remove·all·use·of·Variable·Length·Arrays..51 ··*·Remove·all·use·of·Variable·Length·Arrays.
55 ··*·Minor·bug·fixes·and·improvements..52 ··*·Minor·bug·fixes·and·improvements.
56 \xd 
57 Version·1.0.27·(2016-06-19).53 Version·1.0.27·(2016-06-19)
58 ··*·Fix·an·SF_INFO·seekable·flag·regression·introduced·in·1.0.26..54 ··*·Fix·an·SF_INFO·seekable·flag·regression·introduced·in·1.0.26.
59 ··*·Fix·potential·infinite·loops·on·malformed·input·files..55 ··*·Fix·potential·infinite·loops·on·malformed·input·files.
60 ··*·Add·string·metadata·read/write·for·CAF·and·RF64..56 ··*·Add·string·metadata·read/write·for·CAF·and·RF64.
61 ··*·Add·handling·of·CUE·chunks..57 ··*·Add·handling·of·CUE·chunks.
62 ··*·Fix·endian-ness·issues·in·PAF·files..58 ··*·Fix·endian-ness·issues·in·PAF·files.
63 ··*·Minor·bug·fixes·and·improvements..59 ··*·Minor·bug·fixes·and·improvements.
64 \xd 
65 Version·1.0.26·(2015-11-22).60 Version·1.0.26·(2015-11-22)
66 ··*·Fix·for·CVE-2014-9496,·SD2·buffer·read·overflow..61 ··*·Fix·for·CVE-2014-9496,·SD2·buffer·read·overflow.
67 ··*·Fix·for·CVE-2014-9756,·file_io.c·divide·by·zero..62 ··*·Fix·for·CVE-2014-9756,·file_io.c·divide·by·zero.
68 ··*·Fix·for·CVE-2015-7805,·AIFF·heap·write·overflow..63 ··*·Fix·for·CVE-2015-7805,·AIFF·heap·write·overflow.
69 ··*·Add·support·for·ALAC·encoder·in·a·CAF·container..64 ··*·Add·support·for·ALAC·encoder·in·a·CAF·container.
70 ··*·Add·support·for·Cart·chunks·in·WAV·files..65 ··*·Add·support·for·Cart·chunks·in·WAV·files.
71 ··*·Minor·bug·fixes·and·improvements..66 ··*·Minor·bug·fixes·and·improvements.
72 \xd 
73 Version·1.0.25·(2011-07-13).67 Version·1.0.25·(2011-07-13)
74 ··*·Fix·for·Secunia·Advisory·SA45125,·heap·overflow·in·PAF·file·handler..68 ··*·Fix·for·Secunia·Advisory·SA45125,·heap·overflow·in·PAF·file·handler.
75 ··*·Accept·broken·WAV·files·with·blockalign·==·0..69 ··*·Accept·broken·WAV·files·with·blockalign·==·0.
76 ··*·Minor·bug·fixes·and·improvements..70 ··*·Minor·bug·fixes·and·improvements.
77 \xd 
78 Version·1.0.24·(2011-03-23).71 Version·1.0.24·(2011-03-23)
79 ··*·WAV·files·now·have·an·18·byte·u-law·and·A-law·fmt·chunk..72 ··*·WAV·files·now·have·an·18·byte·u-law·and·A-law·fmt·chunk.
80 ··*·Document·virtual·I/O·functionality..73 ··*·Document·virtual·I/O·functionality.
81 ··*·Two·new·methods·rawHandle()·and·takeOwnership()·in·sndfile.hh..74 ··*·Two·new·methods·rawHandle()·and·takeOwnership()·in·sndfile.hh.
82 ··*·AIFF·fix·for·non-zero·offset·value·in·SSND·chunk..75 ··*·AIFF·fix·for·non-zero·offset·value·in·SSND·chunk.
83 ··*·Minor·bug·fixes·and·improvements..76 ··*·Minor·bug·fixes·and·improvements.
84 \xd 
85 Version·1.0.23·(2010-10-10).77 Version·1.0.23·(2010-10-10)
86 ··*·Add·version·metadata·to·Windows·DLL..78 ··*·Add·version·metadata·to·Windows·DLL.
87 ··*·Add·a·missing·'inline'·to·sndfile.hh..79 ··*·Add·a·missing·'inline'·to·sndfile.hh.
88 ··*·Update·docs..80 ··*·Update·docs.
89 ··*·Minor·bug·fixes·and·improvements..81 ··*·Minor·bug·fixes·and·improvements.
90 \xd 
91 Version·1.0.22·(2010-10-04).82 Version·1.0.22·(2010-10-04)
92 ··*·Couple·of·fixes·for·SDS·file·writer..83 ··*·Couple·of·fixes·for·SDS·file·writer.
93 ··*·Fixes·arising·from·static·analysis..84 ··*·Fixes·arising·from·static·analysis.
94 ··*·Handle·FLAC·files·with·ID3·meta·data·at·start·of·file..85 ··*·Handle·FLAC·files·with·ID3·meta·data·at·start·of·file.
95 ··*·Handle·FLAC·files·which·report·zero·length..86 ··*·Handle·FLAC·files·which·report·zero·length.
96 ··*·Other·minor·bug·fixes·and·improvements..87 ··*·Other·minor·bug·fixes·and·improvements.
97 \xd 
98 Version·1.0.21·(2009-12-13).88 Version·1.0.21·(2009-12-13)
99 ··*·Add·a·couple·of·new·binary·programs·to·programs/·dir..89 ··*·Add·a·couple·of·new·binary·programs·to·programs/·dir.
100 ··*·Remove·sndfile-jackplay·(now·in·sndfile-tools·package)..90 ··*·Remove·sndfile-jackplay·(now·in·sndfile-tools·package).
101 ··*·Add·windows·only·function·sf_wchar_open()..91 ··*·Add·windows·only·function·sf_wchar_open().
102 ··*·Bunch·of·minor·bug·fixes..92 ··*·Bunch·of·minor·bug·fixes.
103 \xd 
104 Version·1.0.20·(2009-05-14).93 Version·1.0.20·(2009-05-14)
105 ··*·Fix·potential·heap·overflow·in·VOC·file·parser·(Tobias·Klein,·http://www.trapkit.de/)..94 ··*·Fix·potential·heap·overflow·in·VOC·file·parser·(Tobias·Klein,·http://www.trapkit.de/).
106 \xd 
107 Version·1.0.19·(2009-03-02).95 Version·1.0.19·(2009-03-02)
108 ··*·Fix·for·CVE-2009-0186·(Alin·Rad·Pop,·Secunia·Research)..96 ··*·Fix·for·CVE-2009-0186·(Alin·Rad·Pop,·Secunia·Research).
109 ··*·Huge·number·of·minor·bug·fixes·as·a·result·of·static·analysis..97 ··*·Huge·number·of·minor·bug·fixes·as·a·result·of·static·analysis.
110 \xd 
111 Version·1.0.18·(2009-02-07).98 Version·1.0.18·(2009-02-07)
112 ··*·Add·Ogg/Vorbis·support·(thanks·to·John·ffitch)..99 ··*·Add·Ogg/Vorbis·support·(thanks·to·John·ffitch).
113 ··*·Remove·captive·FLAC·library..100 ··*·Remove·captive·FLAC·library.
114 ··*·Many·new·features·and·bug·fixes..101 ··*·Many·new·features·and·bug·fixes.
115 ··*·Generate·Win32·and·Win64·pre-compiled·binaries..102 ··*·Generate·Win32·and·Win64·pre-compiled·binaries.
116 \xd 
117 Version·1.0.17·(2006-08-31).103 Version·1.0.17·(2006-08-31)
118 ··*·Add·sndfile.hh·C++·wrapper..104 ··*·Add·sndfile.hh·C++·wrapper.
119 ··*·Update·Win32·MinGW·build·instructions..105 ··*·Update·Win32·MinGW·build·instructions.
120 ··*·Minor·bug·fixes·and·cleanups..106 ··*·Minor·bug·fixes·and·cleanups.
121 \xd 
122 Version·1.0.16·(2006-04-30).107 Version·1.0.16·(2006-04-30)
123 ··*·Add·support·for·Broadcast·(BEXT)·chunks·in·WAV·files..108 ··*·Add·support·for·Broadcast·(BEXT)·chunks·in·WAV·files.
124 ··*·Implement·new·commands·SFC_GET_SIGNAL_MAX·and·SFC_GET_MAX_ALL_CHANNELS..109 ··*·Implement·new·commands·SFC_GET_SIGNAL_MAX·and·SFC_GET_MAX_ALL_CHANNELS.
125 ··*·Add·support·for·RIFX·(big·endian·WAV·variant)..110 ··*·Add·support·for·RIFX·(big·endian·WAV·variant).
126 ··*·Fix·configure·script·bugs..111 ··*·Fix·configure·script·bugs.
127 ··*·Fix·bug·in·INST·and·MARK·chunk·writing·for·AIFF·files..112 ··*·Fix·bug·in·INST·and·MARK·chunk·writing·for·AIFF·files.
Max diff block lines reached; -1/18973 bytes (-0.01%) of diff not shown.
691 B
libsndfile-1.0.30/Octave/Makefile.in
    
Offset 1, 11 lines modifiedOffset 1, 11 lines modified
1 #·Makefile.in·generated·by·automake·1.16.1·from·Makefile.am.1 #·Makefile.in·generated·by·automake·1.16.2·from·Makefile.am.
2 #·@configure_input@2 #·@configure_input@
  
3 #·Copyright·(C)·1994-2018·Free·Software·Foundation,·Inc.3 #·Copyright·(C)·1994-2020·Free·Software·Foundation,·Inc.
  
4 #·This·Makefile.in·is·free·software;·the·Free·Software·Foundation4 #·This·Makefile.in·is·free·software;·the·Free·Software·Foundation
5 #·gives·unlimited·permission·to·copy·and/or·distribute·it,5 #·gives·unlimited·permission·to·copy·and/or·distribute·it,
6 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.6 #·with·or·without·modifications,·as·long·as·this·notice·is·preserved.
  
7 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,7 #·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
8 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without8 #·but·WITHOUT·ANY·WARRANTY,·to·the·extent·permitted·by·law;·without
5.44 KB
libsndfile-1.0.30/ossfuzz/sndfile_fuzzer.cc
    
Offset 1, 134 lines modifiedOffset 1, 134 lines modified
1 #include·<stdint.h>.1 #include·<stdint.h>
2 #include·<stdlib.h>.2 #include·<stdlib.h>
3 #include·<string.h>.3 #include·<string.h>
4 #include·<sys/types.h>.4 #include·<sys/types.h>
5 #include·<sndfile.h>.5 #include·<sndfile.h>
6 \xd 
7 typedef·struct.6 typedef·struct
8 {.7 {
9 ··sf_count_t·offset;.8 ··sf_count_t·offset;
10 ··sf_count_t·length;.9 ··sf_count_t·length;
11 ··const·unsigned·char·*data;.10 ··const·unsigned·char·*data;
12 }·VIO_DATA;.11 }·VIO_DATA;
13 \xd 
14 static·sf_count_t·vfget_filelen·(void·*user_data).12 static·sf_count_t·vfget_filelen·(void·*user_data)
15 {.13 {
16 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;.14 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;
17 ··return·vf->length;.15 ··return·vf->length;
18 }.16 }
19 \xd 
20 static·sf_count_t·vfseek·(sf_count_t·offset,·int·whence,·void·*user_data).17 static·sf_count_t·vfseek·(sf_count_t·offset,·int·whence,·void·*user_data)
21 {.18 {
22 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;.19 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;
23 \xd 
24 ··switch·(whence).20 ··switch·(whence)
25 ··{.21 ··{
26 ····case·SEEK_SET:.22 ····case·SEEK_SET:
27 ······vf->offset·=·offset;.23 ······vf->offset·=·offset;
28 ······break·;.24 ······break·;
29 \xd 
30 ····case·SEEK_CUR:.25 ····case·SEEK_CUR:
31 ······vf->offset·=·vf->offset·+·offset;.26 ······vf->offset·=·vf->offset·+·offset;
32 ······break·;.27 ······break·;
33 \xd 
34 ····case·SEEK_END:.28 ····case·SEEK_END:
35 ······vf->offset·=·vf->length·+·offset;.29 ······vf->offset·=·vf->length·+·offset;
36 ······break;.30 ······break;
37 \xd 
38 ····default:.31 ····default:
39 ······break;.32 ······break;
40 ··}.33 ··}
41 \xd 
42 ··return·vf->offset;.34 ··return·vf->offset;
43 }.35 }
44 \xd 
45 static·sf_count_t·vfread·(void·*ptr,·sf_count_t·count,·void·*user_data).36 static·sf_count_t·vfread·(void·*ptr,·sf_count_t·count,·void·*user_data)
46 {.37 {
47 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;.38 ··VIO_DATA·*vf·=·(VIO_DATA·*)user_data;
48 \xd 
49 ··if·(vf->offset·+·count·>·vf->length).39 ··if·(vf->offset·+·count·>·vf->length)
50 ··{.40 ··{
51 ····count·=·vf->length·-·vf->offset;.41 ····count·=·vf->length·-·vf->offset;
52 ··}.42 ··}
53 \xd 
54 ··memcpy(ptr,·vf->data·+·vf->offset,·count);.43 ··memcpy(ptr,·vf->data·+·vf->offset,·count);
55 ··vf->offset·+=·count;.44 ··vf->offset·+=·count;
56 \xd 
57 ··return·count;.45 ··return·count;
58 }.46 }
59 \xd 
60 static·sf_count_t·vfwrite·(const·void·*ptr,·sf_count_t·count,·void·*user_data).47 static·sf_count_t·vfwrite·(const·void·*ptr,·sf_count_t·count,·void·*user_data)
61 {.48 {
62 ··(void)ptr;.49 ··(void)ptr;
63 ··(void)count;.50 ··(void)count;
64 ··(void)user_data;.51 ··(void)user_data;
65 \xd 
66 ··//·Cannot·write·to·this·virtual·file..52 ··//·Cannot·write·to·this·virtual·file.
67 ··return·0;.53 ··return·0;
68 }.54 }
69 \xd 
70 static·sf_count_t·vftell·(void·*user_data).55 static·sf_count_t·vftell·(void·*user_data)
71 {·VIO_DATA·*vf·=·(VIO_DATA·*)user_data;.56 {·VIO_DATA·*vf·=·(VIO_DATA·*)user_data;
72 \xd 
73 ··return·vf->offset;.57 ··return·vf->offset;
74 }.58 }
75 \xd 
76 extern·"C"·int·LLVMFuzzerTestOneInput(const·uint8_t*·data,·size_t·size).59 extern·"C"·int·LLVMFuzzerTestOneInput(const·uint8_t*·data,·size_t·size)
77 {.60 {
78 ··VIO_DATA·vio_data;.61 ··VIO_DATA·vio_data;
79 ··SF_VIRTUAL_IO·vio;.62 ··SF_VIRTUAL_IO·vio;
80 ··SF_INFO·sndfile_info;.63 ··SF_INFO·sndfile_info;
81 ··SNDFILE·*sndfile·=·NULL;.64 ··SNDFILE·*sndfile·=·NULL;
82 ··float*·read_buffer·=·NULL;.65 ··float*·read_buffer·=·NULL;
83 \xd 
84 ··//·Initialize·the·virtual·IO·structure..66 ··//·Initialize·the·virtual·IO·structure.
85 ··vio.get_filelen·=·vfget_filelen;.67 ··vio.get_filelen·=·vfget_filelen;
86 ··vio.seek·=·vfseek;.68 ··vio.seek·=·vfseek;
87 ··vio.read·=·vfread;.69 ··vio.read·=·vfread;
88 ··vio.write·=·vfwrite;.70 ··vio.write·=·vfwrite;
89 ··vio.tell·=·vftell;.71 ··vio.tell·=·vftell;
90 \xd 
91 ··//·Initialize·the·VIO·user·data..72 ··//·Initialize·the·VIO·user·data.
92 ··vio_data.data·=·data;.73 ··vio_data.data·=·data;
93 ··vio_data.length·=·size;.74 ··vio_data.length·=·size;
94 ··vio_data.offset·=·0;.75 ··vio_data.offset·=·0;
95 \xd 
96 ··memset(&sndfile_info,·0,·sizeof(SF_INFO));.76 ··memset(&sndfile_info,·0,·sizeof(SF_INFO));
97 \xd 
98 ··//·Try·and·open·the·virtual·file..77 ··//·Try·and·open·the·virtual·file.
99 ··sndfile·=·sf_open_virtual(&vio,·SFM_READ,·&sndfile_info,·&vio_data);.78 ··sndfile·=·sf_open_virtual(&vio,·SFM_READ,·&sndfile_info,·&vio_data);
100 \xd 
101 ··if·(sndfile_info.channels·==·0).79 ··if·(sndfile_info.channels·==·0)
102 ··{.80 ··{
103 ····//·No·sound·channels·in·file..81 ····//·No·sound·channels·in·file.
104 ····goto·EXIT_LABEL;.82 ····goto·EXIT_LABEL;
105 ··}.83 ··}
106 ··else·if·(sndfile_info.channels·>·1024·*·1024).84 ··else·if·(sndfile_info.channels·>·1024·*·1024)
107 ··{.85 ··{
108 ····//·Too·many·channels·to·handle..86 ····//·Too·many·channels·to·handle.
109 ····goto·EXIT_LABEL;.87 ····goto·EXIT_LABEL;
110 ··}.88 ··}
111 \xd 
112 ··//·Just·the·right·number·of·channels.·Create·some·buffer·space·for·reading..89 ··//·Just·the·right·number·of·channels.·Create·some·buffer·space·for·reading.
113 ··read_buffer·=·(float*)malloc(sizeof(float)·*·sndfile_info.channels);.90 ··read_buffer·=·(float*)malloc(sizeof(float)·*·sndfile_info.channels);
114 ··if·(read_buffer·==·NULL).91 ··if·(read_buffer·==·NULL)
115 ··{.92 ··{
116 ····abort();.93 ····abort();
117 ··}.94 ··}
118 \xd 
119 ··while·(sf_readf_float(sndfile,·read_buffer,·1)).95 ··while·(sf_readf_float(sndfile,·read_buffer,·1))
120 ··{.96 ··{
121 ····//·Do·nothing·with·the·data..97 ····//·Do·nothing·with·the·data.
122 ··}.98 ··}
123 \xd 
124 EXIT_LABEL:.99 EXIT_LABEL:
125 \xd 
126 ··if·(sndfile·!=·NULL).100 ··if·(sndfile·!=·NULL)
127 ··{.101 ··{
Max diff block lines reached; -1/5488 bytes (-0.02%) of diff not shown.
4.42 KB
libsndfile-1.0.30/ossfuzz/standaloneengine.cc
    
Offset 1, 86 lines modifiedOffset 1, 86 lines modified
1 #include·<stdint.h>.1 #include·<stdint.h>
2 #include·<stdio.h>.2 #include·<stdio.h>
3 #include·<stdlib.h>.3 #include·<stdlib.h>
4 \xd 
5 #include·"testinput.h".4 #include·"testinput.h"
6 \xd 
7 /**.5 /**
8 ·*·Main·procedure·for·standalone·fuzzing·engine..6 ·*·Main·procedure·for·standalone·fuzzing·engine.
9 ·*.7 ·*
10 ·*·Reads·filenames·from·the·argument·array.·For·each·filename,·read·the·file.8 ·*·Reads·filenames·from·the·argument·array.·For·each·filename,·read·the·file
11 ·*·into·memory·and·then·call·the·fuzzing·interface·with·the·data..9 ·*·into·memory·and·then·call·the·fuzzing·interface·with·the·data.
12 ·*/.10 ·*/
13 int·main(int·argc,·char·**argv).11 int·main(int·argc,·char·**argv)
14 {.12 {
15 ··int·ii;.13 ··int·ii;
16 ··for(ii·=·1;·ii·<·argc;·ii++).14 ··for(ii·=·1;·ii·<·argc;·ii++)
17 ··{.15 ··{
18 ····FILE·*infile;.16 ····FILE·*infile;
19 ····printf("[%s]·",·argv[ii]);.17 ····printf("[%s]·",·argv[ii]);
20 \xd 
21 ····/*·Try·and·open·the·file.·*/.18 ····/*·Try·and·open·the·file.·*/
22 ····infile·=·fopen(argv[ii],·"rb");.19 ····infile·=·fopen(argv[ii],·"rb");
23 ····if(infile).20 ····if(infile)
24 ····{.21 ····{
25 ······uint8_t·*buffer·=·NULL;.22 ······uint8_t·*buffer·=·NULL;
26 ······size_t·buffer_len;.23 ······size_t·buffer_len;
27 \xd 
28 ······printf("Opened..·");.24 ······printf("Opened..·");
29 \xd 
30 ······/*·Get·the·length·of·the·file.·*/.25 ······/*·Get·the·length·of·the·file.·*/
31 ······fseek(infile,·0L,·SEEK_END);.26 ······fseek(infile,·0L,·SEEK_END);
32 ······buffer_len·=·ftell(infile);.27 ······buffer_len·=·ftell(infile);
33 \xd 
34 ······/*·Reset·the·file·indicator·to·the·beginning·of·the·file.·*/.28 ······/*·Reset·the·file·indicator·to·the·beginning·of·the·file.·*/
35 ······fseek(infile,·0L,·SEEK_SET);.29 ······fseek(infile,·0L,·SEEK_SET);
36 \xd 
37 ······/*·Allocate·a·buffer·for·the·file·contents.·*/.30 ······/*·Allocate·a·buffer·for·the·file·contents.·*/
38 ······buffer·=·(uint8_t·*)calloc(buffer_len,·sizeof(uint8_t));.31 ······buffer·=·(uint8_t·*)calloc(buffer_len,·sizeof(uint8_t));
39 ······if(buffer).32 ······if(buffer)
40 ······{.33 ······{
41 ········size_t·result;.34 ········size_t·result;
42 \xd 
43 ········/*·Read·all·the·text·from·the·file·into·the·buffer.·*/.35 ········/*·Read·all·the·text·from·the·file·into·the·buffer.·*/
44 ········result·=·fread(buffer,·sizeof(uint8_t),·buffer_len,·infile);.36 ········result·=·fread(buffer,·sizeof(uint8_t),·buffer_len,·infile);
45 \xd 
46 ········if·(result·==·buffer_len).37 ········if·(result·==·buffer_len)
47 ········{.38 ········{
48 ··········printf("Read·%zu·bytes,·fuzzing..·",·buffer_len);.39 ··········printf("Read·%zu·bytes,·fuzzing..·",·buffer_len);
49 ··········/*·Call·the·fuzzer·with·the·data.·*/.40 ··········/*·Call·the·fuzzer·with·the·data.·*/
50 ··········LLVMFuzzerTestOneInput(buffer,·buffer_len);.41 ··········LLVMFuzzerTestOneInput(buffer,·buffer_len);
51 \xd 
52 ··········printf("complete·!!");.42 ··········printf("complete·!!");
53 ········}.43 ········}
54 ········else.44 ········else
55 ········{.45 ········{
56 ··········fprintf(stderr,.46 ··········fprintf(stderr,
57 ··················"Failed·to·read·%zu·bytes·(result·%zu)\n",.47 ··················"Failed·to·read·%zu·bytes·(result·%zu)\n",
58 ··················buffer_len,.48 ··················buffer_len,
59 ··················result);.49 ··················result);
60 ········}.50 ········}
61 \xd 
62 ········/*·Free·the·buffer·as·it's·no·longer·needed.·*/.51 ········/*·Free·the·buffer·as·it's·no·longer·needed.·*/
63 ········free(buffer);.52 ········free(buffer);
64 ········buffer·=·NULL;.53 ········buffer·=·NULL;
65 ······}.54 ······}
66 ······else.55 ······else
67 ······{.56 ······{
68 ········fprintf(stderr,.57 ········fprintf(stderr,
69 ················"[%s]·Failed·to·allocate·%zu·bytes·\n",.58 ················"[%s]·Failed·to·allocate·%zu·bytes·\n",
70 ················argv[ii],.59 ················argv[ii],
71 ················buffer_len);.60 ················buffer_len);
72 ······}.61 ······}
73 \xd 
74 ······/*·Close·the·file·as·it's·no·longer·needed.·*/.62 ······/*·Close·the·file·as·it's·no·longer·needed.·*/
75 ······fclose(infile);.63 ······fclose(infile);
76 ······infile·=·NULL;.64 ······infile·=·NULL;
77 ····}.65 ····}
78 ····else.66 ····else
79 ····{.67 ····{
80 ······/*·Failed·to·open·the·file.·Maybe·wrong·name·or·wrong·permissions?·*/.68 ······/*·Failed·to·open·the·file.·Maybe·wrong·name·or·wrong·permissions?·*/
81 ······fprintf(stderr,·"[%s]·Open·failed.·\n",·argv[ii]);.69 ······fprintf(stderr,·"[%s]·Open·failed.·\n",·argv[ii]);
82 ····}.70 ····}
83 \xd 
84 ····printf("\n");.71 ····printf("\n");
85 ··}.72 ··}
86 }.73 }
291 B
libsndfile-1.0.30/ossfuzz/testinput.h
    
Offset 1, 3 lines modifiedOffset 1, 3 lines modified
1 #include·<inttypes.h>.1 #include·<inttypes.h>
2 \xd 
3 extern·"C"·int·LLVMFuzzerTestOneInput(const·uint8_t·*data,·size_t·size);.2 extern·"C"·int·LLVMFuzzerTestOneInput(const·uint8_t·*data,·size_t·size);
49.9 KB
libsndfile-1.0.30/programs/sndfile-play.c
    
Offset 1, 860 lines modifiedOffset 1, 860 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·All·rights·reserved..4 **·All·rights·reserved.
5 **.5 **
6 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without.6 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without
7 **·modification,·are·permitted·provided·that·the·following·conditions·are.7 **·modification,·are·permitted·provided·that·the·following·conditions·are
8 **·met:.8 **·met:
9 **.9 **
10 **·····*·Redistributions·of·source·code·must·retain·the·above·copyright.10 **·····*·Redistributions·of·source·code·must·retain·the·above·copyright
11 **·······notice,·this·list·of·conditions·and·the·following·disclaimer..11 **·······notice,·this·list·of·conditions·and·the·following·disclaimer.
12 **·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright.12 **·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright
13 **·······notice,·this·list·of·conditions·and·the·following·disclaimer·in.13 **·······notice,·this·list·of·conditions·and·the·following·disclaimer·in
14 **·······the·documentation·and/or·other·materials·provided·with·the.14 **·······the·documentation·and/or·other·materials·provided·with·the
15 **·······distribution..15 **·······distribution.
16 **·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used.16 **·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used
17 **·······to·endorse·or·promote·products·derived·from·this·software·without.17 **·······to·endorse·or·promote·products·derived·from·this·software·without
18 **·······specific·prior·written·permission..18 **·······specific·prior·written·permission.
19 **.19 **
20 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS.20 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS
21 **·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED.21 **·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED
22 **·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR.22 **·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR
23 **·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR.23 **·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR
24 **·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,.24 **·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,
25 **·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,.25 **·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,
26 **·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;.26 **·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;
27 **·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,.27 **·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,
28 **·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR.28 **·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR
29 **·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF.29 **·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF
30 **·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE..30 **·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE.
31 */.31 */
32 \xd 
33 #include·"sfconfig.h".32 #include·"sfconfig.h"
34 \xd 
35 #include·<stdio.h>.33 #include·<stdio.h>
36 #include·<stdlib.h>.34 #include·<stdlib.h>
37 #include·<string.h>.35 #include·<string.h>
38 #include·<errno.h>.36 #include·<errno.h>
39 \xd 
40 #if·HAVE_UNISTD_H.37 #if·HAVE_UNISTD_H
41 #include·<unistd.h>.38 #include·<unistd.h>
42 #else.39 #else
43 #include·"sf_unistd.h".40 #include·"sf_unistd.h"
44 #endif.41 #endif
45 \xd 
46 #include·<sndfile.h>.42 #include·<sndfile.h>
47 \xd 
48 #include·"common.h".43 #include·"common.h"
49 \xd 
50 #if·HAVE_ALSA_ASOUNDLIB_H.44 #if·HAVE_ALSA_ASOUNDLIB_H
51 »       #define·ALSA_PCM_NEW_HW_PARAMS_API.45 »       #define·ALSA_PCM_NEW_HW_PARAMS_API
52 »       #define·ALSA_PCM_NEW_SW_PARAMS_API.46 »       #define·ALSA_PCM_NEW_SW_PARAMS_API
53 »       #include·<alsa/asoundlib.h>.47 »       #include·<alsa/asoundlib.h>
54 »       #include·<sys/time.h>.48 »       #include·<sys/time.h>
55 #endif.49 #endif
56 \xd 
57 #if·defined·(__ANDROID__).50 #if·defined·(__ANDROID__)
58 \xd 
59 #elif·defined·(__linux__)·||·defined·(__FreeBSD_kernel__)·||·defined·(__FreeBSD__).51 #elif·defined·(__linux__)·||·defined·(__FreeBSD_kernel__)·||·defined·(__FreeBSD__)
60 »       #include·»       <fcntl.h>.52 »       #include·»       <fcntl.h>
61 »       #include·»       <sys/ioctl.h>.53 »       #include·»       <sys/ioctl.h>
62 »       #include·»       <sys/soundcard.h>.54 »       #include·»       <sys/soundcard.h>
63 \xd 
64 #elif·HAVE_SNDIO_H.55 #elif·HAVE_SNDIO_H
65 »       #include·<sndio.h>.56 »       #include·<sndio.h>
66 \xd 
67 #elif·(defined·(sun)·&&·defined·(unix)).57 #elif·(defined·(sun)·&&·defined·(unix))
68 »       #include·<fcntl.h>.58 »       #include·<fcntl.h>
69 »       #include·<sys/ioctl.h>.59 »       #include·<sys/ioctl.h>
70 »       #include·<sys/audioio.h>.60 »       #include·<sys/audioio.h>
71 \xd 
72 #elif·(OS_IS_WIN32·==·1).61 #elif·(OS_IS_WIN32·==·1)
73 »       #include·<windows.h>.62 »       #include·<windows.h>
74 »       #include·<mmsystem.h>.63 »       #include·<mmsystem.h>
75 \xd 
76 #endif.64 #endif
77 \xd 
78 #define»SIGNED_SIZEOF(x)»((int)·sizeof·(x)).65 #define»SIGNED_SIZEOF(x)»((int)·sizeof·(x))
79 #define»BUFFER_LEN»      »      »      (2048).66 #define»BUFFER_LEN»      »      »      (2048)
80 \xd 
81 /*------------------------------------------------------------------------------.67 /*------------------------------------------------------------------------------
82 **»     Linux/OSS·functions·for·playing·a·sound..68 **»     Linux/OSS·functions·for·playing·a·sound.
83 */.69 */
84 \xd 
85 #if·HAVE_ALSA_ASOUNDLIB_H.70 #if·HAVE_ALSA_ASOUNDLIB_H
86 \xd 
87 static·snd_pcm_t·*·alsa_open·(int·channels,·unsigned·srate,·int·realtime)·;.71 static·snd_pcm_t·*·alsa_open·(int·channels,·unsigned·srate,·int·realtime)·;
88 static·int·alsa_write_float·(snd_pcm_t·*alsa_dev,·float·*data,·int·frames,·int·channels)·;.72 static·int·alsa_write_float·(snd_pcm_t·*alsa_dev,·float·*data,·int·frames,·int·channels)·;
89 \xd 
90 static·void.73 static·void
91 alsa_play·(int·argc,·char·*argv·[]).74 alsa_play·(int·argc,·char·*argv·[])
92 {»      static·float·buffer·[BUFFER_LEN]·;.75 {»      static·float·buffer·[BUFFER_LEN]·;
93 »       SNDFILE·*sndfile·;.76 »       SNDFILE·*sndfile·;
94 »       SF_INFO·sfinfo·;.77 »       SF_INFO·sfinfo·;
95 »       snd_pcm_t·*·alsa_dev·;.78 »       snd_pcm_t·*·alsa_dev·;
96 »       int»    »    k,·readcount,·subformat·;.79 »       int»    »    k,·readcount,·subformat·;
97 \xd 
98 »       for·(k·=·1·;·k·<·argc·;·k++).80 »       for·(k·=·1·;·k·<·argc·;·k++)
99 »       {»      memset·(&sfinfo,·0,·sizeof·(sfinfo))·;.81 »       {»      memset·(&sfinfo,·0,·sizeof·(sfinfo))·;
100 \xd 
101 »       »       printf·("Playing·%s\n",·argv·[k])·;.82 »       »       printf·("Playing·%s\n",·argv·[k])·;
102 »       »       if·(!·(sndfile·=·sf_open·(argv·[k],·SFM_READ,·&sfinfo))).83 »       »       if·(!·(sndfile·=·sf_open·(argv·[k],·SFM_READ,·&sfinfo)))
103 »       »       {»      puts·(sf_strerror·(NULL))·;.84 »       »       {»      puts·(sf_strerror·(NULL))·;
104 »       »       »       continue·;.85 »       »       »       continue·;
105 »       »       »       }·;.86 »       »       »       }·;
106 \xd 
107 »       »       if·(sfinfo.channels·<·1·||·sfinfo.channels·>·2).87 »       »       if·(sfinfo.channels·<·1·||·sfinfo.channels·>·2)
108 »       »       {»      printf·("Error·:·channels·=·%d.\n",·sfinfo.channels)·;.88 »       »       {»      printf·("Error·:·channels·=·%d.\n",·sfinfo.channels)·;
109 »       »       »       continue·;.89 »       »       »       continue·;
110 »       »       »       }·;.90 »       »       »       }·;
111 \xd 
112 »       »       if·((alsa_dev·=·alsa_open·(sfinfo.channels,·(unsigned)·sfinfo.samplerate,·SF_FALSE))·==·NULL).91 »       »       if·((alsa_dev·=·alsa_open·(sfinfo.channels,·(unsigned)·sfinfo.samplerate,·SF_FALSE))·==·NULL)
113 »       »       »       continue·;.92 »       »       »       continue·;
114 \xd 
115 »       »       subformat·=·sfinfo.format·&·SF_FORMAT_SUBMASK·;.93 »       »       subformat·=·sfinfo.format·&·SF_FORMAT_SUBMASK·;
116 \xd 
117 »       »       if·(subformat·==·SF_FORMAT_FLOAT·||·subformat·==·SF_FORMAT_DOUBLE).94 »       »       if·(subformat·==·SF_FORMAT_FLOAT·||·subformat·==·SF_FORMAT_DOUBLE)
118 »       »       {»      double»scale·;.95 »       »       {»      double»scale·;
119 »       »       »       int·»    m·;.96 »       »       »       int·»    m·;
120 \xd 
121 »       »       »       sf_command·(sndfile,·SFC_CALC_SIGNAL_MAX,·&scale,·sizeof·(scale))·;.97 »       »       »       sf_command·(sndfile,·SFC_CALC_SIGNAL_MAX,·&scale,·sizeof·(scale))·;
122 »       »       »       if·(scale·>·1.0).98 »       »       »       if·(scale·>·1.0)
123 »       »       »       »       scale·=·1.0·/·scale·;.99 »       »       »       »       scale·=·1.0·/·scale·;
124 »       »       »       else.100 »       »       »       else
125 »       »       »       »       scale·=·1.0·;.101 »       »       »       »       scale·=·1.0·;
126 \xd 
127 »       »       »       while·((readcount·=·sf_read_float·(sndfile,·buffer,·BUFFER_LEN))).102 »       »       »       while·((readcount·=·sf_read_float·(sndfile,·buffer,·BUFFER_LEN)))
Max diff block lines reached; -1/50988 bytes (-0.00%) of diff not shown.
5.98 KB
libsndfile-1.0.30/regtest/checksum.c
    
Offset 1, 117 lines modifiedOffset 1, 117 lines modified
1 /*.1 /*
2 **»     Copyright·(C)·2005-2011·Erik·de·Castro·Lopo.2 **»     Copyright·(C)·2005-2011·Erik·de·Castro·Lopo
3 **.3 **
4 **»     This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **»     This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **»     it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **»     it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **»     the·Free·Software·Foundation;·either·version·2·of·the·License,·or.6 **»     the·Free·Software·Foundation;·either·version·2·of·the·License,·or
7 **»     (at·your·option)·any·later·version..7 **»     (at·your·option)·any·later·version.
8 **.8 **
9 **»     This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **»     This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **»     but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **»     but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **»     MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **»     MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **»     GNU·General·Public·License·for·more·details..12 **»     GNU·General·Public·License·for·more·details.
13 **.13 **
14 **»     You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **»     You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **»     along·with·this·program;·if·not,·write·to·the·Free·Software.15 **»     along·with·this·program;·if·not,·write·to·the·Free·Software
16 **»     Foundation,·Inc.,·675·Mass·Ave,·Cambridge,·MA·02139,·USA..16 **»     Foundation,·Inc.,·675·Mass·Ave,·Cambridge,·MA·02139,·USA.
17 */.17 */
18 \xd 
19 /*.18 /*
20 **»     A·simple·checksum·for·short,·int·and·float·data..19 **»     A·simple·checksum·for·short,·int·and·float·data.
21 */.20 */
22 \xd 
23 #include·"sfconfig.h".21 #include·"sfconfig.h"
24 \xd 
25 #include·<stdio.h>.22 #include·<stdio.h>
26 #include·<stdlib.h>.23 #include·<stdlib.h>
27 #include·<string.h>.24 #include·<string.h>
28 #include·<math.h>.25 #include·<math.h>
29 \xd 
30 #include·<sndfile.h>.26 #include·<sndfile.h>
31 \xd 
32 #include·"regtest.h".27 #include·"regtest.h"
33 \xd 
34 #define»BIG_PRIME»       »       999983.28 #define»BIG_PRIME»       »       999983
35 \xd 
36 #define»ARRAY_LEN(x)»    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0]))).29 #define»ARRAY_LEN(x)»    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0])))
37 \xd 
38 static·int·short_checksum·(SNDFILE·*·file,·int·start)·;.30 static·int·short_checksum·(SNDFILE·*·file,·int·start)·;
39 static·int·int_checksum·(SNDFILE·*·file,·int·start)·;.31 static·int·int_checksum·(SNDFILE·*·file,·int·start)·;
40 static·int·float_checksum·(SNDFILE·*·file,·int·start)·;.32 static·int·float_checksum·(SNDFILE·*·file,·int·start)·;
41 \xd 
42 int.33 int
43 calc_checksum·(SNDFILE·*·file,·const·SF_INFO·*·info).34 calc_checksum·(SNDFILE·*·file,·const·SF_INFO·*·info)
44 {»      int·start·;.35 {»      int·start·;
45 \xd 
46 »       /*·Seed·the·checksum·with·data·from·the·SF_INFO·struct.·*/.36 »       /*·Seed·the·checksum·with·data·from·the·SF_INFO·struct.·*/
47 »       start·=·info->samplerate·;.37 »       start·=·info->samplerate·;
48 »       start·=·start·*·BIG_PRIME·+·info->channels·;.38 »       start·=·start·*·BIG_PRIME·+·info->channels·;
49 »       start·=·start·*·BIG_PRIME·+·info->format·;.39 »       start·=·start·*·BIG_PRIME·+·info->format·;
50 \xd 
51 »       switch·(info->format·&·SF_FORMAT_SUBMASK).40 »       switch·(info->format·&·SF_FORMAT_SUBMASK)
52 »       {»      case·SF_FORMAT_FLOAT·:.41 »       {»      case·SF_FORMAT_FLOAT·:
53 »       »       case·SF_FORMAT_DOUBLE·:.42 »       »       case·SF_FORMAT_DOUBLE·:
54 »       »       »       return·float_checksum·(file,·start)·;.43 »       »       »       return·float_checksum·(file,·start)·;
55 \xd 
56 »       »       case·SF_FORMAT_PCM_24·:.44 »       »       case·SF_FORMAT_PCM_24·:
57 »       »       case·SF_FORMAT_PCM_32·:.45 »       »       case·SF_FORMAT_PCM_32·:
58 »       »       »       return·int_checksum·(file,·start)·;.46 »       »       »       return·int_checksum·(file,·start)·;
59 \xd 
60 »       »       default·:.47 »       »       default·:
61 »       »       »       return·short_checksum·(file,·start)·;.48 »       »       »       return·short_checksum·(file,·start)·;
62 »       »       }·;.49 »       »       }·;
63 \xd 
64 »       return·0·;.50 »       return·0·;
65 }·/*·calc_checksum·*/.51 }·/*·calc_checksum·*/
66 \xd 
67 /*------------------------------------------------------------------------------.52 /*------------------------------------------------------------------------------
68 */.53 */
69 \xd 
70 static·union.54 static·union
71 {»      short» s·[1·<<·16]·;.55 {»      short» s·[1·<<·16]·;
72 »       int»    »    i·[1·<<·15]·;.56 »       int»    »    i·[1·<<·15]·;
73 »       float»  f·[1·<<·15]·;.57 »       float»  f·[1·<<·15]·;
74 }·data·;.58 }·data·;
75 \xd 
76 static·int.59 static·int
77 short_checksum·(SNDFILE·*·file,·int·start).60 short_checksum·(SNDFILE·*·file,·int·start)
78 {»      int·k,·count·;.61 {»      int·k,·count·;
79 \xd 
80 »       do.62 »       do
81 »       {»      count·=·(int)·sf_read_short·(file,·data.s,·ARRAY_LEN·(data.s))·;.63 »       {»      count·=·(int)·sf_read_short·(file,·data.s,·ARRAY_LEN·(data.s))·;
82 »       »       for·(k·=·0·;·k·<·count·;·k++).64 »       »       for·(k·=·0·;·k·<·count·;·k++)
83 »       »       »       start·=·start·*·BIG_PRIME·+·data.s·[k]·;.65 »       »       »       start·=·start·*·BIG_PRIME·+·data.s·[k]·;
84 »       »       }.66 »       »       }
85 »       while·(count·>·0)·;.67 »       while·(count·>·0)·;
86 \xd 
87 »       return·start·;.68 »       return·start·;
88 }·/*·short_checksum·*/.69 }·/*·short_checksum·*/
89 \xd 
90 static·int.70 static·int
91 int_checksum·(SNDFILE·*·file,·int·start).71 int_checksum·(SNDFILE·*·file,·int·start)
92 {»      int·k,·count·;.72 {»      int·k,·count·;
93 \xd 
94 »       do.73 »       do
95 »       {»      count·=·(int)·sf_read_int·(file,·data.i,·ARRAY_LEN·(data.i))·;.74 »       {»      count·=·(int)·sf_read_int·(file,·data.i,·ARRAY_LEN·(data.i))·;
96 »       »       for·(k·=·0·;·k·<·count·;·k++).75 »       »       for·(k·=·0·;·k·<·count·;·k++)
97 »       »       »       start·=·start·*·BIG_PRIME·+·data.i·[k]·;.76 »       »       »       start·=·start·*·BIG_PRIME·+·data.i·[k]·;
98 »       »       }.77 »       »       }
99 »       while·(count·>·0)·;.78 »       while·(count·>·0)·;
100 \xd 
101 »       return·start·;.79 »       return·start·;
102 }·/*·int_checksum·*/.80 }·/*·int_checksum·*/
103 \xd 
104 static·int.81 static·int
105 float_checksum·(SNDFILE·*·file,·int·start).82 float_checksum·(SNDFILE·*·file,·int·start)
106 {»      int·k,·count·;.83 {»      int·k,·count·;
107 \xd 
108 »       do.84 »       do
109 »       {»      count·=·(int)·sf_read_float·(file,·data.f,·ARRAY_LEN·(data.f))·;.85 »       {»      count·=·(int)·sf_read_float·(file,·data.f,·ARRAY_LEN·(data.f))·;
110 »       »       for·(k·=·0·;·k·<·count·;·k++).86 »       »       for·(k·=·0·;·k·<·count·;·k++)
111 »       »       »       start·=·start·*·BIG_PRIME·+·lrintf·(2147483648.0f·*·data.f·[k])·;.87 »       »       »       start·=·start·*·BIG_PRIME·+·lrintf·(2147483648.0f·*·data.f·[k])·;
112 »       »       }.88 »       »       }
113 »       while·(count·>·0)·;.89 »       while·(count·>·0)·;
114 \xd 
115 »       return·start·;.90 »       return·start·;
116 }·/*·float_checksum·*/.91 }·/*·float_checksum·*/
117 \xd 
28.4 KB
libsndfile-1.0.30/regtest/database.c
    
Offset 1, 542 lines modifiedOffset 1, 542 lines modified
1 /*.1 /*
2 **»     Copyright·(C)·2005-2011·Erik·de·Castro·Lopo.2 **»     Copyright·(C)·2005-2011·Erik·de·Castro·Lopo
3 **.3 **
4 **»     This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **»     This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **»     it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **»     it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **»     the·Free·Software·Foundation;·either·version·2·of·the·License,·or.6 **»     the·Free·Software·Foundation;·either·version·2·of·the·License,·or
7 **»     (at·your·option)·any·later·version..7 **»     (at·your·option)·any·later·version.
8 **.8 **
9 **»     This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **»     This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **»     but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **»     but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **»     MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **»     MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **»     GNU·General·Public·License·for·more·details..12 **»     GNU·General·Public·License·for·more·details.
13 **.13 **
14 **»     You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **»     You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **»     along·with·this·program;·if·not,·write·to·the·Free·Software.15 **»     along·with·this·program;·if·not,·write·to·the·Free·Software
16 **»     Foundation,·Inc.,·675·Mass·Ave,·Cambridge,·MA·02139,·USA..16 **»     Foundation,·Inc.,·675·Mass·Ave,·Cambridge,·MA·02139,·USA.
17 */.17 */
18 \xd 
19 #include·"config.h".18 #include·"config.h"
20 \xd 
21 #include·<stdio.h>.19 #include·<stdio.h>
22 #include·<stdlib.h>.20 #include·<stdlib.h>
23 #if·HAVE_UNISTD_H.21 #if·HAVE_UNISTD_H
24 #include·<unistd.h>.22 #include·<unistd.h>
25 #else.23 #else
26 #include·"sf_unistd.h".24 #include·"sf_unistd.h"
27 #endif.25 #endif
28 #include·<string.h>.26 #include·<string.h>
29 #include·<fcntl.h>.27 #include·<fcntl.h>
30 #ifdef·HAVE_DIRECT_H.28 #ifdef·HAVE_DIRECT_H
31 #include·<direct.h>.29 #include·<direct.h>
32 #endif.30 #endif
33 #include·<sys/stat.h>.31 #include·<sys/stat.h>
34 \xd 
35 #include·<sndfile.h>.32 #include·<sndfile.h>
36 \xd 
37 #include·"regtest.h".33 #include·"regtest.h"
38 \xd 
39 #if·HAVE_SQLITE3.34 #if·HAVE_SQLITE3
40 \xd 
41 #include·<ctype.h>.35 #include·<ctype.h>
42 #include·<sqlite3.h>.36 #include·<sqlite3.h>
43 \xd 
44 typedef·struct.37 typedef·struct
45 {»      sqlite3·*sql·;.38 {»      sqlite3·*sql·;
46 \xd 
47 »       int·count·;.39 »       int·count·;
48 »       int·ekey_max·;.40 »       int·ekey_max·;
49 \xd 
50 »       /*·Filename·and·pathname·for·file.·*/.41 »       /*·Filename·and·pathname·for·file.·*/
51 »       char·filename·[256]·;.42 »       char·filename·[256]·;
52 »       char·pathname·[512]·;.43 »       char·pathname·[512]·;
53 \xd 
54 »       /*·Storage·for·createding·SQL·commands.·Must·be·larger·than·logbuf·below.·*/.44 »       /*·Storage·for·createding·SQL·commands.·Must·be·larger·than·logbuf·below.·*/
55 »       char·cmdbuf·[1·<<·15]·;.45 »       char·cmdbuf·[1·<<·15]·;
56 \xd 
57 »       /*·Storage·for·log·buffer·retrieved·from·SNDFILE*·.*/.46 »       /*·Storage·for·log·buffer·retrieved·from·SNDFILE*·.*/
58 »       char·logbuf·[1·<<·14]·;.47 »       char·logbuf·[1·<<·14]·;
59 \xd 
60 }·REGTEST_DB·;.48 }·REGTEST_DB·;
61 \xd 
62 /*·In·checksum.c·*/.49 /*·In·checksum.c·*/
63 int·calc_checksum·(SNDFILE·*·file,·const·SF_INFO·*·info)·;.50 int·calc_checksum·(SNDFILE·*·file,·const·SF_INFO·*·info)·;
64 \xd 
65 static·void·get_filename_pathname·(REGTEST_DB·*·db,·const·char·*filepath)·;.51 static·void·get_filename_pathname·(REGTEST_DB·*·db,·const·char·*filepath)·;
66 static·void·single_quote_replace·(char·*·buf)·;.52 static·void·single_quote_replace·(char·*·buf)·;
67 \xd 
68 static·int·get_ekey_from_filename·(REGTEST_DB·*·db,·const·char·*filepath)·;.53 static·int·get_ekey_from_filename·(REGTEST_DB·*·db,·const·char·*filepath)·;
69 static·int·get_filename_pathname_by_ekey·(REGTEST_DB·*·db,·int·ekey)·;.54 static·int·get_filename_pathname_by_ekey·(REGTEST_DB·*·db,·int·ekey)·;
70 static·int·check_file_by_ekey·(REGTEST_DB·*·db,·int·ekey)·;.55 static·int·check_file_by_ekey·(REGTEST_DB·*·db,·int·ekey)·;
71 \xd 
72 static·int·count_callback·(REGTEST_DB·*·db,·int·argc,·char·**argv,·char·**colname)·;.56 static·int·count_callback·(REGTEST_DB·*·db,·int·argc,·char·**argv,·char·**colname)·;
73 static·int·ekey_max_callback·(REGTEST_DB·*·db,·int·argc,·char·**argv,·char·**colname)·;.57 static·int·ekey_max_callback·(REGTEST_DB·*·db,·int·argc,·char·**argv,·char·**colname)·;
74 static·int·callback·(void·*unused,·int·argc,·char·**argv,·char·**colname)·;.58 static·int·callback·(void·*unused,·int·argc,·char·**argv,·char·**colname)·;
75 static·const·char·*db_basename·(const·char·*fname);.59 static·const·char·*db_basename·(const·char·*fname);
76 \xd 
77 /*·Windows·accepts·both·'\\'·and·'/'·in·paths·*/.60 /*·Windows·accepts·both·'\\'·and·'/'·in·paths·*/
78 #ifdef·_WIN32.61 #ifdef·_WIN32
79 ··#define·IS_SLASH(c)»     »     »     ((c)·==·'\\'·||·(c)·==·'/').62 ··#define·IS_SLASH(c)»     »     »     ((c)·==·'\\'·||·(c)·==·'/')
80 ··#define·HAS_DRIVELETTER(path)»   (isalpha·((int)(path[0]))·&&·path[1]·==·':'·&&·IS_SLASH(path[2])).63 ··#define·HAS_DRIVELETTER(path)»   (isalpha·((int)(path[0]))·&&·path[1]·==·':'·&&·IS_SLASH(path[2]))
81 #else.64 #else
82 ··#define·IS_SLASH(c)»     »     »     ((c)·==·'/').65 ··#define·IS_SLASH(c)»     »     »     ((c)·==·'/')
83 ··#define·HAS_DRIVELETTER(path)»   0.66 ··#define·HAS_DRIVELETTER(path)»   0
84 #endif.67 #endif
85 \xd 
86 REG_DB·*.68 REG_DB·*
87 db_open·(const·char·*·db_name).69 db_open·(const·char·*·db_name)
88 {»      REGTEST_DB·*·db·;.70 {»      REGTEST_DB·*·db·;
89 »       int·err·;.71 »       int·err·;
90 \xd 
91 »       if·((db·=·malloc·(sizeof·(REGTEST_DB)))·==·NULL).72 »       if·((db·=·malloc·(sizeof·(REGTEST_DB)))·==·NULL)
92 »       {»      perror·("malloc")·;.73 »       {»      perror·("malloc")·;
93 »       »       exit·(1)·;.74 »       »       exit·(1)·;
94 »       »       }·;.75 »       »       }·;
95 \xd 
96 »       if·((err·=·sqlite3_open·(db_name,·&(db->sql)))·!=·0).76 »       if·((err·=·sqlite3_open·(db_name,·&(db->sql)))·!=·0)
97 »       {»      printf·("Can't·open·database:·%s\n",·sqlite3_errmsg·(db->sql))·;.77 »       {»      printf·("Can't·open·database:·%s\n",·sqlite3_errmsg·(db->sql))·;
98 ········sqlite3_close·(db->sql)·;.78 ········sqlite3_close·(db->sql)·;
99 »       »       free·(db)·;.79 »       »       free·(db)·;
100 »       »       exit·(1)·;.80 »       »       exit·(1)·;
101 »       »       }·;.81 »       »       }·;
102 \xd 
103 »       return·(REG_DB·*)·db·;.82 »       return·(REG_DB·*)·db·;
104 }·/*·db_open·*/.83 }·/*·db_open·*/
105 \xd 
106 int.84 int
107 db_create·(const·char·*·db_name).85 db_create·(const·char·*·db_name)
108 {»      REGTEST_DB·*·db·;.86 {»      REGTEST_DB·*·db·;
109 »       const·char·*cmd·;.87 »       const·char·*cmd·;
110 »       char·*·errmsg·=·NULL·;.88 »       char·*·errmsg·=·NULL·;
111 »       int·err·;.89 »       int·err·;
112 \xd 
113 »       db·=·(REGTEST_DB·*)·db_open·(db_name)·;.90 »       db·=·(REGTEST_DB·*)·db_open·(db_name)·;
114 \xd 
115 »       cmd·=·"create·table·sndfile·(ekey·INTEGER·PRIMARY·KEY,".91 »       cmd·=·"create·table·sndfile·(ekey·INTEGER·PRIMARY·KEY,"
116 »       »       »       "fname·VARCHAR(1),".92 »       »       »       "fname·VARCHAR(1),"
117 »       »       »       "fpath·VARCHAR(1),".93 »       »       »       "fpath·VARCHAR(1),"
118 »       »       »       "srate·INTEGER,".94 »       »       »       "srate·INTEGER,"
119 »       »       »       "frames·VARCHAR(1),".95 »       »       »       "frames·VARCHAR(1),"
120 »       »       »       "channels·INTEGER,".96 »       »       »       "channels·INTEGER,"
121 »       »       »       "format·VARCHAR(1),".97 »       »       »       "format·VARCHAR(1),"
122 »       »       »       "checksum·VARCHAR(1),".98 »       »       »       "checksum·VARCHAR(1),"
123 »       »       »       "logbuf·VARCHAR(1)".99 »       »       »       "logbuf·VARCHAR(1)"
124 »       »       »       ");"·;.100 »       »       »       ");"·;
125 \xd 
126 »       err·=·sqlite3_exec·(db->sql,·cmd,·callback,·0,·&errmsg)·;.101 »       err·=·sqlite3_exec·(db->sql,·cmd,·callback,·0,·&errmsg)·;
127 »       if·(err·!=·SQLITE_OK).102 »       if·(err·!=·SQLITE_OK)
Max diff block lines reached; -1/29008 bytes (-0.00%) of diff not shown.
15.2 KB
libsndfile-1.0.30/src/avr.c
    
Offset 1, 246 lines modifiedOffset 1, 246 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2004-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2004-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include·"sfconfig.h".18 #include·"sfconfig.h"
20 \xd 
21 #include·<stdio.h>.19 #include·<stdio.h>
22 #include·<string.h>.20 #include·<string.h>
23 \xd 
24 #include·"sndfile.h".21 #include·"sndfile.h"
25 #include·"sfendian.h".22 #include·"sfendian.h"
26 #include·"common.h".23 #include·"common.h"
27 \xd 
28 #define·TWOBIT_MARKER»   (MAKE_MARKER·('2',·'B',·'I',·'T')).24 #define·TWOBIT_MARKER»   (MAKE_MARKER·('2',·'B',·'I',·'T'))
29 #define»AVR_HDR_SIZE»    128.25 #define»AVR_HDR_SIZE»    128
30 \xd 
31 #define»SFE_AVR_X»       666.26 #define»SFE_AVR_X»       666
32 \xd 
33 /*.27 /*
34 **·From:·hyc@hanauma.Jpl.Nasa.Gov·(Howard·Chu).28 **·From:·hyc@hanauma.Jpl.Nasa.Gov·(Howard·Chu)
35 **.29 **
36 **·A·lot·of·PD·software·exists·to·play·Mac·.snd·files·on·the·ST.·One·other.30 **·A·lot·of·PD·software·exists·to·play·Mac·.snd·files·on·the·ST.·One·other
37 **·format·that·seems·pretty·popular·(used·by·a·number·of·commercial·packages).31 **·format·that·seems·pretty·popular·(used·by·a·number·of·commercial·packages)
38 **·is·the·AVR·format·(from·Audio·Visual·Research).·This·format·has·a·128·byte.32 **·is·the·AVR·format·(from·Audio·Visual·Research).·This·format·has·a·128·byte
39 **·header·that·looks·like·this·(its·actually·packed,·but·thats·not·portable):.33 **·header·that·looks·like·this·(its·actually·packed,·but·thats·not·portable):
40 */.34 */
41 \xd 
42 typedef·struct.35 typedef·struct
43 {»      int»   »   marker·;»    /*·2BIT·*/.36 {»      int»   »   marker·;»    /*·2BIT·*/
44 »       char»   name·[8]·;»   /*·null-padded·sample·name·*/.37 »       char»   name·[8]·;»   /*·null-padded·sample·name·*/
45 »       short»  mono·;»     »     /*·0·=·mono,·0xffff·=·stereo·*/.38 »       short»  mono·;»     »     /*·0·=·mono,·0xffff·=·stereo·*/
46 »       short»  rez·;»      »      /*·8·=·8·bit,·16·=·16·bit·*/.39 »       short»  rez·;»      »      /*·8·=·8·bit,·16·=·16·bit·*/
47 »       short»  sign·;»     »     /*·0·=·unsigned,·0xffff·=·signed·*/.40 »       short»  sign·;»     »     /*·0·=·unsigned,·0xffff·=·signed·*/
48 \xd 
49 »       short»  loop·;»     »     /*·0·=·no·loop,·0xffff·=·looping·sample·*/.41 »       short»  loop·;»     »     /*·0·=·no·loop,·0xffff·=·looping·sample·*/
50 »       short»  midi·;»     »     /*·0xffff·=·no·MIDI·note·assigned,··*/.42 »       short»  midi·;»     »     /*·0xffff·=·no·MIDI·note·assigned,··*/
51 »       »       »       »       »       »       /*»     0xffXX·=·single·key·note·assignment·*/.43 »       »       »       »       »       »       /*»     0xffXX·=·single·key·note·assignment·*/
52 »       »       »       »       »       »       /*»     0xLLHH·=·key·split,·low/hi·note·*/.44 »       »       »       »       »       »       /*»     0xLLHH·=·key·split,·low/hi·note·*/
53 »       int»    »    srate·;»      »      /*·sample·frequency·in·hertz·*/.45 »       int»    »    srate·;»      »      /*·sample·frequency·in·hertz·*/
54 »       int»    »    frames·;»     /*·sample·length·in·bytes·or·words·(see·rez)·*/.46 »       int»    »    frames·;»     /*·sample·length·in·bytes·or·words·(see·rez)·*/
55 »       int»    »    lbeg·;»       »       /*·offset·to·start·of·loop·in·bytes·or·words.·*/.47 »       int»    »    lbeg·;»       »       /*·offset·to·start·of·loop·in·bytes·or·words.·*/
56 »       »       »       »       »       »       /*·set·to·zero·if·unused·*/.48 »       »       »       »       »       »       /*·set·to·zero·if·unused·*/
57 »       int»    »    lend·;»       »       /*·offset·to·end·of·loop·in·bytes·or·words.·*/.49 »       int»    »    lend·;»       »       /*·offset·to·end·of·loop·in·bytes·or·words.·*/
58 »       »       »       »       »       »       /*·set·to·sample·length·if·unused·*/.50 »       »       »       »       »       »       /*·set·to·sample·length·if·unused·*/
59 »       short»  res1·;»     »     /*·Reserved,·MIDI·keyboard·split·*/.51 »       short»  res1·;»     »     /*·Reserved,·MIDI·keyboard·split·*/
60 »       short»  res2·;»     »     /*·Reserved,·sample·compression·*/.52 »       short»  res2·;»     »     /*·Reserved,·sample·compression·*/
61 »       short»  res3·;»     »     /*·Reserved·*/.53 »       short»  res3·;»     »     /*·Reserved·*/
62 »       char»   ext·[20]·;»   /*·Additional·filename·space,·used·if·(name[7]·!=·0)·*/.54 »       char»   ext·[20]·;»   /*·Additional·filename·space,·used·if·(name[7]·!=·0)·*/
63 »       char»   user·[64]·;·/*·User·defined.·Typically·ASCII·message·*/.55 »       char»   user·[64]·;·/*·User·defined.·Typically·ASCII·message·*/
64 }·AVR_HEADER·;.56 }·AVR_HEADER·;
65 \xd 
66 /*------------------------------------------------------------------------------.57 /*------------------------------------------------------------------------------
67 **·Private·static·functions..58 **·Private·static·functions.
68 */.59 */
69 \xd 
70 static·int»      »      avr_close·(SF_PRIVATE·*psf)·;.60 static·int»      »      avr_close·(SF_PRIVATE·*psf)·;
71 \xd 
72 static·int»      »      avr_read_header·(SF_PRIVATE·*psf)·;.61 static·int»      »      avr_read_header·(SF_PRIVATE·*psf)·;
73 static·int»      »      avr_write_header·(SF_PRIVATE·*psf,·int·calc_length)·;.62 static·int»      »      avr_write_header·(SF_PRIVATE·*psf,·int·calc_length)·;
74 \xd 
75 /*------------------------------------------------------------------------------.63 /*------------------------------------------------------------------------------
76 **·Public·function..64 **·Public·function.
77 */.65 */
78 \xd 
79 int.66 int
80 avr_open»       (SF_PRIVATE·*psf).67 avr_open»       (SF_PRIVATE·*psf)
81 {»      int»   »   error·=·0·;.68 {»      int»   »   error·=·0·;
82 \xd 
83 »       if·(psf->file.mode·==·SFM_READ·||·(psf->file.mode·==·SFM_RDWR·&&·psf->filelength·>·0)).69 »       if·(psf->file.mode·==·SFM_READ·||·(psf->file.mode·==·SFM_RDWR·&&·psf->filelength·>·0))
84 »       {»      if·((error·=·avr_read_header·(psf))).70 »       {»      if·((error·=·avr_read_header·(psf)))
85 »       »       »       return·error·;.71 »       »       »       return·error·;
86 »       »       }·;.72 »       »       }·;
87 \xd 
88 »       if·((SF_CONTAINER·(psf->sf.format))·!=·SF_FORMAT_AVR).73 »       if·((SF_CONTAINER·(psf->sf.format))·!=·SF_FORMAT_AVR)
89 »       »       return» SFE_BAD_OPEN_FORMAT·;.74 »       »       return» SFE_BAD_OPEN_FORMAT·;
90 \xd 
91 »       if·(psf->file.mode·==·SFM_WRITE·||·psf->file.mode·==·SFM_RDWR).75 »       if·(psf->file.mode·==·SFM_WRITE·||·psf->file.mode·==·SFM_RDWR)
92 »       {»      psf->endian·=·SF_ENDIAN_BIG·;.76 »       {»      psf->endian·=·SF_ENDIAN_BIG·;
93 \xd 
94 »       »       if·(avr_write_header·(psf,·SF_FALSE)).77 »       »       if·(avr_write_header·(psf,·SF_FALSE))
95 »       »       »       return·psf->error·;.78 »       »       »       return·psf->error·;
96 \xd 
97 »       »       psf->write_header·=·avr_write_header·;.79 »       »       psf->write_header·=·avr_write_header·;
98 »       »       }·;.80 »       »       }·;
99 \xd 
100 »       psf->container_close·=·avr_close·;.81 »       psf->container_close·=·avr_close·;
101 \xd 
102 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;.82 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;
103 \xd 
104 »       error·=·pcm_init·(psf)·;.83 »       error·=·pcm_init·(psf)·;
105 \xd 
106 »       return·error·;.84 »       return·error·;
107 }·/*·avr_open·*/.85 }·/*·avr_open·*/
108 \xd 
109 static·int.86 static·int
110 avr_read_header·(SF_PRIVATE·*psf).87 avr_read_header·(SF_PRIVATE·*psf)
111 {»      AVR_HEADER»    hdr·;.88 {»      AVR_HEADER»    hdr·;
112 \xd 
113 »       memset·(&hdr,·0,·sizeof·(hdr))·;.89 »       memset·(&hdr,·0,·sizeof·(hdr))·;
114 \xd 
115 »       psf_binheader_readf·(psf,·"pmb",·0,·&hdr.marker,·&hdr.name,·sizeof·(hdr.name))·;.90 »       psf_binheader_readf·(psf,·"pmb",·0,·&hdr.marker,·&hdr.name,·sizeof·(hdr.name))·;
116 »       psf_log_printf·(psf,·"%M\n",·hdr.marker)·;.91 »       psf_log_printf·(psf,·"%M\n",·hdr.marker)·;
117 \xd 
118 »       if·(hdr.marker·!=·TWOBIT_MARKER).92 »       if·(hdr.marker·!=·TWOBIT_MARKER)
119 »       »       return·SFE_AVR_X·;.93 »       »       return·SFE_AVR_X·;
120 \xd 
121 »       psf_log_printf·(psf,·"··Name········:·%s\n",·hdr.name)·;.94 »       psf_log_printf·(psf,·"··Name········:·%s\n",·hdr.name)·;
122 \xd 
123 »       psf_binheader_readf·(psf,·"E22222",·&hdr.mono,·&hdr.rez,·&hdr.sign,·&hdr.loop,·&hdr.midi)·;.95 »       psf_binheader_readf·(psf,·"E22222",·&hdr.mono,·&hdr.rez,·&hdr.sign,·&hdr.loop,·&hdr.midi)·;
124 \xd 
125 »       psf->sf.channels·=·(hdr.mono·&·1)·+·1·;.96 »       psf->sf.channels·=·(hdr.mono·&·1)·+·1·;
126 \xd 
127 »       psf_log_printf·(psf,·"··Channels····:·%d\n··Bit·width···:·%d\n··Signed······:·%s\n",.97 »       psf_log_printf·(psf,·"··Channels····:·%d\n··Bit·width···:·%d\n··Signed······:·%s\n",
Max diff block lines reached; -1/15512 bytes (-0.01%) of diff not shown.
64.4 KB
libsndfile-1.0.30/src/common.h
    
Offset 1, 1114 lines modifiedOffset 1, 1114 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #ifndef·SNDFILE_COMMON_H.18 #ifndef·SNDFILE_COMMON_H
20 #define·SNDFILE_COMMON_H.19 #define·SNDFILE_COMMON_H
21 \xd 
22 #include·"sfconfig.h".20 #include·"sfconfig.h"
23 \xd 
24 #include·<stdlib.h>.21 #include·<stdlib.h>
25 #include·<string.h>.22 #include·<string.h>
26 \xd 
27 #if·HAVE_INTTYPES_H.23 #if·HAVE_INTTYPES_H
28 #include·<inttypes.h>.24 #include·<inttypes.h>
29 #elif·HAVE_STDINT_H.25 #elif·HAVE_STDINT_H
30 #include·<stdint.h>.26 #include·<stdint.h>
31 #endif.27 #endif
32 #if·HAVE_SYS_TYPES_H.28 #if·HAVE_SYS_TYPES_H
33 #include·<sys/types.h>.29 #include·<sys/types.h>
34 #endif.30 #endif
35 \xd 
36 #ifndef·SNDFILE_H.31 #ifndef·SNDFILE_H
37 #include·"sndfile.h".32 #include·"sndfile.h"
38 #endif.33 #endif
39 \xd 
40 #ifdef·__cplusplus.34 #ifdef·__cplusplus
41 #error·"This·code·is·not·designed·to·be·compiled·with·a·C++·compiler.".35 #error·"This·code·is·not·designed·to·be·compiled·with·a·C++·compiler."
42 #endif.36 #endif
43 \xd 
44 #ifdef·INT64_C.37 #ifdef·INT64_C
45 #»      define»SF_PLATFORM_S64(x)»      »      INT64_C·(x).38 #»      define»SF_PLATFORM_S64(x)»      »      INT64_C·(x)
46 #elif·(SIZEOF_LONG·==·8).39 #elif·(SIZEOF_LONG·==·8)
47 #»      define»SF_PLATFORM_S64(x)»      »      x##l.40 #»      define»SF_PLATFORM_S64(x)»      »      x##l
48 #elif·(SIZEOF_LONG_LONG·==·8).41 #elif·(SIZEOF_LONG_LONG·==·8)
49 #»      define»SF_PLATFORM_S64(x)»      »      x##ll.42 #»      define»SF_PLATFORM_S64(x)»      »      x##ll
50 #elif·COMPILER_IS_GCC.43 #elif·COMPILER_IS_GCC
51 #»      define»SF_PLATFORM_S64(x)»      »      x##ll.44 #»      define»SF_PLATFORM_S64(x)»      »      x##ll
52 #elif·OS_IS_WIN32.45 #elif·OS_IS_WIN32
53 #»      define»SF_PLATFORM_S64(x)»      »      x##I64.46 #»      define»SF_PLATFORM_S64(x)»      »      x##I64
54 #else.47 #else
55 #»      error·"Don't·know·how·to·define·a·64·bit·integer·constant.".48 #»      error·"Don't·know·how·to·define·a·64·bit·integer·constant."
56 #endif.49 #endif
57 \xd 
58 \xd 
59 \xd 
60 /*.50 /*
61 **·Inspiration·:·http://sourcefrog.net/weblog/software/languages/C/unused.html.51 **·Inspiration·:·http://sourcefrog.net/weblog/software/languages/C/unused.html
62 */.52 */
63 #ifdef·UNUSED.53 #ifdef·UNUSED
64 #elif·defined·(__GNUC__).54 #elif·defined·(__GNUC__)
65 #»      define·UNUSED(x)·UNUSED_·##·x·__attribute__·((unused)).55 #»      define·UNUSED(x)·UNUSED_·##·x·__attribute__·((unused))
66 #elif·defined·(__LCLINT__).56 #elif·defined·(__LCLINT__)
67 #»      define·UNUSED(x)·/*@unused@*/·x.57 #»      define·UNUSED(x)·/*@unused@*/·x
68 #else.58 #else
69 #»      define·UNUSED(x)·x.59 #»      define·UNUSED(x)·x
70 #endif.60 #endif
71 \xd 
72 #ifdef·__GNUC__.61 #ifdef·__GNUC__
73 #»      define·WARN_UNUSED»     __attribute__·((warn_unused_result)).62 #»      define·WARN_UNUSED»     __attribute__·((warn_unused_result))
74 #else.63 #else
75 #»      define·WARN_UNUSED.64 #»      define·WARN_UNUSED
76 #endif.65 #endif
77 \xd 
78 #define»SF_BUFFER_LEN»   »   »   (8192).66 #define»SF_BUFFER_LEN»   »   »   (8192)
79 #define»SF_FILENAME_LEN» » » (1024).67 #define»SF_FILENAME_LEN» » » (1024)
80 #define·SF_SYSERR_LEN»   »   »   (256).68 #define·SF_SYSERR_LEN»   »   »   (256)
81 #define·SF_MAX_STRINGS»  »  »  (32).69 #define·SF_MAX_STRINGS»  »  »  (32)
82 #define»SF_PARSELOG_LEN» » » (2048).70 #define»SF_PARSELOG_LEN» » » (2048)
83 \xd 
84 #define»PSF_SEEK_ERROR»  »  »  ((sf_count_t)·-1).71 #define»PSF_SEEK_ERROR»  »  »  ((sf_count_t)·-1)
85 \xd 
86 #define»BITWIDTH2BYTES(x)»       (((x)·+·7)·/·8).72 #define»BITWIDTH2BYTES(x)»       (((x)·+·7)·/·8)
87 \xd 
88 /*»     For·some·reason·sizeof·returns·an·unsigned··value·which·causes.73 /*»     For·some·reason·sizeof·returns·an·unsigned··value·which·causes
89 **»     a·warning·when·that·value·is·added·or·subtracted·from·a·signed.74 **»     a·warning·when·that·value·is·added·or·subtracted·from·a·signed
90 **»     value.·Use·SIGNED_SIZEOF·instead..75 **»     value.·Use·SIGNED_SIZEOF·instead.
91 */.76 */
92 #define»»SIGNED_SIZEOF(x)»((int)·sizeof·(x)).77 #define»»SIGNED_SIZEOF(x)»((int)·sizeof·(x))
93 \xd 
94 #define»»ARRAY_LEN(x)»    ((int)·(sizeof·(x)·/·sizeof·((x)·[0]))).78 #define»»ARRAY_LEN(x)»    ((int)·(sizeof·(x)·/·sizeof·((x)·[0])))
95 \xd 
96 #define»»NOT(x)»  »  »  (!·(x)).79 #define»»NOT(x)»  »  »  (!·(x))
97 \xd 
98 #if·COMPILER_IS_GCC.80 #if·COMPILER_IS_GCC
99 #define»»SF_MAX(x,·y)»     ({·\.81 #define»»SF_MAX(x,·y)»     ({·\
100 »       »       »       »       »       »       »       »       typeof·(x)·sf_max_x1·=·(x)·;·\.82 »       »       »       »       »       »       »       »       typeof·(x)·sf_max_x1·=·(x)·;·\
101 »       »       »       »       »       »       »       »       typeof·(y)·sf_max_y1·=·(y)·;·\.83 »       »       »       »       »       »       »       »       typeof·(y)·sf_max_y1·=·(y)·;·\
102 »       »       »       »       »       »       »       »       (void)·(&sf_max_x1·==·&sf_max_y1)·;·\.84 »       »       »       »       »       »       »       »       (void)·(&sf_max_x1·==·&sf_max_y1)·;·\
103 »       »       »       »       »       »       »       »       sf_max_x1·>·sf_max_y1·?·sf_max_x1·:·sf_max_y1·;·}).85 »       »       »       »       »       »       »       »       sf_max_x1·>·sf_max_y1·?·sf_max_x1·:·sf_max_y1·;·})
104 \xd 
105 #define»»SF_MIN(x,·y)»     ({·\.86 #define»»SF_MIN(x,·y)»     ({·\
106 »       »       »       »       »       »       »       »       typeof·(x)·sf_min_x2·=·(x)·;·\.87 »       »       »       »       »       »       »       »       typeof·(x)·sf_min_x2·=·(x)·;·\
107 »       »       »       »       »       »       »       »       typeof·(y)·sf_min_y2·=·(y)·;·\.88 »       »       »       »       »       »       »       »       typeof·(y)·sf_min_y2·=·(y)·;·\
108 »       »       »       »       »       »       »       »       (void)·(&sf_min_x2·==·&sf_min_y2)·;·\.89 »       »       »       »       »       »       »       »       (void)·(&sf_min_x2·==·&sf_min_y2)·;·\
109 »       »       »       »       »       »       »       »       sf_min_x2·<·sf_min_y2·?·sf_min_x2·:·sf_min_y2·;·}).90 »       »       »       »       »       »       »       »       sf_min_x2·<·sf_min_y2·?·sf_min_x2·:·sf_min_y2·;·})
110 #else.91 #else
111 #define»»SF_MAX(a,·b)»     ((a)·>·(b)·?·(a)·:·(b)).92 #define»»SF_MAX(a,·b)»     ((a)·>·(b)·?·(a)·:·(b))
112 #define»»SF_MIN(a,·b)»     ((a)·<·(b)·?·(a)·:·(b)).93 #define»»SF_MIN(a,·b)»     ((a)·<·(b)·?·(a)·:·(b))
113 #endif.94 #endif
114 \xd 
115 \xd 
116 #define»»COMPILE_TIME_ASSERT(e)»  (sizeof·(struct·{·int·:·-·!!·(e)·;·})).95 #define»»COMPILE_TIME_ASSERT(e)»  (sizeof·(struct·{·int·:·-·!!·(e)·;·}))
117 \xd 
118 \xd 
119 #define»»SF_MAX_CHANNELS» » 1024.96 #define»»SF_MAX_CHANNELS» » 1024
120 \xd 
121 \xd 
122 /*.97 /*
123 *»      Macros·for·spliting·the·format·file·of·SF_INFO·into·container·type,.98 *»      Macros·for·spliting·the·format·file·of·SF_INFO·into·container·type,
124 **»     codec·type·and·endian-ness..99 **»     codec·type·and·endian-ness.
125 */.100 */
126 #define·SF_CONTAINER(x)» » ((x)·&·SF_FORMAT_TYPEMASK).101 #define·SF_CONTAINER(x)» » ((x)·&·SF_FORMAT_TYPEMASK)
127 #define·SF_CODEC(x)»     »     »     ((x)·&·SF_FORMAT_SUBMASK).102 #define·SF_CODEC(x)»     »     »     ((x)·&·SF_FORMAT_SUBMASK)
Max diff block lines reached; -1/65916 bytes (-0.00%) of diff not shown.
17.4 KB
libsndfile-1.0.30/src/config.h.cmake
    
Offset 1, 308 lines modifiedOffset 1, 308 lines modified
1 /*·Set·to·1·if·the·compile·is·GNU·GCC.·*/.1 /*·Set·to·1·if·the·compile·is·GNU·GCC.·*/
2 #cmakedefine01·COMPILER_IS_GCC.2 #cmakedefine01·COMPILER_IS_GCC
3 \xd 
4 /*·Target·processor·clips·on·negative·float·to·int·conversion.·*/.3 /*·Target·processor·clips·on·negative·float·to·int·conversion.·*/
5 #cmakedefine01·CPU_CLIPS_NEGATIVE.4 #cmakedefine01·CPU_CLIPS_NEGATIVE
6 \xd 
7 /*·Target·processor·clips·on·positive·float·to·int·conversion.·*/.5 /*·Target·processor·clips·on·positive·float·to·int·conversion.·*/
8 #cmakedefine01·CPU_CLIPS_POSITIVE.6 #cmakedefine01·CPU_CLIPS_POSITIVE
9 \xd 
10 /*·Target·processor·is·big·endian.·*/.7 /*·Target·processor·is·big·endian.·*/
11 #cmakedefine01·CPU_IS_BIG_ENDIAN.8 #cmakedefine01·CPU_IS_BIG_ENDIAN
12 \xd 
13 /*·Target·processor·is·little·endian.·*/.9 /*·Target·processor·is·little·endian.·*/
14 #cmakedefine01·CPU_IS_LITTLE_ENDIAN.10 #cmakedefine01·CPU_IS_LITTLE_ENDIAN
15 \xd 
16 /*·Set·to·1·to·enable·experimental·code.·*/.11 /*·Set·to·1·to·enable·experimental·code.·*/
17 #cmakedefine01·ENABLE_EXPERIMENTAL_CODE.12 #cmakedefine01·ENABLE_EXPERIMENTAL_CODE
18 \xd 
19 /*·Define·to·1·if·you·have·the·<alsa/asoundlib.h>·header·file.·*/.13 /*·Define·to·1·if·you·have·the·<alsa/asoundlib.h>·header·file.·*/
20 #cmakedefine01·HAVE_ALSA_ASOUNDLIB_H.14 #cmakedefine01·HAVE_ALSA_ASOUNDLIB_H
21 \xd 
22 /*·Define·to·1·if·you·have·the·<byteswap.h>·header·file.·*/.15 /*·Define·to·1·if·you·have·the·<byteswap.h>·header·file.·*/
23 #cmakedefine01·HAVE_BYTESWAP_H.16 #cmakedefine01·HAVE_BYTESWAP_H
24 \xd 
25 /*·Define·to·1·if·you·have·the·`calloc'·function.·*/.17 /*·Define·to·1·if·you·have·the·`calloc'·function.·*/
26 #cmakedefine01·HAVE_CALLOC.18 #cmakedefine01·HAVE_CALLOC
27 \xd 
28 /*·Define·to·1·if·you·have·the·`ceil'·function.·*/.19 /*·Define·to·1·if·you·have·the·`ceil'·function.·*/
29 #cmakedefine01·HAVE_CEIL.20 #cmakedefine01·HAVE_CEIL
30 \xd 
31 /*·Set·to·1·if·S_IRGRP·is·defined.·*/.21 /*·Set·to·1·if·S_IRGRP·is·defined.·*/
32 #cmakedefine01·HAVE_DECL_S_IRGRP.22 #cmakedefine01·HAVE_DECL_S_IRGRP
33 \xd 
34 /*·Define·to·1·if·you·have·the·<dlfcn.h>·header·file.·*/.23 /*·Define·to·1·if·you·have·the·<dlfcn.h>·header·file.·*/
35 #cmakedefine01·HAVE_DLFCN_H.24 #cmakedefine01·HAVE_DLFCN_H
36 \xd 
37 /*·Define·to·1·if·you·have·the·<direct.h>·header·file.·*/.25 /*·Define·to·1·if·you·have·the·<direct.h>·header·file.·*/
38 #cmakedefine·HAVE_DIRECT_H.26 #cmakedefine·HAVE_DIRECT_H
39 \xd 
40 /*·Define·to·1·if·you·have·the·<endian.h>·header·file.·*/.27 /*·Define·to·1·if·you·have·the·<endian.h>·header·file.·*/
41 #cmakedefine01·HAVE_ENDIAN_H.28 #cmakedefine01·HAVE_ENDIAN_H
42 \xd 
43 /*·Will·be·set·to·1·if·flac,·ogg·and·vorbis·are·available.·*/.29 /*·Will·be·set·to·1·if·flac,·ogg·and·vorbis·are·available.·*/
44 #cmakedefine01·HAVE_EXTERNAL_XIPH_LIBS.30 #cmakedefine01·HAVE_EXTERNAL_XIPH_LIBS
45 \xd 
46 /*·Define·to·1·if·you·have·the·`floor'·function.·*/.31 /*·Define·to·1·if·you·have·the·`floor'·function.·*/
47 #cmakedefine01·HAVE_FLOOR.32 #cmakedefine01·HAVE_FLOOR
48 \xd 
49 /*·Define·to·1·if·you·have·the·`fmod'·function.·*/.33 /*·Define·to·1·if·you·have·the·`fmod'·function.·*/
50 #cmakedefine01·HAVE_FMOD.34 #cmakedefine01·HAVE_FMOD
51 \xd 
52 /*·Define·to·1·if·you·have·the·`free'·function.·*/.35 /*·Define·to·1·if·you·have·the·`free'·function.·*/
53 #cmakedefine01·HAVE_FREE.36 #cmakedefine01·HAVE_FREE
54 \xd 
55 /*·Define·to·1·if·you·have·the·`fstat'·function.·*/.37 /*·Define·to·1·if·you·have·the·`fstat'·function.·*/
56 #cmakedefine01·HAVE_FSTAT.38 #cmakedefine01·HAVE_FSTAT
57 \xd 
58 /*·Define·to·1·if·you·have·the·`fstat64'·function.·*/.39 /*·Define·to·1·if·you·have·the·`fstat64'·function.·*/
59 #cmakedefine01·HAVE_FSTAT64.40 #cmakedefine01·HAVE_FSTAT64
60 \xd 
61 /*·Define·to·1·if·you·have·the·`fsync'·function.·*/.41 /*·Define·to·1·if·you·have·the·`fsync'·function.·*/
62 #cmakedefine01·HAVE_FSYNC.42 #cmakedefine01·HAVE_FSYNC
63 \xd 
64 /*·Define·to·1·if·you·have·the·`ftruncate'·function.·*/.43 /*·Define·to·1·if·you·have·the·`ftruncate'·function.·*/
65 #cmakedefine01·HAVE_FTRUNCATE.44 #cmakedefine01·HAVE_FTRUNCATE
66 \xd 
67 /*·Define·to·1·if·you·have·the·`getpagesize'·function.·*/.45 /*·Define·to·1·if·you·have·the·`getpagesize'·function.·*/
68 #cmakedefine01·HAVE_GETPAGESIZE.46 #cmakedefine01·HAVE_GETPAGESIZE
69 \xd 
70 /*·Define·to·1·if·you·have·the·`gettimeofday'·function.·*/.47 /*·Define·to·1·if·you·have·the·`gettimeofday'·function.·*/
71 #cmakedefine01·HAVE_GETTIMEOFDAY.48 #cmakedefine01·HAVE_GETTIMEOFDAY
72 \xd 
73 /*·Define·if·you·have·the·`gmtime'·function.·*/.49 /*·Define·if·you·have·the·`gmtime'·function.·*/
74 #cmakedefine·HAVE_GMTIME.50 #cmakedefine·HAVE_GMTIME
75 \xd 
76 /*·Define·if·you·have·the·`gmtime_r'·function.·*/.51 /*·Define·if·you·have·the·`gmtime_r'·function.·*/
77 #cmakedefine·HAVE_GMTIME_R.52 #cmakedefine·HAVE_GMTIME_R
78 \xd 
79 /*·Define·to·1·if·you·have·the·<inttypes.h>·header·file.·*/.53 /*·Define·to·1·if·you·have·the·<inttypes.h>·header·file.·*/
80 #cmakedefine01·HAVE_INTTYPES_H.54 #cmakedefine01·HAVE_INTTYPES_H
81 \xd 
82 /*·Define·to·1·if·you·have·the·<io.h>·header·file.·*/.55 /*·Define·to·1·if·you·have·the·<io.h>·header·file.·*/
83 #cmakedefine·HAVE_IO_H.56 #cmakedefine·HAVE_IO_H
84 \xd 
85 /*·Define·to·1·if·you·have·the·`m'·library·(-lm).·*/.57 /*·Define·to·1·if·you·have·the·`m'·library·(-lm).·*/
86 #cmakedefine01·HAVE_LIBM.58 #cmakedefine01·HAVE_LIBM
87 \xd 
88 /*·Define·to·1·if·you·have·the·<locale.h>·header·file.·*/.59 /*·Define·to·1·if·you·have·the·<locale.h>·header·file.·*/
89 #cmakedefine01·HAVE_LOCALE_H.60 #cmakedefine01·HAVE_LOCALE_H
90 \xd 
91 /*·Define·if·you·have·the·`localtime'·function.·*/.61 /*·Define·if·you·have·the·`localtime'·function.·*/
92 #cmakedefine·HAVE_LOCALTIME.62 #cmakedefine·HAVE_LOCALTIME
93 \xd 
94 /*·Define·if·you·have·the·`localtime_r'·function.·*/.63 /*·Define·if·you·have·the·`localtime_r'·function.·*/
95 #cmakedefine·HAVE_LOCALTIME_R.64 #cmakedefine·HAVE_LOCALTIME_R
96 \xd 
97 /*·Define·if·you·have·C99's·lrint·function.·*/.65 /*·Define·if·you·have·C99's·lrint·function.·*/
98 #cmakedefine01·HAVE_LRINT.66 #cmakedefine01·HAVE_LRINT
99 \xd 
100 /*·Define·if·you·have·C99's·lrintf·function.·*/.67 /*·Define·if·you·have·C99's·lrintf·function.·*/
101 #cmakedefine01·HAVE_LRINTF.68 #cmakedefine01·HAVE_LRINTF
102 \xd 
103 /*·Define·to·1·if·you·have·the·`lround'·function.·*/.69 /*·Define·to·1·if·you·have·the·`lround'·function.·*/
104 #cmakedefine01·HAVE_LROUND.70 #cmakedefine01·HAVE_LROUND
105 \xd 
106 /*·Define·to·1·if·you·have·the·`lseek'·function.·*/.71 /*·Define·to·1·if·you·have·the·`lseek'·function.·*/
107 #cmakedefine01·HAVE_LSEEK.72 #cmakedefine01·HAVE_LSEEK
108 \xd 
109 /*·Define·to·1·if·you·have·the·`lseek64'·function.·*/.73 /*·Define·to·1·if·you·have·the·`lseek64'·function.·*/
110 #cmakedefine01·HAVE_LSEEK64.74 #cmakedefine01·HAVE_LSEEK64
111 \xd 
112 /*·Define·to·1·if·you·have·the·`malloc'·function.·*/.75 /*·Define·to·1·if·you·have·the·`malloc'·function.·*/
113 #cmakedefine01·HAVE_MALLOC.76 #cmakedefine01·HAVE_MALLOC
114 \xd 
115 /*·Define·to·1·if·you·have·the·<memory.h>·header·file.·*/.77 /*·Define·to·1·if·you·have·the·<memory.h>·header·file.·*/
116 #cmakedefine01·HAVE_MEMORY_H.78 #cmakedefine01·HAVE_MEMORY_H
117 \xd 
118 /*·Define·to·1·if·you·have·the·`mmap'·function.·*/.79 /*·Define·to·1·if·you·have·the·`mmap'·function.·*/
119 #cmakedefine01·HAVE_MMAP.80 #cmakedefine01·HAVE_MMAP
120 \xd 
121 /*·Define·to·1·if·you·have·the·`open'·function.·*/.81 /*·Define·to·1·if·you·have·the·`open'·function.·*/
122 #cmakedefine01·HAVE_OPEN.82 #cmakedefine01·HAVE_OPEN
123 \xd 
124 /*·Define·to·1·if·you·have·the·`pipe'·function.·*/.83 /*·Define·to·1·if·you·have·the·`pipe'·function.·*/
125 #cmakedefine01·HAVE_PIPE.84 #cmakedefine01·HAVE_PIPE
126 \xd 
127 /*·Define·to·1·if·you·have·the·`read'·function.·*/.85 /*·Define·to·1·if·you·have·the·`read'·function.·*/
Max diff block lines reached; -1/17724 bytes (-0.01%) of diff not shown.
29.9 KB
libsndfile-1.0.30/src/dither.c
    
Offset 1, 534 lines modifiedOffset 1, 534 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2003-2011·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2003-2011·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include»       <stdlib.h>.19 #include»       <stdlib.h>
22 \xd 
23 #include»       "sndfile.h".20 #include»       "sndfile.h"
24 #include»       "sfendian.h".21 #include»       "sfendian.h"
25 #include»       "common.h".22 #include»       "common.h"
26 \xd 
27 /*============================================================================.23 /*============================================================================
28 **»     Rule·number·1·is·to·only·apply·dither·when·going·from·a·larger·bitwidth.24 **»     Rule·number·1·is·to·only·apply·dither·when·going·from·a·larger·bitwidth
29 **»     to·a·smaller·bitwidth.·This·can·happen·on·both·read·and·write..25 **»     to·a·smaller·bitwidth.·This·can·happen·on·both·read·and·write.
30 **.26 **
31 **»     Need·to·apply·dither·on·all·conversions·marked·X·below..27 **»     Need·to·apply·dither·on·all·conversions·marked·X·below.
32 **.28 **
33 **»     Dither·on·write:.29 **»     Dither·on·write:
34 **.30 **
35 **»     »     »     »     »     »     »     »     »     »     Input.31 **»     »     »     »     »     »     »     »     »     »     Input
36 **»     »     »     »     »     |»    short»       »       int»    »    »    float»       »       double.32 **»     »     »     »     »     |»    short»       »       int»    »    »    float»       »       double
37 **»     »     »     --------+-----------------------------------------------.33 **»     »     »     --------+-----------------------------------------------
38 **»     »     O»    8·bit»|»       X»      »      »      X»     »     »     X»    »    »    X.34 **»     »     O»    8·bit»|»       X»      »      »      X»     »     »     X»    »    »    X
39 **»     »     u»    16·bit»       |»      none»  »  X» » » X»»»X.35 **»     »     u»    16·bit»       |»      none»  »  X» » » X»»»X
40 **»     »     t»    24·bit»       |»      none»  »  X» » » X»»»X.36 **»     »     t»    24·bit»       |»      none»  »  X» » » X»»»X
41 **»     »     p»    32·bit»       |»      none»  »  none»      »      X»     »     »     X.37 **»     »     p»    32·bit»       |»      none»  »  none»      »      X»     »     »     X
42 **»     »     u»    float»       |»      none»  »  none»      »      none»  »  none.38 **»     »     u»    float»       |»      none»  »  none»      »      none»  »  none
43 **»     »     t»    double»      |»     none» » none»     »     none» » none.39 **»     »     t»    double»      |»     none» » none»     »     none» » none
44 **.40 **
45 **»     Dither·on·read:.41 **»     Dither·on·read:
46 **.42 **
47 **»     »     »     »     »     »     »     »     »     »     Input.43 **»     »     »     »     »     »     »     »     »     »     Input
48 **»     »     O»    »    »    |»   8·bit»       16·bit»  24·bit»     32·bit»float»   double.44 **»     »     O»    »    »    |»   8·bit»       16·bit»  24·bit»     32·bit»float»   double
49 **»     »     u»    --------+-------------------------------------------------.45 **»     »     u»    --------+-------------------------------------------------
50 **»     »     t»    short»       |»      none»  none»      X»     »     X»    »    X»   »   X.46 **»     »     t»    short»       |»      none»  none»      X»     »     X»    »    X»   »   X
51 **»     »     p»    int» » |»none»    none»none»    X»   »   X»  »  X.47 **»     »     p»    int» » |»none»    none»none»    X»   »   X»  »  X
52 **»     »     u»    float»       |»      none»  none»      none»  none»      none»  none.48 **»     »     u»    float»       |»      none»  none»      none»  none»      none»  none
53 **»     »     t»    double»      |»     none» none»     none» none»     none» none.49 **»     »     t»    double»      |»     none» none»     none» none»     none» none
54 */.50 */
55 \xd 
56 #define»SFE_DITHER_BAD_PTR»      666.51 #define»SFE_DITHER_BAD_PTR»      666
57 #define»SFE_DITHER_BAD_TYPE»     667.52 #define»SFE_DITHER_BAD_TYPE»     667
58 \xd 
59 typedef·struct.53 typedef·struct
60 {»      int»   »   »   read_short_dither_bits,·read_int_dither_bits·;.54 {»      int»   »   »   read_short_dither_bits,·read_int_dither_bits·;
61 »       int»    »    »    write_short_dither_bits,·write_int_dither_bits·;.55 »       int»    »    »    write_short_dither_bits,·write_int_dither_bits·;
62 »       double» » read_float_dither_scale,·read_double_dither_bits·;.56 »       double» » read_float_dither_scale,·read_double_dither_bits·;
63 »       double» » write_float_dither_scale,·write_double_dither_bits·;.57 »       double» » write_float_dither_scale,·write_double_dither_bits·;
64 \xd 
65 »       sf_count_t»     (*read_short)»(SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.58 »       sf_count_t»     (*read_short)»(SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
66 »       sf_count_t»     (*read_int)»  »  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.59 »       sf_count_t»     (*read_int)»  »  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
67 »       sf_count_t»     (*read_float)»(SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.60 »       sf_count_t»     (*read_float)»(SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
68 »       sf_count_t»     (*read_double)»       (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.61 »       sf_count_t»     (*read_double)»       (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
69 \xd 
70 »       sf_count_t»     (*write_short)»       (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.62 »       sf_count_t»     (*write_short)»       (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
71 »       sf_count_t»     (*write_int)» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.63 »       sf_count_t»     (*write_int)» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
72 »       sf_count_t»     (*write_float)»       (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.64 »       sf_count_t»     (*write_float)»       (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
73 »       sf_count_t»     (*write_double)»      (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.65 »       sf_count_t»     (*write_double)»      (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
74 \xd 
75 »       double·buffer·[SF_BUFFER_LEN·/·sizeof·(double)]·;.66 »       double·buffer·[SF_BUFFER_LEN·/·sizeof·(double)]·;
76 }·DITHER_DATA·;.67 }·DITHER_DATA·;
77 \xd 
78 static·sf_count_t·dither_read_short»      »      (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.68 static·sf_count_t·dither_read_short»      »      (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
79 static·sf_count_t·dither_read_int»»(SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.69 static·sf_count_t·dither_read_int»»(SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
80 \xd 
81 static·sf_count_t·dither_write_short»     (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.70 static·sf_count_t·dither_write_short»     (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
82 static·sf_count_t·dither_write_int»       »       (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.71 static·sf_count_t·dither_write_int»       »       (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
83 static·sf_count_t·dither_write_float»     (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.72 static·sf_count_t·dither_write_float»     (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
84 static·sf_count_t·dither_write_double»    (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.73 static·sf_count_t·dither_write_double»    (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
85 \xd 
86 int.74 int
87 dither_init·(SF_PRIVATE·*psf,·int·mode).75 dither_init·(SF_PRIVATE·*psf,·int·mode)
88 {»      DITHER_DATA·*pdither·;.76 {»      DITHER_DATA·*pdither·;
89 \xd 
90 »       pdither·=·psf->dither·;·/*·This·may·be·NULL.·*/.77 »       pdither·=·psf->dither·;·/*·This·may·be·NULL.·*/
91 \xd 
92 »       /*·Turn·off·dither·on·read.·*/.78 »       /*·Turn·off·dither·on·read.·*/
93 »       if·(mode·==·SFM_READ·&&·psf->read_dither.type·==·SFD_NO_DITHER).79 »       if·(mode·==·SFM_READ·&&·psf->read_dither.type·==·SFD_NO_DITHER)
94 »       {»      if·(pdither·==·NULL).80 »       {»      if·(pdither·==·NULL)
95 »       »       »       return·0·;·/*·Dither·is·already·off,·so·just·return.·*/.81 »       »       »       return·0·;·/*·Dither·is·already·off,·so·just·return.·*/
96 \xd 
97 »       »       if·(pdither->read_short).82 »       »       if·(pdither->read_short)
98 »       »       »       psf->read_short·=·pdither->read_short·;.83 »       »       »       psf->read_short·=·pdither->read_short·;
99 »       »       if·(pdither->read_int).84 »       »       if·(pdither->read_int)
100 »       »       »       psf->read_int·=·pdither->read_int·;.85 »       »       »       psf->read_int·=·pdither->read_int·;
101 »       »       if·(pdither->read_float).86 »       »       if·(pdither->read_float)
102 »       »       »       psf->read_float·=·pdither->read_float·;.87 »       »       »       psf->read_float·=·pdither->read_float·;
103 »       »       if·(pdither->read_double).88 »       »       if·(pdither->read_double)
104 »       »       »       psf->read_double·=·pdither->read_double·;.89 »       »       »       psf->read_double·=·pdither->read_double·;
105 »       »       return·0·;.90 »       »       return·0·;
106 »       »       }·;.91 »       »       }·;
107 \xd 
108 »       /*·Turn·off·dither·on·write.·*/.92 »       /*·Turn·off·dither·on·write.·*/
109 »       if·(mode·==·SFM_WRITE·&&·psf->write_dither.type·==·SFD_NO_DITHER).93 »       if·(mode·==·SFM_WRITE·&&·psf->write_dither.type·==·SFD_NO_DITHER)
110 »       {»      if·(pdither·==·NULL).94 »       {»      if·(pdither·==·NULL)
111 »       »       »       return·0·;·/*·Dither·is·already·off,·so·just·return.·*/.95 »       »       »       return·0·;·/*·Dither·is·already·off,·so·just·return.·*/
112 \xd 
113 »       »       if·(pdither->write_short).96 »       »       if·(pdither->write_short)
114 »       »       »       psf->write_short·=·pdither->write_short·;.97 »       »       »       psf->write_short·=·pdither->write_short·;
115 »       »       if·(pdither->write_int).98 »       »       if·(pdither->write_int)
116 »       »       »       psf->write_int·=·pdither->write_int·;.99 »       »       »       psf->write_int·=·pdither->write_int·;
117 »       »       if·(pdither->write_float).100 »       »       if·(pdither->write_float)
118 »       »       »       psf->write_float·=·pdither->write_float·;.101 »       »       »       psf->write_float·=·pdither->write_float·;
119 »       »       if·(pdither->write_double).102 »       »       if·(pdither->write_double)
120 »       »       »       psf->write_double·=·pdither->write_double·;.103 »       »       »       psf->write_double·=·pdither->write_double·;
121 »       »       return·0·;.104 »       »       return·0·;
122 »       »       }·;.105 »       »       }·;
123 \xd 
124 »       /*·Turn·on·dither·on·read·if·asked.·*/.106 »       /*·Turn·on·dither·on·read·if·asked.·*/
125 »       if·(mode·==·SFM_READ·&&·psf->read_dither.type·!=·0).107 »       if·(mode·==·SFM_READ·&&·psf->read_dither.type·!=·0)
126 »       {»      if·(pdither·==·NULL).108 »       {»      if·(pdither·==·NULL)
127 »       »       »       pdither·=·psf->dither·=·calloc·(1,·sizeof·(DITHER_DATA))·;.109 »       »       »       pdither·=·psf->dither·=·calloc·(1,·sizeof·(DITHER_DATA))·;
Max diff block lines reached; -1/30552 bytes (-0.00%) of diff not shown.
59.8 KB
libsndfile-1.0.30/src/double64.c
    
Offset 1, 1063 lines modifiedOffset 1, 1063 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2015·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2015·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include»       <stdio.h>.19 #include»       <stdio.h>
22 #include»       <stdlib.h>.20 #include»       <stdlib.h>
23 #include»       <string.h>.21 #include»       <string.h>
24 #include»       <limits.h>.22 #include»       <limits.h>
25 #include»       <math.h>.23 #include»       <math.h>
26 \xd 
27 #include»       "sndfile.h".24 #include»       "sndfile.h"
28 #include»       "sfendian.h".25 #include»       "sfendian.h"
29 #include»       "common.h".26 #include»       "common.h"
30 \xd 
31 #if·CPU_IS_LITTLE_ENDIAN.27 #if·CPU_IS_LITTLE_ENDIAN
32 »       #define·DOUBLE64_READ»   double64_le_read.28 »       #define·DOUBLE64_READ»   double64_le_read
33 »       #define·DOUBLE64_WRITE»  double64_le_write.29 »       #define·DOUBLE64_WRITE»  double64_le_write
34 #elif·CPU_IS_BIG_ENDIAN.30 #elif·CPU_IS_BIG_ENDIAN
35 »       #define·DOUBLE64_READ»   double64_be_read.31 »       #define·DOUBLE64_READ»   double64_be_read
36 »       #define·DOUBLE64_WRITE»  double64_be_write.32 »       #define·DOUBLE64_WRITE»  double64_be_write
37 #endif.33 #endif
38 \xd 
39 /*·A·32·number·which·will·not·overflow·when·multiplied·by·sizeof·(double).·*/.34 /*·A·32·number·which·will·not·overflow·when·multiplied·by·sizeof·(double).·*/
40 #define·SENSIBLE_LEN»    (0x8000000).35 #define·SENSIBLE_LEN»    (0x8000000)
41 \xd 
42 /*--------------------------------------------------------------------------------------------.36 /*--------------------------------------------------------------------------------------------
43 **»     Processor·floating·point·capabilities.·double64_get_capability·()·returns·one·of·the.37 **»     Processor·floating·point·capabilities.·double64_get_capability·()·returns·one·of·the
44 **»     latter·three·values..38 **»     latter·three·values.
45 */.39 */
46 \xd 
47 enum.40 enum
48 {»      DOUBLE_UNKNOWN»»=·0x00,.41 {»      DOUBLE_UNKNOWN»»=·0x00,
49 »       DOUBLE_CAN_RW_LE»       =·0x23,.42 »       DOUBLE_CAN_RW_LE»       =·0x23,
50 »       DOUBLE_CAN_RW_BE»       =·0x34,.43 »       DOUBLE_CAN_RW_BE»       =·0x34,
51 »       DOUBLE_BROKEN_LE»       =·0x45,.44 »       DOUBLE_BROKEN_LE»       =·0x45,
52 »       DOUBLE_BROKEN_BE»       =·0x56.45 »       DOUBLE_BROKEN_BE»       =·0x56
53 }·;.46 }·;
54 \xd 
55 /*--------------------------------------------------------------------------------------------.47 /*--------------------------------------------------------------------------------------------
56 **»     Prototypes·for·private·functions..48 **»     Prototypes·for·private·functions.
57 */.49 */
58 \xd 
59 static·sf_count_t»       »       host_read_d2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.50 static·sf_count_t»       »       host_read_d2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
60 static·sf_count_t»       »       host_read_d2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.51 static·sf_count_t»       »       host_read_d2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
61 static·sf_count_t»       »       host_read_d2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.52 static·sf_count_t»       »       host_read_d2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
62 static·sf_count_t»       »       host_read_d»    »    (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.53 static·sf_count_t»       »       host_read_d»    »    (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
63 \xd 
64 static·sf_count_t»       »       host_write_s2d» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.54 static·sf_count_t»       »       host_write_s2d» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
65 static·sf_count_t»       »       host_write_i2d» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.55 static·sf_count_t»       »       host_write_i2d» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
66 static·sf_count_t»       »       host_write_f2d» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.56 static·sf_count_t»       »       host_write_f2d» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
67 static·sf_count_t»       »       host_write_d»   (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.57 static·sf_count_t»       »       host_write_d»   (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
68 \xd 
69 static·void»     »     double64_peak_update» (SF_PRIVATE·*psf,·const·double·*buffer,·int·count,·sf_count_t·indx)·;.58 static·void»     »     double64_peak_update» (SF_PRIVATE·*psf,·const·double·*buffer,·int·count,·sf_count_t·indx)·;
70 \xd 
71 static·int»      »      double64_get_capability»       (SF_PRIVATE·*psf)·;.59 static·int»      »      double64_get_capability»       (SF_PRIVATE·*psf)·;
72 \xd 
73 static·sf_count_t»       replace_read_d2s»       (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.60 static·sf_count_t»       replace_read_d2s»       (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
74 static·sf_count_t»       replace_read_d2i»       (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.61 static·sf_count_t»       replace_read_d2i»       (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
75 static·sf_count_t»       replace_read_d2f»       (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.62 static·sf_count_t»       replace_read_d2f»       (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
76 static·sf_count_t»       replace_read_d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.63 static·sf_count_t»       replace_read_d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
77 \xd 
78 static·sf_count_t»       replace_write_s2d»      (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.64 static·sf_count_t»       replace_write_s2d»      (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
79 static·sf_count_t»       replace_write_i2d»      (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.65 static·sf_count_t»       replace_write_i2d»      (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
80 static·sf_count_t»       replace_write_f2d»      (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.66 static·sf_count_t»       replace_write_f2d»      (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
81 static·sf_count_t»       replace_write_d»(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.67 static·sf_count_t»       replace_write_d»(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
82 \xd 
83 static» void»     d2bd_read·(double·*buffer,·int·count)·;.68 static» void»     d2bd_read·(double·*buffer,·int·count)·;
84 static» void»     bd2d_write·(double·*buffer,·int·count)·;.69 static» void»     bd2d_write·(double·*buffer,·int·count)·;
85 \xd 
86 /*--------------------------------------------------------------------------------------------.70 /*--------------------------------------------------------------------------------------------
87 **»     Exported·functions..71 **»     Exported·functions.
88 */.72 */
89 \xd 
90 int.73 int
91 double64_init»  (SF_PRIVATE·*psf).74 double64_init»  (SF_PRIVATE·*psf)
92 {»      static·int·double64_caps·;.75 {»      static·int·double64_caps·;
93 \xd 
94 »       if·(psf->sf.channels·<·1·||·psf->sf.channels·>·SF_MAX_CHANNELS).76 »       if·(psf->sf.channels·<·1·||·psf->sf.channels·>·SF_MAX_CHANNELS)
95 »       {»      psf_log_printf·(psf,·"double64_init·:·internal·error·:·channels·=·%d\n",·psf->sf.channels)·;.77 »       {»      psf_log_printf·(psf,·"double64_init·:·internal·error·:·channels·=·%d\n",·psf->sf.channels)·;
96 »       »       return·SFE_INTERNAL·;.78 »       »       return·SFE_INTERNAL·;
97 »       »       }·;.79 »       »       }·;
98 \xd 
99 »       double64_caps·=·double64_get_capability·(psf)·;.80 »       double64_caps·=·double64_get_capability·(psf)·;
100 \xd 
101 »       psf->blockwidth·=·sizeof·(double)·*·psf->sf.channels·;.81 »       psf->blockwidth·=·sizeof·(double)·*·psf->sf.channels·;
102 \xd 
103 »       if·(psf->file.mode·==·SFM_READ·||·psf->file.mode·==·SFM_RDWR).82 »       if·(psf->file.mode·==·SFM_READ·||·psf->file.mode·==·SFM_RDWR)
104 »       {»      switch·(psf->endian·+·double64_caps).83 »       {»      switch·(psf->endian·+·double64_caps)
105 »       »       {»      case·(SF_ENDIAN_BIG·+·DOUBLE_CAN_RW_BE)·:.84 »       »       {»      case·(SF_ENDIAN_BIG·+·DOUBLE_CAN_RW_BE)·:
106 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;.85 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;
107 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;.86 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;
108 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;.87 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;
109 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;.88 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;
110 »       »       »       »       »       psf->read_double»       =·host_read_d·;.89 »       »       »       »       »       psf->read_double»       =·host_read_d·;
111 »       »       »       »       »       break·;.90 »       »       »       »       »       break·;
112 \xd 
113 »       »       »       case·(SF_ENDIAN_LITTLE·+·DOUBLE_CAN_RW_LE)·:.91 »       »       »       case·(SF_ENDIAN_LITTLE·+·DOUBLE_CAN_RW_LE)·:
114 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;.92 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;
115 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;.93 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;
116 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;.94 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;
117 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;.95 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;
118 »       »       »       »       »       psf->read_double»       =·host_read_d·;.96 »       »       »       »       »       psf->read_double»       =·host_read_d·;
119 »       »       »       »       »       break·;.97 »       »       »       »       »       break·;
120 \xd 
121 »       »       »       case·(SF_ENDIAN_BIG·+·DOUBLE_CAN_RW_LE)·:.98 »       »       »       case·(SF_ENDIAN_BIG·+·DOUBLE_CAN_RW_LE)·:
122 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;.99 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;
123 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;.100 »       »       »       »       »       psf->read_short»»=·host_read_d2s·;
124 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;.101 »       »       »       »       »       psf->read_int»  »  =·host_read_d2i·;
125 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;.102 »       »       »       »       »       psf->read_float»»=·host_read_d2f·;
126 »       »       »       »       »       psf->read_double»       =·host_read_d·;.103 »       »       »       »       »       psf->read_double»       =·host_read_d·;
127 »       »       »       »       »       break·;.104 »       »       »       »       »       break·;
Max diff block lines reached; -1/61203 bytes (-0.00%) of diff not shown.
74.4 KB
libsndfile-1.0.30/src/file_io.c
    
Offset 1, 1572 lines modifiedOffset 1, 1572 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2002-2014·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2002-2014·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **·Copyright·(C)·2003·Ross·Bencina·<rbencina@iprimus.com.au>.3 **·Copyright·(C)·2003·Ross·Bencina·<rbencina@iprimus.com.au>
4 **.4 **
5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
13 **·GNU·Lesser·General·Public·License·for·more·details..13 **·GNU·Lesser·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
16 **·along·with·this·program;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 /*.19 /*
21 **»     The·file·is·split·into·three·sections·as·follows:.20 **»     The·file·is·split·into·three·sections·as·follows:
22 **»     »     -·The·top·section·(USE_WINDOWS_API·==·0)·for·Linux,·Unix·and·MacOSX.21 **»     »     -·The·top·section·(USE_WINDOWS_API·==·0)·for·Linux,·Unix·and·MacOSX
23 **»     »     »     systems·(including·Cygwin)..22 **»     »     »     systems·(including·Cygwin).
24 **»     »     -·The·middle·section·(USE_WINDOWS_API·==·1)·for·microsoft·windows.23 **»     »     -·The·middle·section·(USE_WINDOWS_API·==·1)·for·microsoft·windows
25 **»     »     »     (including·MinGW)·using·the·native·windows·API..24 **»     »     »     (including·MinGW)·using·the·native·windows·API.
26 **»     »     -·A·legacy·windows·section·which·attempted·to·work·around·grevious.25 **»     »     -·A·legacy·windows·section·which·attempted·to·work·around·grevious
27 **»     »     »     bugs·in·microsoft's·POSIX·implementation..26 **»     »     »     bugs·in·microsoft's·POSIX·implementation.
28 */.27 */
29 \xd 
30 /*.28 /*
31 **»     The·header·file·sfconfig.h·MUST·be·included·before·the·others·to·ensure.29 **»     The·header·file·sfconfig.h·MUST·be·included·before·the·others·to·ensure
32 **»     that·large·file·support·is·enabled·correctly·on·Unix·systems..30 **»     that·large·file·support·is·enabled·correctly·on·Unix·systems.
33 */.31 */
34 \xd 
35 #include·"sfconfig.h".32 #include·"sfconfig.h"
36 \xd 
37 #if·USE_WINDOWS_API.33 #if·USE_WINDOWS_API
38 \xd 
39 /*·Don't·include·rarely·used·headers,·speed·up·build·*/.34 /*·Don't·include·rarely·used·headers,·speed·up·build·*/
40 #define·WIN32_LEAN_AND_MEAN.35 #define·WIN32_LEAN_AND_MEAN
41 \xd 
42 #include·<windows.h>.36 #include·<windows.h>
43 #endif.37 #endif
44 \xd 
45 #include·<stdio.h>.38 #include·<stdio.h>
46 #include·<stdlib.h>.39 #include·<stdlib.h>
47 \xd 
48 #if·HAVE_UNISTD_H.40 #if·HAVE_UNISTD_H
49 #include·<unistd.h>.41 #include·<unistd.h>
50 #else.42 #else
51 #include·<io.h>.43 #include·<io.h>
52 #endif.44 #endif
53 \xd 
54 #if·(HAVE_DECL_S_IRGRP·==·0).45 #if·(HAVE_DECL_S_IRGRP·==·0)
55 #include·<sf_unistd.h>.46 #include·<sf_unistd.h>
56 #endif.47 #endif
57 \xd 
58 #include·<string.h>.48 #include·<string.h>
59 #include·<fcntl.h>.49 #include·<fcntl.h>
60 #include·<errno.h>.50 #include·<errno.h>
61 #include·<sys/stat.h>.51 #include·<sys/stat.h>
62 \xd 
63 #include·"sndfile.h".52 #include·"sndfile.h"
64 #include·"common.h".53 #include·"common.h"
65 \xd 
66 #define»SENSIBLE_SIZE»   (0x40000000).54 #define»SENSIBLE_SIZE»   (0x40000000)
67 \xd 
68 /*.55 /*
69 **»     Neat·solution·to·the·Win32/OS2·binary·file·flage·requirement..56 **»     Neat·solution·to·the·Win32/OS2·binary·file·flage·requirement.
70 **»     If·O_BINARY·isn't·already·defined·by·the·inclusion·of·the·system.57 **»     If·O_BINARY·isn't·already·defined·by·the·inclusion·of·the·system
71 **»     headers,·set·it·to·zero..58 **»     headers,·set·it·to·zero.
72 */.59 */
73 #ifndef·O_BINARY.60 #ifndef·O_BINARY
74 #define·O_BINARY·0.61 #define·O_BINARY·0
75 #endif.62 #endif
76 \xd 
77 static·void·psf_log_syserr·(SF_PRIVATE·*psf,·int·error)·;.63 static·void·psf_log_syserr·(SF_PRIVATE·*psf,·int·error)·;
78 \xd 
79 #if·(USE_WINDOWS_API·==·0).64 #if·(USE_WINDOWS_API·==·0)
80 \xd 
81 /*------------------------------------------------------------------------------.65 /*------------------------------------------------------------------------------
82 **·Win32·stuff·at·the·bottom·of·the·file.·Unix·and·other·sensible·OSes·here..66 **·Win32·stuff·at·the·bottom·of·the·file.·Unix·and·other·sensible·OSes·here.
83 */.67 */
84 \xd 
85 static·int·psf_close_fd·(int·fd)·;.68 static·int·psf_close_fd·(int·fd)·;
86 static·int·psf_open_fd·(PSF_FILE·*·pfile)·;.69 static·int·psf_open_fd·(PSF_FILE·*·pfile)·;
87 static·sf_count_t·psf_get_filelen_fd·(int·fd)·;.70 static·sf_count_t·psf_get_filelen_fd·(int·fd)·;
88 \xd 
89 int.71 int
90 psf_fopen·(SF_PRIVATE·*psf).72 psf_fopen·(SF_PRIVATE·*psf)
91 {.73 {
92 »       psf->error·=·0·;.74 »       psf->error·=·0·;
93 »       psf->file.filedes·=·psf_open_fd·(&psf->file)·;.75 »       psf->file.filedes·=·psf_open_fd·(&psf->file)·;
94 \xd 
95 »       if·(psf->file.filedes·==·-·SFE_BAD_OPEN_MODE).76 »       if·(psf->file.filedes·==·-·SFE_BAD_OPEN_MODE)
96 »       {»      psf->error·=·SFE_BAD_OPEN_MODE·;.77 »       {»      psf->error·=·SFE_BAD_OPEN_MODE·;
97 »       »       psf->file.filedes·=·-1·;.78 »       »       psf->file.filedes·=·-1·;
98 »       »       return·psf->error·;.79 »       »       return·psf->error·;
99 »       »       }·;.80 »       »       }·;
100 \xd 
101 »       if·(psf->file.filedes·==·-1).81 »       if·(psf->file.filedes·==·-1)
102 »       »       psf_log_syserr·(psf,·errno)·;.82 »       »       psf_log_syserr·(psf,·errno)·;
103 \xd 
104 »       return·psf->error·;.83 »       return·psf->error·;
105 }·/*·psf_fopen·*/.84 }·/*·psf_fopen·*/
106 \xd 
107 int.85 int
108 psf_fclose·(SF_PRIVATE·*psf).86 psf_fclose·(SF_PRIVATE·*psf)
109 {»      int·retval·;.87 {»      int·retval·;
110 \xd 
111 »       if·(psf->virtual_io).88 »       if·(psf->virtual_io)
112 »       »       return·0·;.89 »       »       return·0·;
113 \xd 
114 »       if·(psf->file.do_not_close_descriptor).90 »       if·(psf->file.do_not_close_descriptor)
115 »       {»      psf->file.filedes·=·-1·;.91 »       {»      psf->file.filedes·=·-1·;
116 »       »       return·0·;.92 »       »       return·0·;
117 »       »       }·;.93 »       »       }·;
118 \xd 
119 »       if·((retval·=·psf_close_fd·(psf->file.filedes))·==·-1).94 »       if·((retval·=·psf_close_fd·(psf->file.filedes))·==·-1)
120 »       »       psf_log_syserr·(psf,·errno)·;.95 »       »       psf_log_syserr·(psf,·errno)·;
121 \xd 
122 »       psf->file.filedes·=·-1·;.96 »       psf->file.filedes·=·-1·;
123 \xd 
124 »       return·retval·;.97 »       return·retval·;
125 }·/*·psf_fclose·*/.98 }·/*·psf_fclose·*/
126 \xd 
127 int.99 int
Max diff block lines reached; -1/76098 bytes (-0.00%) of diff not shown.
55.9 KB
libsndfile-1.0.30/src/float32.c
    
Offset 1, 1017 lines modifiedOffset 1, 1017 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include»       <stdio.h>.19 #include»       <stdio.h>
22 #include»       <stdlib.h>.20 #include»       <stdlib.h>
23 #include»       <string.h>.21 #include»       <string.h>
24 #include»       <limits.h>.22 #include»       <limits.h>
25 #include»       <math.h>.23 #include»       <math.h>
26 \xd 
27 #include»       "sndfile.h".24 #include»       "sndfile.h"
28 #include»       "sfendian.h".25 #include»       "sfendian.h"
29 #include»       "common.h".26 #include»       "common.h"
30 \xd 
31 #if·CPU_IS_LITTLE_ENDIAN.27 #if·CPU_IS_LITTLE_ENDIAN
32 »       #define·FLOAT32_READ»    float32_le_read.28 »       #define·FLOAT32_READ»    float32_le_read
33 »       #define·FLOAT32_WRITE»   float32_le_write.29 »       #define·FLOAT32_WRITE»   float32_le_write
34 #elif·CPU_IS_BIG_ENDIAN.30 #elif·CPU_IS_BIG_ENDIAN
35 »       #define·FLOAT32_READ»    float32_be_read.31 »       #define·FLOAT32_READ»    float32_be_read
36 »       #define·FLOAT32_WRITE»   float32_be_write.32 »       #define·FLOAT32_WRITE»   float32_be_write
37 #endif.33 #endif
38 \xd 
39 /*--------------------------------------------------------------------------------------------.34 /*--------------------------------------------------------------------------------------------
40 **»     Processor·floating·point·capabilities.·float32_get_capability·()·returns·one·of·the.35 **»     Processor·floating·point·capabilities.·float32_get_capability·()·returns·one·of·the
41 **»     latter·four·values..36 **»     latter·four·values.
42 */.37 */
43 \xd 
44 enum.38 enum
45 {»      FLOAT_UNKNOWN» » =·0x00,.39 {»      FLOAT_UNKNOWN» » =·0x00,
46 »       FLOAT_CAN_RW_LE»»=·0x12,.40 »       FLOAT_CAN_RW_LE»»=·0x12,
47 »       FLOAT_CAN_RW_BE»»=·0x23,.41 »       FLOAT_CAN_RW_BE»»=·0x23,
48 »       FLOAT_BROKEN_LE»»=·0x34,.42 »       FLOAT_BROKEN_LE»»=·0x34,
49 »       FLOAT_BROKEN_BE»»=·0x45.43 »       FLOAT_BROKEN_BE»»=·0x45
50 }·;.44 }·;
51 \xd 
52 /*--------------------------------------------------------------------------------------------.45 /*--------------------------------------------------------------------------------------------
53 **»     Prototypes·for·private·functions..46 **»     Prototypes·for·private·functions.
54 */.47 */
55 \xd 
56 static·sf_count_t»       host_read_f2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.48 static·sf_count_t»       host_read_f2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
57 static·sf_count_t»       host_read_f2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.49 static·sf_count_t»       host_read_f2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
58 static·sf_count_t»       host_read_f»    (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.50 static·sf_count_t»       host_read_f»    (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
59 static·sf_count_t»       host_read_f2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.51 static·sf_count_t»       host_read_f2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
60 \xd 
61 static·sf_count_t»       host_write_s2f» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.52 static·sf_count_t»       host_write_s2f» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
62 static·sf_count_t»       host_write_i2f» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.53 static·sf_count_t»       host_write_i2f» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
63 static·sf_count_t»       host_write_f»   (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.54 static·sf_count_t»       host_write_f»   (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
64 static·sf_count_t»       host_write_d2f» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.55 static·sf_count_t»       host_write_d2f» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
65 \xd 
66 static·void»     »     float32_peak_update»  (SF_PRIVATE·*psf,·const·float·*buffer,·int·count,·sf_count_t·indx)·;.56 static·void»     »     float32_peak_update»  (SF_PRIVATE·*psf,·const·float·*buffer,·int·count,·sf_count_t·indx)·;
67 \xd 
68 static·sf_count_t»       replace_read_f2s»       (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.57 static·sf_count_t»       replace_read_f2s»       (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
69 static·sf_count_t»       replace_read_f2i»       (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.58 static·sf_count_t»       replace_read_f2i»       (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
70 static·sf_count_t»       replace_read_f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.59 static·sf_count_t»       replace_read_f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
71 static·sf_count_t»       replace_read_f2d»       (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.60 static·sf_count_t»       replace_read_f2d»       (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
72 \xd 
73 static·sf_count_t»       replace_write_s2f»      (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.61 static·sf_count_t»       replace_write_s2f»      (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
74 static·sf_count_t»       replace_write_i2f»      (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.62 static·sf_count_t»       replace_write_i2f»      (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
75 static·sf_count_t»       replace_write_f»(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.63 static·sf_count_t»       replace_write_f»(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
76 static·sf_count_t»       replace_write_d2f»      (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.64 static·sf_count_t»       replace_write_d2f»      (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
77 \xd 
78 static» void»     bf2f_array·(float·*buffer,·int·count)·;.65 static» void»     bf2f_array·(float·*buffer,·int·count)·;
79 static» void»     f2bf_array·(float·*buffer,·int·count)·;.66 static» void»     f2bf_array·(float·*buffer,·int·count)·;
80 \xd 
81 static·int»      »      float32_get_capability»(SF_PRIVATE·*psf)·;.67 static·int»      »      float32_get_capability»(SF_PRIVATE·*psf)·;
82 \xd 
83 /*--------------------------------------------------------------------------------------------.68 /*--------------------------------------------------------------------------------------------
84 **»     Exported·functions..69 **»     Exported·functions.
85 */.70 */
86 \xd 
87 int.71 int
88 float32_init»   (SF_PRIVATE·*psf).72 float32_init»   (SF_PRIVATE·*psf)
89 {»      static·int·float_caps·;.73 {»      static·int·float_caps·;
90 \xd 
91 »       if·(psf->sf.channels·<·1).74 »       if·(psf->sf.channels·<·1)
92 »       {»      psf_log_printf·(psf,·"float32_init·:·internal·error·:·channels·=·%d\n",·psf->sf.channels)·;.75 »       {»      psf_log_printf·(psf,·"float32_init·:·internal·error·:·channels·=·%d\n",·psf->sf.channels)·;
93 »       »       return·SFE_INTERNAL·;.76 »       »       return·SFE_INTERNAL·;
94 »       »       }·;.77 »       »       }·;
95 \xd 
96 »       float_caps·=·float32_get_capability·(psf)·;.78 »       float_caps·=·float32_get_capability·(psf)·;
97 \xd 
98 »       psf->blockwidth·=·sizeof·(float)·*·psf->sf.channels·;.79 »       psf->blockwidth·=·sizeof·(float)·*·psf->sf.channels·;
99 \xd 
100 »       if·(psf->file.mode·==·SFM_READ·||·psf->file.mode·==·SFM_RDWR).80 »       if·(psf->file.mode·==·SFM_READ·||·psf->file.mode·==·SFM_RDWR)
101 »       {»      switch·(psf->endian·+·float_caps).81 »       {»      switch·(psf->endian·+·float_caps)
102 »       »       {»      case·(SF_ENDIAN_BIG·+·FLOAT_CAN_RW_BE)·:.82 »       »       {»      case·(SF_ENDIAN_BIG·+·FLOAT_CAN_RW_BE)·:
103 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;.83 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;
104 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;.84 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;
105 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;.85 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;
106 »       »       »       »       »       psf->read_float»»=·host_read_f·;.86 »       »       »       »       »       psf->read_float»»=·host_read_f·;
107 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;.87 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;
108 »       »       »       »       »       break·;.88 »       »       »       »       »       break·;
109 \xd 
110 »       »       »       case·(SF_ENDIAN_LITTLE·+·FLOAT_CAN_RW_LE)·:.89 »       »       »       case·(SF_ENDIAN_LITTLE·+·FLOAT_CAN_RW_LE)·:
111 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;.90 »       »       »       »       »       psf->data_endswap·=·SF_FALSE·;
112 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;.91 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;
113 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;.92 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;
114 »       »       »       »       »       psf->read_float»»=·host_read_f·;.93 »       »       »       »       »       psf->read_float»»=·host_read_f·;
115 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;.94 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;
116 »       »       »       »       »       break·;.95 »       »       »       »       »       break·;
117 \xd 
118 »       »       »       case·(SF_ENDIAN_BIG·+·FLOAT_CAN_RW_LE)·:.96 »       »       »       case·(SF_ENDIAN_BIG·+·FLOAT_CAN_RW_LE)·:
119 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;.97 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;
120 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;.98 »       »       »       »       »       psf->read_short»»=·host_read_f2s·;
121 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;.99 »       »       »       »       »       psf->read_int»  »  =·host_read_f2i·;
122 »       »       »       »       »       psf->read_float»»=·host_read_f·;.100 »       »       »       »       »       psf->read_float»»=·host_read_f·;
123 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;.101 »       »       »       »       »       psf->read_double»       =·host_read_f2d·;
124 »       »       »       »       »       break·;.102 »       »       »       »       »       break·;
125 \xd 
126 »       »       »       case·(SF_ENDIAN_LITTLE·+·FLOAT_CAN_RW_BE)·:.103 »       »       »       case·(SF_ENDIAN_LITTLE·+·FLOAT_CAN_RW_BE)·:
127 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;.104 »       »       »       »       »       psf->data_endswap·=·SF_TRUE·;
Max diff block lines reached; -1/57183 bytes (-0.00%) of diff not shown.
14.9 KB
libsndfile-1.0.30/src/GSM610/lpc.c
    
Offset 1, 333 lines modifiedOffset 1, 333 lines modified
1 /*.1 /*
2 ·*·Copyright·1992·by·Jutta·Degener·and·Carsten·Bormann,·Technische.2 ·*·Copyright·1992·by·Jutta·Degener·and·Carsten·Bormann,·Technische
3 ·*·Universitaet·Berlin.··See·the·accompanying·file·"COPYRIGHT"·for.3 ·*·Universitaet·Berlin.··See·the·accompanying·file·"COPYRIGHT"·for
4 ·*·details.··THERE·IS·ABSOLUTELY·NO·WARRANTY·FOR·THIS·SOFTWARE..4 ·*·details.··THERE·IS·ABSOLUTELY·NO·WARRANTY·FOR·THIS·SOFTWARE.
5 ·*/.5 ·*/
6 \xd 
7 #include·<stdio.h>.6 #include·<stdio.h>
8 #include·<string.h>.7 #include·<string.h>
9 #include·<assert.h>.8 #include·<assert.h>
10 \xd 
11 #include·"gsm610_priv.h".9 #include·"gsm610_priv.h"
12 \xd 
13 /*.10 /*
14 ·*··4.2.4·..·4.2.7·LPC·ANALYSIS·SECTION.11 ·*··4.2.4·..·4.2.7·LPC·ANALYSIS·SECTION
15 ·*/.12 ·*/
16 \xd 
17 /*·4.2.4·*/.13 /*·4.2.4·*/
18 \xd 
19 \xd 
20 static·void·Autocorrelation·(.14 static·void·Autocorrelation·(
21 »       int16_t»»*·s,»     »     /*·[0..159]»   IN/OUT··*/.15 »       int16_t»»*·s,»     »     /*·[0..159]»   IN/OUT··*/
22 ·»       int32_t»*·L_ACF)» /*·[0..8]» OUT·····*/.16 ·»       int32_t»*·L_ACF)» /*·[0..8]» OUT·····*/
23 /*.17 /*
24 ·*··The·goal·is·to·compute·the·array·L_ACF·[k].··The·signal·s·[i]·must.18 ·*··The·goal·is·to·compute·the·array·L_ACF·[k].··The·signal·s·[i]·must
25 ·*··be·scaled·in·order·to·avoid·an·overflow·situation..19 ·*··be·scaled·in·order·to·avoid·an·overflow·situation.
26 ·*/.20 ·*/
27 {.21 {
28 »       register·int»    k,·i·;.22 »       register·int»    k,·i·;
29 \xd 
30 »       int16_t»»temp,·smax,·scalauto·;.23 »       int16_t»»temp,·smax,·scalauto·;
31 \xd 
32 #ifdef» USE_FLOAT_MUL.24 #ifdef» USE_FLOAT_MUL
33 »       float»  »  float_s·[160]·;.25 »       float»  »  float_s·[160]·;
34 #endif.26 #endif
35 \xd 
36 »       /*··Dynamic·scaling·of·the·array··s·[0..159]·*/.27 »       /*··Dynamic·scaling·of·the·array··s·[0..159]·*/
37 \xd 
38 »       /*··Search·for·the·maximum.·*/.28 »       /*··Search·for·the·maximum.·*/
39 »       smax·=·0·;.29 »       smax·=·0·;
40 »       for·(k·=·0·;·k·<=·159·;·k++).30 »       for·(k·=·0·;·k·<=·159·;·k++)
41 »       {»      temp·=·GSM_ABS·(s·[k])·;.31 »       {»      temp·=·GSM_ABS·(s·[k])·;
42 »       »       if·(temp·>·smax)·smax·=·temp·;.32 »       »       if·(temp·>·smax)·smax·=·temp·;
43 »       »       }.33 »       »       }
44 \xd 
45 »       /*··Computation·of·the·scaling·factor..34 »       /*··Computation·of·the·scaling·factor.
46 »       ·*/.35 »       ·*/
47 »       if·(smax·==·0).36 »       if·(smax·==·0)
48 »       »       scalauto·=·0·;.37 »       »       scalauto·=·0·;
49 »       else.38 »       else
50 »       {»      assert·(smax·>·0)·;.39 »       {»      assert·(smax·>·0)·;
51 »       »       scalauto·=·4·-·gsm_norm·((int32_t)·smax·<<·16)·;»/*·sub·(4,..)·*/.40 »       »       scalauto·=·4·-·gsm_norm·((int32_t)·smax·<<·16)·;»/*·sub·(4,..)·*/
52 »       »       }.41 »       »       }
53 \xd 
54 »       /*··Scaling·of·the·array·s·[0...159].42 »       /*··Scaling·of·the·array·s·[0...159]
55 »       ·*/.43 »       ·*/
56 \xd 
57 »       if·(scalauto·>·0).44 »       if·(scalauto·>·0)
58 »       {.45 »       {
59 \xd 
60 #·ifdef·USE_FLOAT_MUL.46 #·ifdef·USE_FLOAT_MUL
61 #»      define·SCALE(n)»\.47 #»      define·SCALE(n)»\
62 »       case·n:·for·(k·=·0·;·k·<=·159·;·k++)·\.48 »       case·n:·for·(k·=·0·;·k·<=·159·;·k++)·\
63 »       »       »       float_s·[k]·=·(float)»     \.49 »       »       »       float_s·[k]·=·(float)»     \
64 »       »       »       »       (s·[k]·=·GSM_MULT_R·(s·[k],·16384·>>·(n-1)))·;\.50 »       »       »       »       (s·[k]·=·GSM_MULT_R·(s·[k],·16384·>>·(n-1)))·;\
65 »       »       break·;.51 »       »       break·;
66 #·else.52 #·else
67 #»      define·SCALE(n)»\.53 #»      define·SCALE(n)»\
68 »       case·n:·for·(k·=·0·;·k·<=·159·;·k++)·\.54 »       case·n:·for·(k·=·0·;·k·<=·159·;·k++)·\
69 »       »       »       s·[k]·=·GSM_MULT_R·(s·[k],·16384·>>·(n-1))·;\.55 »       »       »       s·[k]·=·GSM_MULT_R·(s·[k],·16384·>>·(n-1))·;\
70 »       »       break·;.56 »       »       break·;
71 #·endif·/*·USE_FLOAT_MUL·*/.57 #·endif·/*·USE_FLOAT_MUL·*/
72 \xd 
73 »       »       switch·(scalauto)·{.58 »       »       switch·(scalauto)·{
74 »       »       SCALE·(1).59 »       »       SCALE·(1)
75 »       »       SCALE·(2).60 »       »       SCALE·(2)
76 »       »       SCALE·(3).61 »       »       SCALE·(3)
77 »       »       SCALE·(4).62 »       »       SCALE·(4)
78 »       »       }.63 »       »       }
79 #·undef» SCALE.64 #·undef» SCALE
80 »       }.65 »       }
81 #·ifdef» USE_FLOAT_MUL.66 #·ifdef» USE_FLOAT_MUL
82 »       else·for·(k·=·0·;·k·<=·159·;·k++)·float_s·[k]·=·(float)·s·[k]·;.67 »       else·for·(k·=·0·;·k·<=·159·;·k++)·float_s·[k]·=·(float)·s·[k]·;
83 #·endif.68 #·endif
84 \xd 
85 »       /*··Compute·the·L_ACF·[..]..69 »       /*··Compute·the·L_ACF·[..].
86 »       ·*/.70 »       ·*/
87 »       {.71 »       {
88 #·ifdef» USE_FLOAT_MUL.72 #·ifdef» USE_FLOAT_MUL
89 »       »       register·float»  *sp·=·float_s·;.73 »       »       register·float»  *sp·=·float_s·;
90 »       »       register·float»  sl·=·*sp·;.74 »       »       register·float»  sl·=·*sp·;
91 \xd 
92 #»      »      define·STEP(k)» L_ACF·[k]·+=·(int32_t)·(sl·*·sp·[-·(k)])·;.75 #»      »      define·STEP(k)» L_ACF·[k]·+=·(int32_t)·(sl·*·sp·[-·(k)])·;
93 #·else.76 #·else
94 »       »       int16_t»*sp·=·s·;.77 »       »       int16_t»*sp·=·s·;
95 »       »       int16_t»sl·=·*sp·;.78 »       »       int16_t»sl·=·*sp·;
96 \xd 
97 #»      »      define·STEP(k)» L_ACF·[k]·+=·((int32_t)·sl·*·sp·[-·(k)])·;.79 #»      »      define·STEP(k)» L_ACF·[k]·+=·((int32_t)·sl·*·sp·[-·(k)])·;
98 #·endif.80 #·endif
99 \xd 
100 #»      define·NEXTI»   sl·=·*++sp.81 #»      define·NEXTI»   sl·=·*++sp
101 \xd 
102 \xd 
103 »       for·(k·=·9·;·k--·;·L_ACF·[k]·=·0)·;.82 »       for·(k·=·9·;·k--·;·L_ACF·[k]·=·0)·;
104 \xd 
105 »       STEP·(0)·;.83 »       STEP·(0)·;
106 »       NEXTI·;.84 »       NEXTI·;
107 »       STEP·(0)·;·STEP·(1)·;.85 »       STEP·(0)·;·STEP·(1)·;
108 »       NEXTI·;.86 »       NEXTI·;
109 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;.87 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;
110 »       NEXTI·;.88 »       NEXTI·;
111 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;.89 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;
112 »       NEXTI·;.90 »       NEXTI·;
113 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;.91 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;
114 »       NEXTI·;.92 »       NEXTI·;
115 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;.93 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;
116 »       NEXTI·;.94 »       NEXTI·;
117 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;·STEP·(6)·;.95 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;·STEP·(6)·;
118 »       NEXTI·;.96 »       NEXTI·;
119 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;·STEP·(6)·;·STEP·(7)·;.97 »       STEP·(0)·;·STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;·STEP·(5)·;·STEP·(6)·;·STEP·(7)·;
120 \xd 
121 »       for·(i·=·8·;·i·<=·159·;·i++).98 »       for·(i·=·8·;·i·<=·159·;·i++)
122 »       {»      NEXTI·;.99 »       {»      NEXTI·;
123 \xd 
124 »       »       STEP·(0)·;.100 »       »       STEP·(0)·;
125 »       »       STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;.101 »       »       STEP·(1)·;·STEP·(2)·;·STEP·(3)·;·STEP·(4)·;
126 »       »       STEP·(5)·;·STEP·(6)·;·STEP·(7)·;·STEP·(8)·;.102 »       »       STEP·(5)·;·STEP·(6)·;·STEP·(7)·;·STEP·(8)·;
127 »       »       }.103 »       »       }
Max diff block lines reached; -1/15187 bytes (-0.01%) of diff not shown.
50.6 KB
libsndfile-1.0.30/src/ms_adpcm.c
    
Offset 1, 851 lines modifiedOffset 1, 851 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include»       <stdio.h>.19 #include»       <stdio.h>
22 #include»       <stdlib.h>.20 #include»       <stdlib.h>
23 #include»       <string.h>.21 #include»       <string.h>
24 #include»       <math.h>.22 #include»       <math.h>
25 \xd 
26 #include»       "sndfile.h".23 #include»       "sndfile.h"
27 #include»       "sfendian.h".24 #include»       "sfendian.h"
28 #include»       "common.h".25 #include»       "common.h"
29 #include»       "wavlike.h".26 #include»       "wavlike.h"
30 \xd 
31 \xd 
32 typedef·struct.27 typedef·struct
33 {»      int»   »   »   »   channels,·blocksize,·samplesperblock,·blocks,·dataremaining·;.28 {»      int»   »   »   »   channels,·blocksize,·samplesperblock,·blocks,·dataremaining·;
34 »       int»    »    »    »    blockcount·;.29 »       int»    »    »    »    blockcount·;
35 »       int»    »    »    »    sync_error·;.30 »       int»    »    »    »    sync_error·;
36 »       sf_count_t»     »     samplecount·;.31 »       sf_count_t»     »     samplecount·;
37 »       short»  »  »  *samples·;.32 »       short»  »  »  *samples·;
38 »       unsigned·char»   *block·;.33 »       unsigned·char»   *block·;
39 »       short»  »  »  dummydata·[]·;·/*·ISO·C99·struct·flexible·array.·*/.34 »       short»  »  »  dummydata·[]·;·/*·ISO·C99·struct·flexible·array.·*/
40 }·MSADPCM_PRIVATE·;.35 }·MSADPCM_PRIVATE·;
41 \xd 
42 /*============================================================================================.36 /*============================================================================================
43 **·MS·ADPCM·static·data·and·functions..37 **·MS·ADPCM·static·data·and·functions.
44 */.38 */
45 \xd 
46 static·int·AdaptationTable·[]·=.39 static·int·AdaptationTable·[]·=
47 {»      230,·230,·230,·230,·307,·409,·512,·614,.40 {»      230,·230,·230,·230,·307,·409,·512,·614,
48 »       768,·614,·512,·409,·307,·230,·230,·230.41 »       768,·614,·512,·409,·307,·230,·230,·230
49 }·;.42 }·;
50 \xd 
51 /*·TODO·:·The·first·7·coef's·are·are·always·hardcode·and·must.43 /*·TODO·:·The·first·7·coef's·are·are·always·hardcode·and·must
52 ···appear·in·the·actual·WAVE·file.··They·should·be·read·in.44 ···appear·in·the·actual·WAVE·file.··They·should·be·read·in
53 ···in·case·a·sound·program·added·extras·to·the·list.·*/.45 ···in·case·a·sound·program·added·extras·to·the·list.·*/
54 \xd 
55 static·int·AdaptCoeff1·[WAVLIKE_MSADPCM_ADAPT_COEFF_COUNT]·=.46 static·int·AdaptCoeff1·[WAVLIKE_MSADPCM_ADAPT_COEFF_COUNT]·=
56 {»      256,·512,·0,·192,·240,·460,·392.47 {»      256,·512,·0,·192,·240,·460,·392
57 }·;.48 }·;
58 \xd 
59 static·int·AdaptCoeff2·[WAVLIKE_MSADPCM_ADAPT_COEFF_COUNT]·=.49 static·int·AdaptCoeff2·[WAVLIKE_MSADPCM_ADAPT_COEFF_COUNT]·=
60 {»      0,·-256,·0,·64,·0,·-208,·-232.50 {»      0,·-256,·0,·64,·0,·-208,·-232
61 }·;.51 }·;
62 \xd 
63 /*============================================================================================.52 /*============================================================================================
64 **»     MS·ADPCM·Block·Layout..53 **»     MS·ADPCM·Block·Layout.
65 **»     ======================.54 **»     ======================
66 **»     Block·is·usually·256,·512·or·1024·bytes·depending·on·sample·rate..55 **»     Block·is·usually·256,·512·or·1024·bytes·depending·on·sample·rate.
67 **»     For·a·mono·file,·the·block·is·laid·out·as·follows:.56 **»     For·a·mono·file,·the·block·is·laid·out·as·follows:
68 **»     »     byte» purpose.57 **»     »     byte» purpose
69 **»     »     0»    »    block·predictor·[0..6].58 **»     »     0»    »    block·predictor·[0..6]
70 **»     »     1,2»  »  initial·idelta·(positive).59 **»     »     1,2»  »  initial·idelta·(positive)
71 **»     »     3,4»  »  sample·1.60 **»     »     3,4»  »  sample·1
72 **»     »     5,6»  »  sample·0.61 **»     »     5,6»  »  sample·0
73 **»     »     7..n» packed·bytecodes.62 **»     »     7..n» packed·bytecodes
74 **.63 **
75 **»     For·a·stereo·file,·the·block·is·laid·out·as·follows:.64 **»     For·a·stereo·file,·the·block·is·laid·out·as·follows:
76 **»     »     byte» purpose.65 **»     »     byte» purpose
77 **»     »     0»    »    block·predictor·[0..6]·for·left·channel.66 **»     »     0»    »    block·predictor·[0..6]·for·left·channel
78 **»     »     1»    »    block·predictor·[0..6]·for·right·channel.67 **»     »     1»    »    block·predictor·[0..6]·for·right·channel
79 **»     »     2,3»  »  initial·idelta·(positive)·for·left·channel.68 **»     »     2,3»  »  initial·idelta·(positive)·for·left·channel
80 **»     »     4,5»  »  initial·idelta·(positive)·for·right·channel.69 **»     »     4,5»  »  initial·idelta·(positive)·for·right·channel
81 **»     »     6,7»  »  sample·1·for·left·channel.70 **»     »     6,7»  »  sample·1·for·left·channel
82 **»     »     8,9»  »  sample·1·for·right·channel.71 **»     »     8,9»  »  sample·1·for·right·channel
83 **»     »     10,11»sample·0·for·left·channel.72 **»     »     10,11»sample·0·for·left·channel
84 **»     »     12,13»sample·0·for·right·channel.73 **»     »     12,13»sample·0·for·right·channel
85 **»     »     14..n»packed·bytecodes.74 **»     »     14..n»packed·bytecodes
86 */.75 */
87 \xd 
88 /*============================================================================================.76 /*============================================================================================
89 **·Static·functions..77 **·Static·functions.
90 */.78 */
91 \xd 
92 static» int»      msadpcm_decode_block»  (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms)·;.79 static» int»      msadpcm_decode_block»  (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms)·;
93 static·sf_count_t·msadpcm_read_block»     (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms,·short·*ptr,·int·len)·;.80 static·sf_count_t·msadpcm_read_block»     (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms,·short·*ptr,·int·len)·;
94 \xd 
95 static» int»      msadpcm_encode_block»  (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms)·;.81 static» int»      msadpcm_encode_block»  (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms)·;
96 static·sf_count_t·msadpcm_write_block»    (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms,·const·short·*ptr,·int·len)·;.82 static·sf_count_t·msadpcm_write_block»    (SF_PRIVATE·*psf,·MSADPCM_PRIVATE·*pms,·const·short·*ptr,·int·len)·;
97 \xd 
98 static·sf_count_t»       msadpcm_read_s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.83 static·sf_count_t»       msadpcm_read_s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
99 static·sf_count_t»       msadpcm_read_i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.84 static·sf_count_t»       msadpcm_read_i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
100 static·sf_count_t»       msadpcm_read_f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.85 static·sf_count_t»       msadpcm_read_f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
101 static·sf_count_t»       msadpcm_read_d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.86 static·sf_count_t»       msadpcm_read_d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
102 \xd 
103 static·sf_count_t»       msadpcm_write_s»(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.87 static·sf_count_t»       msadpcm_write_s»(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
104 static·sf_count_t»       msadpcm_write_i»(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.88 static·sf_count_t»       msadpcm_write_i»(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
105 static·sf_count_t»       msadpcm_write_f»(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.89 static·sf_count_t»       msadpcm_write_f»(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
106 static·sf_count_t»       msadpcm_write_d»(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.90 static·sf_count_t»       msadpcm_write_d»(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
107 \xd 
108 static·sf_count_t·msadpcm_seek»   (SF_PRIVATE·*psf,·int·mode,·sf_count_t·offset)·;.91 static·sf_count_t·msadpcm_seek»   (SF_PRIVATE·*psf,·int·mode,·sf_count_t·offset)·;
109 static» int»      msadpcm_close» (SF_PRIVATE·*psf)·;.92 static» int»      msadpcm_close» (SF_PRIVATE·*psf)·;
110 \xd 
111 static» void»     choose_predictor·(unsigned·int·channels,·short·*data,·int·*bpred,·int·*idelta)·;.93 static» void»     choose_predictor·(unsigned·int·channels,·short·*data,·int·*bpred,·int·*idelta)·;
112 \xd 
113 /*============================================================================================.94 /*============================================================================================
114 **·MS·ADPCM·Read·Functions..95 **·MS·ADPCM·Read·Functions.
115 */.96 */
116 \xd 
117 int.97 int
118 wavlike_msadpcm_init»   (SF_PRIVATE·*psf,·int·blockalign,·int·samplesperblock).98 wavlike_msadpcm_init»   (SF_PRIVATE·*psf,·int·blockalign,·int·samplesperblock)
119 {»      MSADPCM_PRIVATE»       *pms·;.99 {»      MSADPCM_PRIVATE»       *pms·;
120 »       unsigned·int»    pmssize·;.100 »       unsigned·int»    pmssize·;
121 »       int»    »    »    »    count·;.101 »       int»    »    »    »    count·;
122 \xd 
123 »       if·(psf->codec_data·!=·NULL).102 »       if·(psf->codec_data·!=·NULL)
124 »       {»      psf_log_printf·(psf,·"***·psf->codec_data·is·not·NULL.\n")·;.103 »       {»      psf_log_printf·(psf,·"***·psf->codec_data·is·not·NULL.\n")·;
125 »       »       return·SFE_INTERNAL·;.104 »       »       return·SFE_INTERNAL·;
126 »       »       }·;.105 »       »       }·;
127 \xd 
Max diff block lines reached; -1/51745 bytes (-0.00%) of diff not shown.
56.3 KB
libsndfile-1.0.30/src/ogg.c
    
Offset 1, 909 lines modifiedOffset 1, 909 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2002-2019·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2002-2019·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **·Copyright·(C)·2007·John·ffitch.3 **·Copyright·(C)·2007·John·ffitch
4 **·Copyright·(C)·2018·Arthur·Taylor·<art@ified.ca>.4 **·Copyright·(C)·2018·Arthur·Taylor·<art@ified.ca>
5 **.5 **
6 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify.6 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify
7 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.7 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
8 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or.8 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or
9 **·(at·your·option)·any·later·version..9 **·(at·your·option)·any·later·version.
10 **.10 **
11 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.11 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
12 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of.12 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of
13 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the.13 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the
14 **·GNU·Lesser·General·Public·License·for·more·details..14 **·GNU·Lesser·General·Public·License·for·more·details.
15 **.15 **
16 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.16 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
17 **·along·with·this·program·;·if·not,·write·to·the·Free·Software.17 **·along·with·this·program·;·if·not,·write·to·the·Free·Software
18 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..18 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
19 */.19 */
20 \xd 
21 /*.20 /*
22 **·This·file·contains·code·based·on·OpusFile·and·Opus-Tools,·both·by.21 **·This·file·contains·code·based·on·OpusFile·and·Opus-Tools,·both·by
23 **·Xiph.Org.·COPYING·from·each·is·identical·and·is·as·follows:.22 **·Xiph.Org.·COPYING·from·each·is·identical·and·is·as·follows:
24 **.23 **
25 **·Copyright·(c)·1994-2013·Xiph.Org·Foundation·and·contributors.24 **·Copyright·(c)·1994-2013·Xiph.Org·Foundation·and·contributors
26 **.25 **
27 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without.26 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without
28 **·modification,·are·permitted·provided·that·the·following·conditions.27 **·modification,·are·permitted·provided·that·the·following·conditions
29 **·are·met:.28 **·are·met:
30 **.29 **
31 **·-·Redistributions·of·source·code·must·retain·the·above·copyright.30 **·-·Redistributions·of·source·code·must·retain·the·above·copyright
32 **·notice,·this·list·of·conditions·and·the·following·disclaimer..31 **·notice,·this·list·of·conditions·and·the·following·disclaimer.
33 **.32 **
34 **·-·Redistributions·in·binary·form·must·reproduce·the·above·copyright.33 **·-·Redistributions·in·binary·form·must·reproduce·the·above·copyright
35 **·notice,·this·list·of·conditions·and·the·following·disclaimer·in·the.34 **·notice,·this·list·of·conditions·and·the·following·disclaimer·in·the
36 **·documentation·and/or·other·materials·provided·with·the·distribution..35 **·documentation·and/or·other·materials·provided·with·the·distribution.
37 **.36 **
38 **·-·Neither·the·name·of·the·Xiph.Org·Foundation·nor·the·names·of·its.37 **·-·Neither·the·name·of·the·Xiph.Org·Foundation·nor·the·names·of·its
39 **·contributors·may·be·used·to·endorse·or·promote·products·derived·from.38 **·contributors·may·be·used·to·endorse·or·promote·products·derived·from
40 **·this·software·without·specific·prior·written·permission..39 **·this·software·without·specific·prior·written·permission.
41 **.40 **
42 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS.41 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS
43 **·``AS·IS''·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT.42 **·``AS·IS''·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT
44 **·LIMITED·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR.43 **·LIMITED·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR
45 **·A·PARTICULAR·PURPOSE·ARE·DISCLAIMED.··IN·NO·EVENT·SHALL·THE·FOUNDATION.44 **·A·PARTICULAR·PURPOSE·ARE·DISCLAIMED.··IN·NO·EVENT·SHALL·THE·FOUNDATION
46 **·OR·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,.45 **·OR·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,
47 **·SPECIAL,·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT.46 **·SPECIAL,·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT
48 **·LIMITED·TO,·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,.47 **·LIMITED·TO,·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,
49 **·DATA,·OR·PROFITS;·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY.48 **·DATA,·OR·PROFITS;·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY
50 **·THEORY·OF·LIABILITY,·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT.49 **·THEORY·OF·LIABILITY,·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT
51 **·(INCLUDING·NEGLIGENCE·OR·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE.50 **·(INCLUDING·NEGLIGENCE·OR·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE
52 **·OF·THIS·SOFTWARE,·EVEN·IF·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE..51 **·OF·THIS·SOFTWARE,·EVEN·IF·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE.
53 */.52 */
54 \xd 
55 #include·"sfconfig.h".53 #include·"sfconfig.h"
56 \xd 
57 #include·<stdio.h>.54 #include·<stdio.h>
58 #include·<fcntl.h>.55 #include·<fcntl.h>
59 #include·<string.h>.56 #include·<string.h>
60 #include·<ctype.h>.57 #include·<ctype.h>
61 #include·<time.h>.58 #include·<time.h>
62 #include·<math.h>.59 #include·<math.h>
63 \xd 
64 #if·HAVE_UNISTD_H.60 #if·HAVE_UNISTD_H
65 #include·<unistd.h>.61 #include·<unistd.h>
66 #else.62 #else
67 #include·"sf_unistd.h".63 #include·"sf_unistd.h"
68 #endif.64 #endif
69 \xd 
70 #include·"sndfile.h".65 #include·"sndfile.h"
71 #include·"sfendian.h".66 #include·"sfendian.h"
72 #include·"common.h".67 #include·"common.h"
73 \xd 
74 #if·HAVE_EXTERNAL_XIPH_LIBS.68 #if·HAVE_EXTERNAL_XIPH_LIBS
75 \xd 
76 #include·<ogg/ogg.h>.69 #include·<ogg/ogg.h>
77 \xd 
78 #include·"ogg.h".70 #include·"ogg.h"
79 \xd 
80 #define·OGG_SYNC_READ_SIZE·(2048).71 #define·OGG_SYNC_READ_SIZE·(2048)
81 #define·OGG_PAGE_SIZE_MAX·(65307).72 #define·OGG_PAGE_SIZE_MAX·(65307)
82 #define·OGG_CHUNK_SIZE·(65536).73 #define·OGG_CHUNK_SIZE·(65536)
83 #define·OGG_CHUNK_SIZE_MAX·(1024*1024).74 #define·OGG_CHUNK_SIZE_MAX·(1024*1024)
84 \xd 
85 /*.75 /*
86 ·*·The·Ogg·container·may·seem·overly·complicated,·particularly·when·used·for·a.76 ·*·The·Ogg·container·may·seem·overly·complicated,·particularly·when·used·for·a
87 ·*·on-disk·audio·file·format.·This·is·probably·because·Ogg·is·designed·with.77 ·*·on-disk·audio·file·format.·This·is·probably·because·Ogg·is·designed·with
88 ·*·streaming·rather·than·storage·as·a·priority,·and·can·handle·multiple·codec.78 ·*·streaming·rather·than·storage·as·a·priority,·and·can·handle·multiple·codec
89 ·*·payloads·multiplexed·together,·then·possibly·chained·on·top·of·that..79 ·*·payloads·multiplexed·together,·then·possibly·chained·on·top·of·that.
90 ·*·Ogg·achieves·its·goals·well,·but·it·does·lend·to·a·bit·of·a·learning·curve,.80 ·*·Ogg·achieves·its·goals·well,·but·it·does·lend·to·a·bit·of·a·learning·curve,
91 ·*·with·many·internal·structures·to·push·data·around·in·compared·to·most·sound.81 ·*·with·many·internal·structures·to·push·data·around·in·compared·to·most·sound
92 ·*·file·formats·which·only·have·a·header·and·raw·data..82 ·*·file·formats·which·only·have·a·header·and·raw·data.
93 ·*.83 ·*
94 ·*·See.84 ·*·See
95 ·*··-·[https://xiph.org/ogg/doc/oggstream.html].85 ·*··-·[https://xiph.org/ogg/doc/oggstream.html]
96 ·*··-·[https://xiph.org/ogg/doc/framing.html].86 ·*··-·[https://xiph.org/ogg/doc/framing.html]
97 ·*.87 ·*
98 ·*·libogg·Memory·Management.88 ·*·libogg·Memory·Management
99 ·*·===========================================================================.89 ·*·===========================================================================
100 ·*.90 ·*
101 ·*·libOgg's·memory·management·is·documented·in·code,·not·in·headers·or·external.91 ·*·libOgg's·memory·management·is·documented·in·code,·not·in·headers·or·external
102 ·*·documentation.·What·follows·is·not·an·attempt·to·completely·document·it,·but.92 ·*·documentation.·What·follows·is·not·an·attempt·to·completely·document·it,·but
103 ·*·an·explanation·of·the·basics..93 ·*·an·explanation·of·the·basics.
104 ·*.94 ·*
105 ·*·libOgg·has·two·data·structures·which·allocate·and·manage·data·buffers:·The.95 ·*·libOgg·has·two·data·structures·which·allocate·and·manage·data·buffers:·The
106 ·*·ogg_sync_state·structure·and·the·ogg_stream_state·structure.·The·remaining.96 ·*·ogg_sync_state·structure·and·the·ogg_stream_state·structure.·The·remaining
107 ·*·structures·of·ogg_page·and·ogg_packet·are·views·into·the·buffers·managed·by.97 ·*·structures·of·ogg_page·and·ogg_packet·are·views·into·the·buffers·managed·by
108 ·*·the·previous·structures..98 ·*·the·previous·structures.
109 ·*.99 ·*
110 ·*·ogg_sync_state·is·used·for·reading·purposes.·It·takes·a·physical·bitstream.100 ·*·ogg_sync_state·is·used·for·reading·purposes.·It·takes·a·physical·bitstream
111 ·*·and·searches·for,·validates,·and·returns·complete·Ogg·Pages.·The.101 ·*·and·searches·for,·validates,·and·returns·complete·Ogg·Pages.·The
112 ·*·ogg_sync_state·buffers·the·returned·page·data,·holding·at·most·one.102 ·*·ogg_sync_state·buffers·the·returned·page·data,·holding·at·most·one
113 ·*·complete·page·at·a·time.·A·returned·Ogg·page·remains·valid·until·any.103 ·*·complete·page·at·a·time.·A·returned·Ogg·page·remains·valid·until·any
114 ·*·operation·other·than·ogg_sync_check()·is·called..104 ·*·operation·other·than·ogg_sync_check()·is·called.
115 ·*.105 ·*
116 ·*·ogg_stream_state·is·used·for·both·reading·and·writing.·For·reading,·the.106 ·*·ogg_stream_state·is·used·for·both·reading·and·writing.·For·reading,·the
117 ·*·contents·of·an·ogg_page·is·copied·into·the·stream·state.·This·data·is.107 ·*·contents·of·an·ogg_page·is·copied·into·the·stream·state.·This·data·is
118 ·*·buffered·to·be·split·or·joined·as·necessary·into·complete·ogg_packets.·If,.108 ·*·buffered·to·be·split·or·joined·as·necessary·into·complete·ogg_packets.·If,
119 ·*·after·copying·an·ogg_page·into·an·ogg_stream_state,·packets·are·available·to.109 ·*·after·copying·an·ogg_page·into·an·ogg_stream_state,·packets·are·available·to
120 ·*·be·read,·then·all·of·those·packets·remain·in·memory·and·valid·until·either.110 ·*·be·read,·then·all·of·those·packets·remain·in·memory·and·valid·until·either
121 ·*·the·ogg_stream_state·is·reset,·destroyed,·or·a·new·ogg_page·is·read·into·it..111 ·*·the·ogg_stream_state·is·reset,·destroyed,·or·a·new·ogg_page·is·read·into·it.
122 ·*·As·the·maximum·number·of·packets·an·Ogg·Page·may·contain·is·255,·at·most·255.112 ·*·As·the·maximum·number·of·packets·an·Ogg·Page·may·contain·is·255,·at·most·255
123 ·*·packets·may·be·available·from·an·ogg_stream_state·at·one·time..113 ·*·packets·may·be·available·from·an·ogg_stream_state·at·one·time.
124 ·*.114 ·*
125 ·*·For·writing,·the·life·cycle·of·a·buffer·pointed·to·by·a·ogg_packet·is·the.115 ·*·For·writing,·the·life·cycle·of·a·buffer·pointed·to·by·a·ogg_packet·is·the
126 ·*·responsibility·of·the·caller.·Packets·written·into·an·ogg_stream_state·are.116 ·*·responsibility·of·the·caller.·Packets·written·into·an·ogg_stream_state·are
127 ·*·buffered·until·a·complete·page·is·ready·for·writing.·Pages·for·writing·out.117 ·*·buffered·until·a·complete·page·is·ready·for·writing.·Pages·for·writing·out
Max diff block lines reached; -1/57625 bytes (-0.00%) of diff not shown.
119 KB
libsndfile-1.0.30/src/ogg_opus.c
    
Offset 1, 1778 lines modifiedOffset 1, 1778 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2013-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2013-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **·Copyright·(C)·2018·Arthur·Taylor·<art@ified.ca>.3 **·Copyright·(C)·2018·Arthur·Taylor·<art@ified.ca>
4 **.4 **
5 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or.7 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the
13 **·GNU·Lesser·General·Public·License·for·more·details..13 **·GNU·Lesser·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
16 **·along·with·this·program·;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program·;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 /*.19 /*
21 **·This·file·contains·code·based·on·OpusFile·and·Opus-Tools,·both·by.20 **·This·file·contains·code·based·on·OpusFile·and·Opus-Tools,·both·by
22 **·Xiph.Org.·COPYING·from·each·is·identical·and·is·as·follows:.21 **·Xiph.Org.·COPYING·from·each·is·identical·and·is·as·follows:
23 **.22 **
24 **·Copyright·(c)·1994-2013·Xiph.Org·Foundation·and·contributors.23 **·Copyright·(c)·1994-2013·Xiph.Org·Foundation·and·contributors
25 **.24 **
26 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without.25 **·Redistribution·and·use·in·source·and·binary·forms,·with·or·without
27 **·modification,·are·permitted·provided·that·the·following·conditions.26 **·modification,·are·permitted·provided·that·the·following·conditions
28 **·are·met:.27 **·are·met:
29 **.28 **
30 **·-·Redistributions·of·source·code·must·retain·the·above·copyright.29 **·-·Redistributions·of·source·code·must·retain·the·above·copyright
31 **·notice,·this·list·of·conditions·and·the·following·disclaimer..30 **·notice,·this·list·of·conditions·and·the·following·disclaimer.
32 **.31 **
33 **·-·Redistributions·in·binary·form·must·reproduce·the·above·copyright.32 **·-·Redistributions·in·binary·form·must·reproduce·the·above·copyright
34 **·notice,·this·list·of·conditions·and·the·following·disclaimer·in·the.33 **·notice,·this·list·of·conditions·and·the·following·disclaimer·in·the
35 **·documentation·and/or·other·materials·provided·with·the·distribution..34 **·documentation·and/or·other·materials·provided·with·the·distribution.
36 **.35 **
37 **·-·Neither·the·name·of·the·Xiph.Org·Foundation·nor·the·names·of·its.36 **·-·Neither·the·name·of·the·Xiph.Org·Foundation·nor·the·names·of·its
38 **·contributors·may·be·used·to·endorse·or·promote·products·derived·from.37 **·contributors·may·be·used·to·endorse·or·promote·products·derived·from
39 **·this·software·without·specific·prior·written·permission..38 **·this·software·without·specific·prior·written·permission.
40 **.39 **
41 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS.40 **·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS
42 **·``AS·IS''·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT.41 **·``AS·IS''·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT
43 **·LIMITED·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR.42 **·LIMITED·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR
44 **·A·PARTICULAR·PURPOSE·ARE·DISCLAIMED.··IN·NO·EVENT·SHALL·THE·FOUNDATION.43 **·A·PARTICULAR·PURPOSE·ARE·DISCLAIMED.··IN·NO·EVENT·SHALL·THE·FOUNDATION
45 **·OR·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,.44 **·OR·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,
46 **·SPECIAL,·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT.45 **·SPECIAL,·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT
47 **·LIMITED·TO,·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,.46 **·LIMITED·TO,·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,
48 **·DATA,·OR·PROFITS;·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY.47 **·DATA,·OR·PROFITS;·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY
49 **·THEORY·OF·LIABILITY,·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT.48 **·THEORY·OF·LIABILITY,·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT
50 **·(INCLUDING·NEGLIGENCE·OR·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE.49 **·(INCLUDING·NEGLIGENCE·OR·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE
51 **·OF·THIS·SOFTWARE,·EVEN·IF·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE..50 **·OF·THIS·SOFTWARE,·EVEN·IF·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE.
52 */.51 */
53 \xd 
54 /*.52 /*
55 **·TODO:.53 **·TODO:
56 **··-·Channel·mapping·modification·/·reporting.54 **··-·Channel·mapping·modification·/·reporting
57 **»     ·-·connect·psf->channel_map·and·Opus·channel·mapping·somehow?.55 **»     ·-·connect·psf->channel_map·and·Opus·channel·mapping·somehow?
58 **··-·Gain·parameters·and·their·mappings.56 **··-·Gain·parameters·and·their·mappings
59 */.57 */
60 \xd 
61 /*.58 /*
62 **·Opus·Sample,·Frame,·and·Samples/Channel·Terminology.59 **·Opus·Sample,·Frame,·and·Samples/Channel·Terminology
63 **.60 **
64 **·libsndfile·refers·to·one·PCM·value·as·a·'sample,'·and·a·group·of·samples·of.61 **·libsndfile·refers·to·one·PCM·value·as·a·'sample,'·and·a·group·of·samples·of
65 **·the·same·sample·time,·one·for·each·channel,·as·a·'frame.'·This·differs·from.62 **·the·same·sample·time,·one·for·each·channel,·as·a·'frame.'·This·differs·from
66 **·Opus,·which·has·no·corresponding·name·for·sample,·and·refers·to·a·group·of.63 **·Opus,·which·has·no·corresponding·name·for·sample,·and·refers·to·a·group·of
67 **·PCM·values,·one·per·channel·(aka·libsndfile·frames)·as·'samples.'.64 **·PCM·values,·one·per·channel·(aka·libsndfile·frames)·as·'samples.'
68 **·Further,·Opus·has·an·object·called·a·'frame'·that·is·made·up·of·multiple.65 **·Further,·Opus·has·an·object·called·a·'frame'·that·is·made·up·of·multiple
69 **·Opus-samples..66 **·Opus-samples.
70 **·All·this·means·that·one·has·to·be·careful·with·what·is·meant·by·each·term..67 **·All·this·means·that·one·has·to·be·careful·with·what·is·meant·by·each·term.
71 **·In·an·attempt·to·avoid·ambiguity,·this·file·adopts·the·following·terms:.68 **·In·an·attempt·to·avoid·ambiguity,·this·file·adopts·the·following·terms:
72 **··-·Samples·shall·refer·to·discrete·PCM·values,·regardless·of·any·channel.69 **··-·Samples·shall·refer·to·discrete·PCM·values,·regardless·of·any·channel
73 **»     considerations.·This·is·the·same·as·what·libsndfile·calls·samples..70 **»     considerations.·This·is·the·same·as·what·libsndfile·calls·samples.
74 **··-·Samples/channel·shall·refer·to·groups·of·samples,·one·for·each·channel..71 **··-·Samples/channel·shall·refer·to·groups·of·samples,·one·for·each·channel.
75 **»     This·is·what·Opus·calles·samples,·and·what·libsndfile·calles·frames.·It.72 **»     This·is·what·Opus·calles·samples,·and·what·libsndfile·calles·frames.·It
76 **»     has·the·advantage·that·its·name·is·also·the·formula·to·calculate·it..73 **»     has·the·advantage·that·its·name·is·also·the·formula·to·calculate·it.
77 **.74 **
78 **.75 **
79 **·Opus·vs·OggOpus.76 **·Opus·vs·OggOpus
80 **.77 **
81 **·In·this·file·a·distinction·is·made·between·Opus·and·OggOpus.·Opus·refers·to.78 **·In·this·file·a·distinction·is·made·between·Opus·and·OggOpus.·Opus·refers·to
82 **·the·codec·alone,·support·for·which·is·by·libopus.·OggOpus·refers·to·an·Opus.79 **·the·codec·alone,·support·for·which·is·by·libopus.·OggOpus·refers·to·an·Opus
83 **·payload·encapsulated·in·an·Ogg·stream.·This·is·also·know·as·an·"Opus·file.".80 **·payload·encapsulated·in·an·Ogg·stream.·This·is·also·know·as·an·"Opus·file."
84 **·The·OggOpus·spec·includes·information·on·header·and·granule·position.81 **·The·OggOpus·spec·includes·information·on·header·and·granule·position
85 **·interpretation,·which·is·outside·of·the·scope·of·the·Opus·spec.·As·such,·an.82 **·interpretation,·which·is·outside·of·the·scope·of·the·Opus·spec.·As·such,·an
86 **·attempt·here·is·made·to·refer·to·either·Opus·or·OggOpus·depending·on·which.83 **·attempt·here·is·made·to·refer·to·either·Opus·or·OggOpus·depending·on·which
87 **·spec·is·being·referenced.·See·https://wiki.xiph.org/OggOpus.84 **·spec·is·being·referenced.·See·https://wiki.xiph.org/OggOpus
88 **.85 **
89 **.86 **
90 **·Opus·Sample·Rates.87 **·Opus·Sample·Rates
91 **.88 **
92 **·Opus·only·supports·a·fixed·number·of·sample·rates:·48kHz,·24kHz,·16kHz,.89 **·Opus·only·supports·a·fixed·number·of·sample·rates:·48kHz,·24kHz,·16kHz,
93 **·12kHz,·8kHz.·Audio·may·be·decoded·or·encoded·at·any·of·these·rates,.90 **·12kHz,·8kHz.·Audio·may·be·decoded·or·encoded·at·any·of·these·rates,
94 **·independent·of·the·rate·it·was·encoded·at·or·to·be·decoded·at·respectively..91 **·independent·of·the·rate·it·was·encoded·at·or·to·be·decoded·at·respectively.
95 **·Other·sample·rates·must·be·converted·to·one·of·these·rates..92 **·Other·sample·rates·must·be·converted·to·one·of·these·rates.
96 **.93 **
97 **·As·44.1kHz·(CD·sample·rate)·and·22.5kHz·are·popular·sample·rates,·and·to.94 **·As·44.1kHz·(CD·sample·rate)·and·22.5kHz·are·popular·sample·rates,·and·to
98 **·support·any·other·sample·rate·there·may·be,·the·Opus·header·includes·a·field.95 **·support·any·other·sample·rate·there·may·be,·the·Opus·header·includes·a·field
99 **·to·save·the·input·(original)·sample·rate·before·converting·it·to·a·supported.96 **·to·save·the·input·(original)·sample·rate·before·converting·it·to·a·supported
100 **·one.·Implementations·are·recommended·by·the·Opus·spec·to·do·a·sample·rate.97 **·one.·Implementations·are·recommended·by·the·Opus·spec·to·do·a·sample·rate
101 **·conversion·at·encode,·but·decode·at·48kHz·if·outputting·to·hardware,·or·do.98 **·conversion·at·encode,·but·decode·at·48kHz·if·outputting·to·hardware,·or·do
102 **·the·reverse·sample·rate·conversion·if·outputting·to·file..99 **·the·reverse·sample·rate·conversion·if·outputting·to·file.
103 **.100 **
104 **·Heretofore·libsndfile·does·not·contain·a·sample·rate·converter,·so·doing·the.101 **·Heretofore·libsndfile·does·not·contain·a·sample·rate·converter,·so·doing·the
105 **·sample·rate·conversion·is·not·supported.·Instead·audio·must·be·provided·by.102 **·sample·rate·conversion·is·not·supported.·Instead·audio·must·be·provided·by
106 **·the·user·at·a·supported·rate.·However,·the·input·sample·rate·field·can·be.103 **·the·user·at·a·supported·rate.·However,·the·input·sample·rate·field·can·be
107 **·set·and·retrieved·by·the·user·using·sf_command().·At·decode·we·choose·to.104 **·set·and·retrieved·by·the·user·using·sf_command().·At·decode·we·choose·to
108 **·decode·at·the·lowest·valid·rate·that·is·greater·than·or·equal·to·the·input.105 **·decode·at·the·lowest·valid·rate·that·is·greater·than·or·equal·to·the·input
109 **·sample·rate..106 **·sample·rate.
110 **.107 **
111 **.108 **
112 **·OggOpus·Granule·Positions.109 **·OggOpus·Granule·Positions
113 **.110 **
114 **·Ogg·streams·include·a·strictly·increasing·granule·position·value.·The.111 **·Ogg·streams·include·a·strictly·increasing·granule·position·value.·The
115 **·interpretation·of·this·value·is·dependent·on·the·payload·type.·For·Opus.112 **·interpretation·of·this·value·is·dependent·on·the·payload·type.·For·Opus
116 **·streams·the·granule·position·is·the·count·of·samples·in·the·stream·when.113 **·streams·the·granule·position·is·the·count·of·samples·in·the·stream·when
117 **·encoding/decoding·at·48kHz.·Note·that·the·actual·position·of·the·output.114 **·encoding/decoding·at·48kHz.·Note·that·the·actual·position·of·the·output
118 **·sample·relative·to·the·granule·position·is·offset·by·the·preskip·amount..115 **·sample·relative·to·the·granule·position·is·offset·by·the·preskip·amount.
119 **·That·is,·if·a·packet·ends·with·a·granule·position·of·x,·the·last·sample.116 **·That·is,·if·a·packet·ends·with·a·granule·position·of·x,·the·last·sample
120 **·output·when·decoding·is·actually·sample·(x·-·preskip)..117 **·output·when·decoding·is·actually·sample·(x·-·preskip).
121 **.118 **
122 **·Further,·to·allow·for·clipping·off·of·the·front·of·a·stream·without.119 **·Further,·to·allow·for·clipping·off·of·the·front·of·a·stream·without
123 **·rewriting·all·following·granule·positions,·an·Opus·stream·granule·position.120 **·rewriting·all·following·granule·positions,·an·Opus·stream·granule·position
124 **·may·be·offset·by·a·constant·amount.·This·amount·is·evident·by·comparing·the.121 **·may·be·offset·by·a·constant·amount.·This·amount·is·evident·by·comparing·the
125 **·granule·position·of·the·first·page·of·an·Opus·stream·on·which·an·audio.122 **·granule·position·of·the·first·page·of·an·Opus·stream·on·which·an·audio
126 **·packet·completes·is·greater·than·the·sum·of·the·samples·of·all·audio.123 **·packet·completes·is·greater·than·the·sum·of·the·samples·of·all·audio
127 **·packets·completed·on·the·page.·Only·the·first·such·page·is·allows·to·have·an.124 **·packets·completed·on·the·page.·Only·the·first·such·page·is·allows·to·have·an
Max diff block lines reached; -1/121806 bytes (-0.00%) of diff not shown.
7.92 KB
libsndfile-1.0.30/src/ogg_pcm.c
    
Offset 1, 167 lines modifiedOffset 1, 167 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2008-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2008-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 \xd 
20 #include·"sfconfig.h".18 #include·"sfconfig.h"
21 \xd 
22 #include·<stdio.h>.19 #include·<stdio.h>
23 #include·<fcntl.h>.20 #include·<fcntl.h>
24 #include·<string.h>.21 #include·<string.h>
25 #include·<ctype.h>.22 #include·<ctype.h>
26 #include·<time.h>.23 #include·<time.h>
27 #include·<math.h>.24 #include·<math.h>
28 \xd 
29 #if·HAVE_UNISTD_H.25 #if·HAVE_UNISTD_H
30 #include·<unistd.h>.26 #include·<unistd.h>
31 #else.27 #else
32 #include·"sf_unistd.h".28 #include·"sf_unistd.h"
33 #endif.29 #endif
34 \xd 
35 #include·"sndfile.h".30 #include·"sndfile.h"
36 #include·"sfendian.h".31 #include·"sfendian.h"
37 #include·"common.h".32 #include·"common.h"
38 \xd 
39 #if·(ENABLE_EXPERIMENTAL_CODE·&&·HAVE_EXTERNAL_XIPH_LIBS).33 #if·(ENABLE_EXPERIMENTAL_CODE·&&·HAVE_EXTERNAL_XIPH_LIBS)
40 \xd 
41 #include·<ogg/ogg.h>.34 #include·<ogg/ogg.h>
42 \xd 
43 #include·"ogg.h".35 #include·"ogg.h"
44 \xd 
45 typedef·struct.36 typedef·struct
46 {»      int32_t·serialno·;.37 {»      int32_t·serialno·;
47 \xd 
48 \xd 
49 »       void·*·state·;.38 »       void·*·state·;
50 }·OPCM_PRIVATE·;.39 }·OPCM_PRIVATE·;
51 \xd 
52 static·int»      opcm_read_header·(SF_PRIVATE·*·psf)·;.40 static·int»      opcm_read_header·(SF_PRIVATE·*·psf)·;
53 static·int»      opcm_close·(SF_PRIVATE·*psf)·;.41 static·int»      opcm_close·(SF_PRIVATE·*psf)·;
54 \xd 
55 int.42 int
56 ogg_pcm_open·(SF_PRIVATE·*psf).43 ogg_pcm_open·(SF_PRIVATE·*psf)
57 {»      OGG_PRIVATE*·odata·=·psf->container_data·;.44 {»      OGG_PRIVATE*·odata·=·psf->container_data·;
58 »       OPCM_PRIVATE*·opcm·=·calloc·(1,·sizeof·(OPCM_PRIVATE))·;.45 »       OPCM_PRIVATE*·opcm·=·calloc·(1,·sizeof·(OPCM_PRIVATE))·;
59 »       int»    error·=·0·;.46 »       int»    error·=·0·;
60 \xd 
61 »       if·(odata·==·NULL).47 »       if·(odata·==·NULL)
62 »       {»      psf_log_printf·(psf,·"%s·:·odata·is·NULL???\n",·__func__)·;.48 »       {»      psf_log_printf·(psf,·"%s·:·odata·is·NULL???\n",·__func__)·;
63 »       »       free·(opcm)·;.49 »       »       free·(opcm)·;
64 »       »       return·SFE_INTERNAL·;.50 »       »       return·SFE_INTERNAL·;
65 »       »       }·;.51 »       »       }·;
66 \xd 
67 »       psf->codec_data·=·opcm·;.52 »       psf->codec_data·=·opcm·;
68 »       if·(opcm·==·NULL).53 »       if·(opcm·==·NULL)
69 »       »       return·SFE_MALLOC_FAILED·;.54 »       »       return·SFE_MALLOC_FAILED·;
70 \xd 
71 »       if·(psf->file.mode·==·SFM_RDWR).55 »       if·(psf->file.mode·==·SFM_RDWR)
72 »       »       return·SFE_BAD_MODE_RW·;.56 »       »       return·SFE_BAD_MODE_RW·;
73 \xd 
74 »       if·(psf->file.mode·==·SFM_READ).57 »       if·(psf->file.mode·==·SFM_READ)
75 »       {»      /*·Call·this·here·so·it·only·gets·called·once,·so·no·memory·is·leaked.·*/.58 »       {»      /*·Call·this·here·so·it·only·gets·called·once,·so·no·memory·is·leaked.·*/
76 »       »       ogg_sync_init·(&odata->osync)·;.59 »       »       ogg_sync_init·(&odata->osync)·;
77 \xd 
78 »       »       if·((error·=·opcm_read_header·(psf))).60 »       »       if·((error·=·opcm_read_header·(psf)))
79 »       »       »       return·error·;.61 »       »       »       return·error·;
80 \xd 
81 #if·0.62 #if·0
82 »       »       psf->read_short»»=·opcm_read_s·;.63 »       »       psf->read_short»»=·opcm_read_s·;
83 »       »       psf->read_int»  »  =·opcm_read_i·;.64 »       »       psf->read_int»  »  =·opcm_read_i·;
84 »       »       psf->read_float»»=·opcm_read_f·;.65 »       »       psf->read_float»»=·opcm_read_f·;
85 »       »       psf->read_double»       =·opcm_read_d·;.66 »       »       psf->read_double»       =·opcm_read_d·;
86 »       »       psf->sf.frames» » =·opcm_length·(psf)·;.67 »       »       psf->sf.frames» » =·opcm_length·(psf)·;
87 #endif.68 #endif
88 »       »       }·;.69 »       »       }·;
89 \xd 
90 »       psf->codec_close·=·opcm_close·;.70 »       psf->codec_close·=·opcm_close·;
91 \xd 
92 »       if·(psf->file.mode·==·SFM_WRITE).71 »       if·(psf->file.mode·==·SFM_WRITE)
93 »       {.72 »       {
94 #if·0.73 #if·0
95 »       »       /*·Set·the·default·opcm·quality·here.·*/.74 »       »       /*·Set·the·default·opcm·quality·here.·*/
96 »       »       vdata->quality·=·0.4·;.75 »       »       vdata->quality·=·0.4·;
97 \xd 
98 »       »       psf->write_header»      =·opcm_write_header·;.76 »       »       psf->write_header»      =·opcm_write_header·;
99 »       »       psf->write_short»       =·opcm_write_s·;.77 »       »       psf->write_short»       =·opcm_write_s·;
100 »       »       psf->write_int» » =·opcm_write_i·;.78 »       »       psf->write_int» » =·opcm_write_i·;
101 »       »       psf->write_float»       =·opcm_write_f·;.79 »       »       psf->write_float»       =·opcm_write_f·;
102 »       »       psf->write_double»      =·opcm_write_d·;.80 »       »       psf->write_double»      =·opcm_write_d·;
103 #endif.81 #endif
104 \xd 
105 »       »       psf->sf.frames·=·SF_COUNT_MAX·;·/*·Unknown·really·*/.82 »       »       psf->sf.frames·=·SF_COUNT_MAX·;·/*·Unknown·really·*/
106 »       »       psf->strings.flags·=·SF_STR_ALLOW_START·;.83 »       »       psf->strings.flags·=·SF_STR_ALLOW_START·;
107 »       »       }·;.84 »       »       }·;
108 \xd 
109 »       psf->bytewidth·=·1·;.85 »       psf->bytewidth·=·1·;
110 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;.86 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;
111 \xd 
112 #if·0.87 #if·0
113 »       psf->seek·=·opcm_seek·;.88 »       psf->seek·=·opcm_seek·;
114 »       psf->command·=·opcm_command·;.89 »       psf->command·=·opcm_command·;
115 #endif.90 #endif
116 \xd 
117 »       /*·FIXME,·FIXME,·FIXME·:·Hack·these·here·for·now·and·correct·later.·*/.91 »       /*·FIXME,·FIXME,·FIXME·:·Hack·these·here·for·now·and·correct·later.·*/
118 »       psf->sf.format·=·SF_FORMAT_OGG·|·SF_FORMAT_SPEEX·;.92 »       psf->sf.format·=·SF_FORMAT_OGG·|·SF_FORMAT_SPEEX·;
119 »       psf->sf.sections·=·1·;.93 »       psf->sf.sections·=·1·;
120 \xd 
121 »       psf->datalength·=·1·;.94 »       psf->datalength·=·1·;
122 »       psf->dataoffset·=·0·;.95 »       psf->dataoffset·=·0·;
123 »       /*·End·FIXME.·*/.96 »       /*·End·FIXME.·*/
124 \xd 
125 »       return·error·;.97 »       return·error·;
126 }·/*·ogg_pcm_open·*/.98 }·/*·ogg_pcm_open·*/
127 \xd 
Max diff block lines reached; -1/8047 bytes (-0.01%) of diff not shown.
23.7 KB
libsndfile-1.0.30/src/ogg_speex.c
    
Offset 1, 428 lines modifiedOffset 1, 428 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2008-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2008-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation·;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.»       ·See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 \xd 
20 #include·"sfconfig.h".18 #include·"sfconfig.h"
21 \xd 
22 #include·<stdio.h>.19 #include·<stdio.h>
23 #include·<fcntl.h>.20 #include·<fcntl.h>
24 #include·<string.h>.21 #include·<string.h>
25 #include·<ctype.h>.22 #include·<ctype.h>
26 #include·<time.h>.23 #include·<time.h>
27 #include·<math.h>.24 #include·<math.h>
28 \xd 
29 #if·HAVE_UNISTD_H.25 #if·HAVE_UNISTD_H
30 #include·<unistd.h>.26 #include·<unistd.h>
31 #else.27 #else
32 #include·"sf_unistd.h".28 #include·"sf_unistd.h"
33 #endif.29 #endif
34 \xd 
35 #include·"sndfile.h".30 #include·"sndfile.h"
36 #include·"sfendian.h".31 #include·"sfendian.h"
37 #include·"common.h".32 #include·"common.h"
38 \xd 
39 #if·(ENABLE_EXPERIMENTAL_CODE·&&·HAVE_EXTERNAL_XIPH_LIBS).33 #if·(ENABLE_EXPERIMENTAL_CODE·&&·HAVE_EXTERNAL_XIPH_LIBS)
40 \xd 
41 #include·<ogg/ogg.h>.34 #include·<ogg/ogg.h>
42 \xd 
43 #include·<speex/speex.h>.35 #include·<speex/speex.h>
44 #include·<speex/speex_stereo.h>.36 #include·<speex/speex_stereo.h>
45 #include·<speex/speex_header.h>.37 #include·<speex/speex_header.h>
46 #include·<speex/speex_callbacks.h>.38 #include·<speex/speex_callbacks.h>
47 \xd 
48 #include·"ogg.h".39 #include·"ogg.h"
49 \xd 
50 #define»OGG_SPX_READ_SIZE»       200.40 #define»OGG_SPX_READ_SIZE»       200
51 \xd 
52 typedef·struct.41 typedef·struct
53 {»      SpeexBits·bits·;.42 {»      SpeexBits·bits·;
54 \xd 
55 »       int32_t·serialno·;.43 »       int32_t·serialno·;
56 \xd 
57 »       int·frame_size,·granule_frame_size,·nframes·;.44 »       int·frame_size,·granule_frame_size,·nframes·;
58 »       int·force_mode·;.45 »       int·force_mode·;
59 \xd 
60 »       SpeexStereoState·stereo·;.46 »       SpeexStereoState·stereo·;
61 »       SpeexHeader·header·;.47 »       SpeexHeader·header·;
62 \xd 
63 »       void·*·state·;.48 »       void·*·state·;
64 }·SPX_PRIVATE·;.49 }·SPX_PRIVATE·;
65 \xd 
66 static·int»      spx_read_header·(SF_PRIVATE·*·psf)·;.50 static·int»      spx_read_header·(SF_PRIVATE·*·psf)·;
67 static·int»      spx_close·(SF_PRIVATE·*psf)·;.51 static·int»      spx_close·(SF_PRIVATE·*psf)·;
68 static·void·*spx_header_read·(SF_PRIVATE·*·psf,·ogg_packet·*op,·spx_int32_t·enh_enabled,·int·force_mode)·;.52 static·void·*spx_header_read·(SF_PRIVATE·*·psf,·ogg_packet·*op,·spx_int32_t·enh_enabled,·int·force_mode)·;
69 static·void·spx_print_comments·(const·char·*comments,·int·length)·;.53 static·void·spx_print_comments·(const·char·*comments,·int·length)·;
70 \xd 
71 int.54 int
72 ogg_speex_open·(SF_PRIVATE·*psf).55 ogg_speex_open·(SF_PRIVATE·*psf)
73 {»      OGG_PRIVATE*·odata·=·psf->container_data·;.56 {»      OGG_PRIVATE*·odata·=·psf->container_data·;
74 »       SPX_PRIVATE*·spx·=·calloc·(1,·sizeof·(SPX_PRIVATE))·;.57 »       SPX_PRIVATE*·spx·=·calloc·(1,·sizeof·(SPX_PRIVATE))·;
75 »       int»    error·=·0·;.58 »       int»    error·=·0·;
76 \xd 
77 »       if·(odata·==·NULL).59 »       if·(odata·==·NULL)
78 »       {»      psf_log_printf·(psf,·"%s·:·odata·is·NULL???\n",·__func__)·;.60 »       {»      psf_log_printf·(psf,·"%s·:·odata·is·NULL???\n",·__func__)·;
79 »       »       free·(spx)·;.61 »       »       free·(spx)·;
80 »       »       return·SFE_INTERNAL·;.62 »       »       return·SFE_INTERNAL·;
81 »       »       }·;.63 »       »       }·;
82 \xd 
83 »       psf->codec_data·=·spx·;.64 »       psf->codec_data·=·spx·;
84 »       if·(spx·==·NULL).65 »       if·(spx·==·NULL)
85 »       »       return·SFE_MALLOC_FAILED·;.66 »       »       return·SFE_MALLOC_FAILED·;
86 \xd 
87 »       if·(psf->file.mode·==·SFM_RDWR).67 »       if·(psf->file.mode·==·SFM_RDWR)
88 »       »       return·SFE_BAD_MODE_RW·;.68 »       »       return·SFE_BAD_MODE_RW·;
89 \xd 
90 »       if·(psf->file.mode·==·SFM_READ).69 »       if·(psf->file.mode·==·SFM_READ)
91 »       {»      /*·Call·this·here·so·it·only·gets·called·once,·so·no·memory·is·leaked.·*/.70 »       {»      /*·Call·this·here·so·it·only·gets·called·once,·so·no·memory·is·leaked.·*/
92 »       »       ogg_sync_init·(&odata->osync)·;.71 »       »       ogg_sync_init·(&odata->osync)·;
93 \xd 
94 »       »       if·((error·=·spx_read_header·(psf))).72 »       »       if·((error·=·spx_read_header·(psf)))
95 »       »       »       return·error·;.73 »       »       »       return·error·;
96 \xd 
97 #if·0.74 #if·0
98 »       »       psf->read_short»»=·spx_read_s·;.75 »       »       psf->read_short»»=·spx_read_s·;
99 »       »       psf->read_int»  »  =·spx_read_i·;.76 »       »       psf->read_int»  »  =·spx_read_i·;
100 »       »       psf->read_float»»=·spx_read_f·;.77 »       »       psf->read_float»»=·spx_read_f·;
101 »       »       psf->read_double»       =·spx_read_d·;.78 »       »       psf->read_double»       =·spx_read_d·;
102 »       »       psf->sf.frames» » =·spx_length·(psf)·;.79 »       »       psf->sf.frames» » =·spx_length·(psf)·;
103 #endif.80 #endif
104 »       »       }·;.81 »       »       }·;
105 \xd 
106 »       psf->codec_close·=·spx_close·;.82 »       psf->codec_close·=·spx_close·;
107 \xd 
108 »       if·(psf->file.mode·==·SFM_WRITE).83 »       if·(psf->file.mode·==·SFM_WRITE)
109 »       {.84 »       {
110 #if·0.85 #if·0
111 »       »       /*·Set·the·default·spx·quality·here.·*/.86 »       »       /*·Set·the·default·spx·quality·here.·*/
112 »       »       vdata->quality·=·0.4·;.87 »       »       vdata->quality·=·0.4·;
113 \xd 
114 »       »       psf->write_header»      =·spx_write_header·;.88 »       »       psf->write_header»      =·spx_write_header·;
115 »       »       psf->write_short»       =·spx_write_s·;.89 »       »       psf->write_short»       =·spx_write_s·;
116 »       »       psf->write_int» » =·spx_write_i·;.90 »       »       psf->write_int» » =·spx_write_i·;
117 »       »       psf->write_float»       =·spx_write_f·;.91 »       »       psf->write_float»       =·spx_write_f·;
118 »       »       psf->write_double»      =·spx_write_d·;.92 »       »       psf->write_double»      =·spx_write_d·;
119 #endif.93 #endif
120 \xd 
121 »       »       psf->sf.frames·=·SF_COUNT_MAX·;·/*·Unknown·really·*/.94 »       »       psf->sf.frames·=·SF_COUNT_MAX·;·/*·Unknown·really·*/
122 »       »       psf->strings.flags·=·SF_STR_ALLOW_START·;.95 »       »       psf->strings.flags·=·SF_STR_ALLOW_START·;
123 »       »       }·;.96 »       »       }·;
124 \xd 
125 »       psf->bytewidth·=·1·;.97 »       psf->bytewidth·=·1·;
126 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;.98 »       psf->blockwidth·=·psf->bytewidth·*·psf->sf.channels·;
127 \xd 
Max diff block lines reached; -1/24160 bytes (-0.00%) of diff not shown.
163 KB
libsndfile-1.0.30/src/pcm.c
    
Offset 1, 2893 lines modifiedOffset 1, 2893 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2016·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include·<math.h>.19 #include·<math.h>
22 \xd 
23 #include»       "sndfile.h".20 #include»       "sndfile.h"
24 #include»       "sfendian.h".21 #include»       "sfendian.h"
25 #include»       "common.h".22 #include»       "common.h"
26 \xd 
27 /*·Need·to·be·able·to·handle·3·byte·(24·bit)·integers.·So·defined·a.23 /*·Need·to·be·able·to·handle·3·byte·(24·bit)·integers.·So·defined·a
28 **·type·and·use·SIZEOF_TRIBYTE·instead·of·(tribyte)..24 **·type·and·use·SIZEOF_TRIBYTE·instead·of·(tribyte).
29 */.25 */
30 \xd 
31 typedef»struct·tribyte.26 typedef»struct·tribyte
32 {»      uint8_t·bytes·[3]·;.27 {»      uint8_t·bytes·[3]·;
33 »       }·tribyte·;.28 »       }·tribyte·;
34 \xd 
35 #define»SIZEOF_TRIBYTE»  3.29 #define»SIZEOF_TRIBYTE»  3
36 \xd 
37 static·sf_count_t»       pcm_read_sc2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.30 static·sf_count_t»       pcm_read_sc2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
38 static·sf_count_t»       pcm_read_uc2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.31 static·sf_count_t»       pcm_read_uc2s»  (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
39 static·sf_count_t»       pcm_read_bes2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.32 static·sf_count_t»       pcm_read_bes2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
40 static·sf_count_t»       pcm_read_les2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.33 static·sf_count_t»       pcm_read_les2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
41 static·sf_count_t»       pcm_read_bet2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.34 static·sf_count_t»       pcm_read_bet2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
42 static·sf_count_t»       pcm_read_let2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.35 static·sf_count_t»       pcm_read_let2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
43 static·sf_count_t»       pcm_read_bei2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.36 static·sf_count_t»       pcm_read_bei2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
44 static·sf_count_t»       pcm_read_lei2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;.37 static·sf_count_t»       pcm_read_lei2s» (SF_PRIVATE·*psf,·short·*ptr,·sf_count_t·len)·;
45 \xd 
46 static·sf_count_t»       pcm_read_sc2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.38 static·sf_count_t»       pcm_read_sc2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
47 static·sf_count_t»       pcm_read_uc2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.39 static·sf_count_t»       pcm_read_uc2i»  (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
48 static·sf_count_t»       pcm_read_bes2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.40 static·sf_count_t»       pcm_read_bes2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
49 static·sf_count_t»       pcm_read_les2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.41 static·sf_count_t»       pcm_read_les2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
50 static·sf_count_t»       pcm_read_bet2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.42 static·sf_count_t»       pcm_read_bet2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
51 static·sf_count_t»       pcm_read_let2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.43 static·sf_count_t»       pcm_read_let2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
52 static·sf_count_t»       pcm_read_bei2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.44 static·sf_count_t»       pcm_read_bei2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
53 static·sf_count_t»       pcm_read_lei2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;.45 static·sf_count_t»       pcm_read_lei2i» (SF_PRIVATE·*psf,·int·*ptr,·sf_count_t·len)·;
54 \xd 
55 static·sf_count_t»       pcm_read_sc2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.46 static·sf_count_t»       pcm_read_sc2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
56 static·sf_count_t»       pcm_read_uc2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.47 static·sf_count_t»       pcm_read_uc2f»  (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
57 static·sf_count_t»       pcm_read_bes2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.48 static·sf_count_t»       pcm_read_bes2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
58 static·sf_count_t»       pcm_read_les2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.49 static·sf_count_t»       pcm_read_les2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
59 static·sf_count_t»       pcm_read_bet2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.50 static·sf_count_t»       pcm_read_bet2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
60 static·sf_count_t»       pcm_read_let2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.51 static·sf_count_t»       pcm_read_let2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
61 static·sf_count_t»       pcm_read_bei2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.52 static·sf_count_t»       pcm_read_bei2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
62 static·sf_count_t»       pcm_read_lei2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;.53 static·sf_count_t»       pcm_read_lei2f» (SF_PRIVATE·*psf,·float·*ptr,·sf_count_t·len)·;
63 \xd 
64 static·sf_count_t»       pcm_read_sc2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.54 static·sf_count_t»       pcm_read_sc2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
65 static·sf_count_t»       pcm_read_uc2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.55 static·sf_count_t»       pcm_read_uc2d»  (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
66 static·sf_count_t»       pcm_read_bes2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.56 static·sf_count_t»       pcm_read_bes2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
67 static·sf_count_t»       pcm_read_les2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.57 static·sf_count_t»       pcm_read_les2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
68 static·sf_count_t»       pcm_read_bet2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.58 static·sf_count_t»       pcm_read_bet2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
69 static·sf_count_t»       pcm_read_let2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.59 static·sf_count_t»       pcm_read_let2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
70 static·sf_count_t»       pcm_read_bei2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.60 static·sf_count_t»       pcm_read_bei2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
71 static·sf_count_t»       pcm_read_lei2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;.61 static·sf_count_t»       pcm_read_lei2d» (SF_PRIVATE·*psf,·double·*ptr,·sf_count_t·len)·;
72 \xd 
73 static·sf_count_t»       pcm_write_s2sc» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.62 static·sf_count_t»       pcm_write_s2sc» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
74 static·sf_count_t»       pcm_write_s2uc» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.63 static·sf_count_t»       pcm_write_s2uc» (SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
75 static·sf_count_t»       pcm_write_s2bes·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.64 static·sf_count_t»       pcm_write_s2bes·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
76 static·sf_count_t»       pcm_write_s2les·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.65 static·sf_count_t»       pcm_write_s2les·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
77 static·sf_count_t»       pcm_write_s2bet·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.66 static·sf_count_t»       pcm_write_s2bet·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
78 static·sf_count_t»       pcm_write_s2let·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.67 static·sf_count_t»       pcm_write_s2let·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
79 static·sf_count_t»       pcm_write_s2bei·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.68 static·sf_count_t»       pcm_write_s2bei·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
80 static·sf_count_t»       pcm_write_s2lei·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;.69 static·sf_count_t»       pcm_write_s2lei·(SF_PRIVATE·*psf,·const·short·*ptr,·sf_count_t·len)·;
81 \xd 
82 static·sf_count_t»       pcm_write_i2sc» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.70 static·sf_count_t»       pcm_write_i2sc» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
83 static·sf_count_t»       pcm_write_i2uc» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.71 static·sf_count_t»       pcm_write_i2uc» (SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
84 static·sf_count_t»       pcm_write_i2bes·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.72 static·sf_count_t»       pcm_write_i2bes·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
85 static·sf_count_t»       pcm_write_i2les·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.73 static·sf_count_t»       pcm_write_i2les·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
86 static·sf_count_t»       pcm_write_i2bet·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.74 static·sf_count_t»       pcm_write_i2bet·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
87 static·sf_count_t»       pcm_write_i2let·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.75 static·sf_count_t»       pcm_write_i2let·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
88 static·sf_count_t»       pcm_write_i2bei·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.76 static·sf_count_t»       pcm_write_i2bei·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
89 static·sf_count_t»       pcm_write_i2lei·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;.77 static·sf_count_t»       pcm_write_i2lei·(SF_PRIVATE·*psf,·const·int·*ptr,·sf_count_t·len)·;
90 \xd 
91 static·sf_count_t»       pcm_write_f2sc» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.78 static·sf_count_t»       pcm_write_f2sc» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
92 static·sf_count_t»       pcm_write_f2uc» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.79 static·sf_count_t»       pcm_write_f2uc» (SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
93 static·sf_count_t»       pcm_write_f2bes·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.80 static·sf_count_t»       pcm_write_f2bes·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
94 static·sf_count_t»       pcm_write_f2les·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.81 static·sf_count_t»       pcm_write_f2les·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
95 static·sf_count_t»       pcm_write_f2bet·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.82 static·sf_count_t»       pcm_write_f2bet·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
96 static·sf_count_t»       pcm_write_f2let·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.83 static·sf_count_t»       pcm_write_f2let·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
97 static·sf_count_t»       pcm_write_f2bei·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.84 static·sf_count_t»       pcm_write_f2bei·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
98 static·sf_count_t»       pcm_write_f2lei·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;.85 static·sf_count_t»       pcm_write_f2lei·(SF_PRIVATE·*psf,·const·float·*ptr,·sf_count_t·len)·;
99 \xd 
100 static·sf_count_t»       pcm_write_d2sc» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.86 static·sf_count_t»       pcm_write_d2sc» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
101 static·sf_count_t»       pcm_write_d2uc» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.87 static·sf_count_t»       pcm_write_d2uc» (SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
102 static·sf_count_t»       pcm_write_d2bes·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.88 static·sf_count_t»       pcm_write_d2bes·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
103 static·sf_count_t»       pcm_write_d2les·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.89 static·sf_count_t»       pcm_write_d2les·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
104 static·sf_count_t»       pcm_write_d2bet·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.90 static·sf_count_t»       pcm_write_d2bet·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
105 static·sf_count_t»       pcm_write_d2let·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.91 static·sf_count_t»       pcm_write_d2let·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
106 static·sf_count_t»       pcm_write_d2bei·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.92 static·sf_count_t»       pcm_write_d2bei·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
107 static·sf_count_t»       pcm_write_d2lei·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;.93 static·sf_count_t»       pcm_write_d2lei·(SF_PRIVATE·*psf,·const·double·*ptr,·sf_count_t·len)·;
108 \xd 
109 /*-----------------------------------------------------------------------------------------------.94 /*-----------------------------------------------------------------------------------------------
110 */.95 */
111 \xd 
112 enum.96 enum
113 {»      /*·Char·type·for·8·bit·files.·*/.97 {»      /*·Char·type·for·8·bit·files.·*/
114 »       SF_CHARS_SIGNED»»=·200,.98 »       SF_CHARS_SIGNED»»=·200,
115 »       SF_CHARS_UNSIGNED»      =·201.99 »       SF_CHARS_UNSIGNED»      =·201
116 }·;.100 }·;
117 \xd 
118 /*-----------------------------------------------------------------------------------------------.101 /*-----------------------------------------------------------------------------------------------
119 */.102 */
120 \xd 
121 int.103 int
122 pcm_init·(SF_PRIVATE·*psf).104 pcm_init·(SF_PRIVATE·*psf)
123 {»      int·chars·=·0·;.105 {»      int·chars·=·0·;
124 \xd 
125 »       if·(psf->bytewidth·==·0·||·psf->sf.channels·==·0).106 »       if·(psf->bytewidth·==·0·||·psf->sf.channels·==·0)
126 »       {»      psf_log_printf·(psf,·"pcm_init·:·internal·error·:·bytewitdh·=·%d,·channels·=·%d\n",·psf->bytewidth,·psf->sf.channels)·;.107 »       {»      psf_log_printf·(psf,·"pcm_init·:·internal·error·:·bytewitdh·=·%d,·channels·=·%d\n",·psf->bytewidth,·psf->sf.channels)·;
127 »       »       return·SFE_INTERNAL·;.108 »       »       return·SFE_INTERNAL·;
Max diff block lines reached; -1/167333 bytes (-0.00%) of diff not shown.
38.7 KB
libsndfile-1.0.30/src/sd2.c
    
Offset 1, 619 lines modifiedOffset 1, 619 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2001-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2001-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **·Copyright·(C)·2004·Paavo·Jumppanen.3 **·Copyright·(C)·2004·Paavo·Jumppanen
4 **.4 **
5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
13 **·GNU·Lesser·General·Public·License·for·more·details..13 **·GNU·Lesser·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
16 **·along·with·this·program;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 /*.19 /*
21 **·The·sd2·support·implemented·in·this·file·was·partially·sponsored.20 **·The·sd2·support·implemented·in·this·file·was·partially·sponsored
22 **·(financially)·by·Paavo·Jumppanen..21 **·(financially)·by·Paavo·Jumppanen.
23 */.22 */
24 \xd 
25 /*.23 /*
26 **·Documentation·on·the·Mac·resource·fork·was·obtained·here·:.24 **·Documentation·on·the·Mac·resource·fork·was·obtained·here·:
27 **·http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-99.html.25 **·http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-99.html
28 */.26 */
29 \xd 
30 #include»       "sfconfig.h".27 #include»       "sfconfig.h"
31 \xd 
32 #include»       <stdio.h>.28 #include»       <stdio.h>
33 #include»       <stdlib.h>.29 #include»       <stdlib.h>
34 #include»       <string.h>.30 #include»       <string.h>
35 #include»       <ctype.h>.31 #include»       <ctype.h>
36 \xd 
37 #include»       "sndfile.h".32 #include»       "sndfile.h"
38 #include»       "sfendian.h".33 #include»       "sfendian.h"
39 #include»       "common.h".34 #include»       "common.h"
40 \xd 
41 /*------------------------------------------------------------------------------.35 /*------------------------------------------------------------------------------
42 ·*·Markers..36 ·*·Markers.
43 */.37 */
44 \xd 
45 #define»Sd2f_MARKER»     »     »     MAKE_MARKER·('S',·'d',·'2',·'f').38 #define»Sd2f_MARKER»     »     »     MAKE_MARKER·('S',·'d',·'2',·'f')
46 #define»Sd2a_MARKER»     »     »     MAKE_MARKER·('S',·'d',·'2',·'a').39 #define»Sd2a_MARKER»     »     »     MAKE_MARKER·('S',·'d',·'2',·'a')
47 #define»ALCH_MARKER»     »     »     MAKE_MARKER·('A',·'L',·'C',·'H').40 #define»ALCH_MARKER»     »     »     MAKE_MARKER·('A',·'L',·'C',·'H')
48 #define·lsf1_MARKER»     »     »     MAKE_MARKER·('l',·'s',·'f',·'1').41 #define·lsf1_MARKER»     »     »     MAKE_MARKER·('l',·'s',·'f',·'1')
49 \xd 
50 #define·STR_MARKER»      »      »      MAKE_MARKER·('S',·'T',·'R',·'·').42 #define·STR_MARKER»      »      »      MAKE_MARKER·('S',·'T',·'R',·'·')
51 #define·sdML_MARKER»     »     »     MAKE_MARKER·('s',·'d',·'M',·'L').43 #define·sdML_MARKER»     »     »     MAKE_MARKER·('s',·'d',·'M',·'L')
52 \xd 
53 enum.44 enum
54 {»      RSRC_STR·=·111,.45 {»      RSRC_STR·=·111,
55 »       RSRC_BIN.46 »       RSRC_BIN
56 }·;.47 }·;
57 \xd 
58 typedef·struct.48 typedef·struct
59 {»      unsigned·char·*·rsrc_data·;.49 {»      unsigned·char·*·rsrc_data·;
60 »       int·rsrc_len·;.50 »       int·rsrc_len·;
61 »       int·need_to_free_rsrc_data·;.51 »       int·need_to_free_rsrc_data·;
62 \xd 
63 »       int·data_offset,·data_length·;.52 »       int·data_offset,·data_length·;
64 »       int·map_offset,·map_length·;.53 »       int·map_offset,·map_length·;
65 \xd 
66 »       int·type_count,·type_offset·;.54 »       int·type_count,·type_offset·;
67 »       int·item_offset·;.55 »       int·item_offset·;
68 \xd 
69 »       int·str_index,·str_count·;.56 »       int·str_index,·str_count·;
70 \xd 
71 »       int·string_offset·;.57 »       int·string_offset·;
72 \xd 
73 »       /*·All·the·above·just·to·get·these·three.·*/.58 »       /*·All·the·above·just·to·get·these·three.·*/
74 »       int·sample_size,·sample_rate,·channels·;.59 »       int·sample_size,·sample_rate,·channels·;
75 }·SD2_RSRC·;.60 }·SD2_RSRC·;
76 \xd 
77 typedef·struct.61 typedef·struct
78 {»      int·type·;.62 {»      int·type·;
79 »       int·id·;.63 »       int·id·;
80 »       char·name·[32]·;.64 »       char·name·[32]·;
81 »       char·value·[32]·;.65 »       char·value·[32]·;
82 »       int·value_len·;.66 »       int·value_len·;
83 }·STR_RSRC·;.67 }·STR_RSRC·;
84 \xd 
85 /*------------------------------------------------------------------------------.68 /*------------------------------------------------------------------------------
86 ·*·Private·static·functions..69 ·*·Private·static·functions.
87 */.70 */
88 \xd 
89 static·int·sd2_close»     (SF_PRIVATE·*psf)·;.71 static·int·sd2_close»     (SF_PRIVATE·*psf)·;
90 \xd 
91 static·int·sd2_parse_rsrc_fork·(SF_PRIVATE·*psf)·;.72 static·int·sd2_parse_rsrc_fork·(SF_PRIVATE·*psf)·;
92 static·int·parse_str_rsrc·(SF_PRIVATE·*psf,·SD2_RSRC·*·rsrc)·;.73 static·int·parse_str_rsrc·(SF_PRIVATE·*psf,·SD2_RSRC·*·rsrc)·;
93 \xd 
94 static·int·sd2_write_rsrc_fork·(SF_PRIVATE·*psf,·int·calc_length)·;.74 static·int·sd2_write_rsrc_fork·(SF_PRIVATE·*psf,·int·calc_length)·;
95 \xd 
96 /*------------------------------------------------------------------------------.75 /*------------------------------------------------------------------------------
97 **·Public·functions..76 **·Public·functions.
98 */.77 */
99 \xd 
100 int.78 int
101 sd2_open·(SF_PRIVATE·*psf).79 sd2_open·(SF_PRIVATE·*psf)
102 {»      int·subformat,·error·=·0,·valid·;.80 {»      int·subformat,·error·=·0,·valid·;
103 \xd 
104 »       /*·SD2·is·always·big·endian.·*/.81 »       /*·SD2·is·always·big·endian.·*/
105 »       psf->endian·=·SF_ENDIAN_BIG·;.82 »       psf->endian·=·SF_ENDIAN_BIG·;
106 \xd 
107 »       if·(psf->file.mode·==·SFM_READ·||·(psf->file.mode·==·SFM_RDWR·&&·psf->rsrclength·>·0)).83 »       if·(psf->file.mode·==·SFM_READ·||·(psf->file.mode·==·SFM_RDWR·&&·psf->rsrclength·>·0))
108 »       {»      psf_use_rsrc·(psf,·SF_TRUE)·;.84 »       {»      psf_use_rsrc·(psf,·SF_TRUE)·;
109 »       »       valid·=·psf_file_valid·(psf)·;.85 »       »       valid·=·psf_file_valid·(psf)·;
110 »       »       psf_use_rsrc·(psf,·SF_FALSE)·;.86 »       »       psf_use_rsrc·(psf,·SF_FALSE)·;
111 »       »       if·(!·valid).87 »       »       if·(!·valid)
112 »       »       {»      psf_log_printf·(psf,·"sd2_open·:·psf->rsrc.filedes·<·0\n")·;.88 »       »       {»      psf_log_printf·(psf,·"sd2_open·:·psf->rsrc.filedes·<·0\n")·;
113 »       »       »       return·SFE_SD2_BAD_RSRC·;.89 »       »       »       return·SFE_SD2_BAD_RSRC·;
114 »       »       »       }·;.90 »       »       »       }·;
115 \xd 
116 »       »       error·=·sd2_parse_rsrc_fork·(psf)·;.91 »       »       error·=·sd2_parse_rsrc_fork·(psf)·;
117 \xd 
118 »       »       if·(error).92 »       »       if·(error)
119 »       »       »       goto·error_cleanup·;.93 »       »       »       goto·error_cleanup·;
120 »       »       }·;.94 »       »       }·;
121 \xd 
122 »       if·((SF_CONTAINER·(psf->sf.format))·!=·SF_FORMAT_SD2).95 »       if·((SF_CONTAINER·(psf->sf.format))·!=·SF_FORMAT_SD2)
123 »       {»      error·=·SFE_BAD_OPEN_FORMAT·;.96 »       {»      error·=·SFE_BAD_OPEN_FORMAT·;
124 »       »       goto·error_cleanup·;.97 »       »       goto·error_cleanup·;
125 »       »       }·;.98 »       »       }·;
126 \xd 
127 »       subformat·=·SF_CODEC·(psf->sf.format)·;.99 »       subformat·=·SF_CODEC·(psf->sf.format)·;
Max diff block lines reached; -1/39623 bytes (-0.00%) of diff not shown.
20.4 KB
libsndfile-1.0.30/src/sfendian.h
    
Offset 1, 378 lines modifiedOffset 1, 378 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #ifndef·SFENDIAN_INCLUDED.18 #ifndef·SFENDIAN_INCLUDED
20 #define·SFENDIAN_INCLUDED.19 #define·SFENDIAN_INCLUDED
21 \xd 
22 #include·"sfconfig.h".20 #include·"sfconfig.h"
23 \xd 
24 #include·<stdint.h>.21 #include·<stdint.h>
25 #include·<inttypes.h>.22 #include·<inttypes.h>
26 \xd 
27 #if·HAVE_BYTESWAP_H»     »     »     /*·Linux,·any·CPU·*/.23 #if·HAVE_BYTESWAP_H»     »     »     /*·Linux,·any·CPU·*/
28 #include·<byteswap.h>.24 #include·<byteswap.h>
29 \xd 
30 #define»ENDSWAP_16(x)»   »   (bswap_16·(x)).25 #define»ENDSWAP_16(x)»   »   (bswap_16·(x))
31 #define»ENDSWAP_32(x)»   »   (bswap_32·(x)).26 #define»ENDSWAP_32(x)»   »   (bswap_32·(x))
32 #define»ENDSWAP_64(x)»   »   (bswap_64·(x)).27 #define»ENDSWAP_64(x)»   »   (bswap_64·(x))
33 \xd 
34 #elif·defined·__has_builtin.28 #elif·defined·__has_builtin
35 \xd 
36 #if·__has_builtin·(__builtin_bswap16).29 #if·__has_builtin·(__builtin_bswap16)
37 #define·ENDSWAP_16(x)·((int16_t)·__builtin_bswap16·((uint16_t)·x)).30 #define·ENDSWAP_16(x)·((int16_t)·__builtin_bswap16·((uint16_t)·x))
38 #endif.31 #endif
39 \xd 
40 #if·__has_builtin·(__builtin_bswap32).32 #if·__has_builtin·(__builtin_bswap32)
41 #define·ENDSWAP_32(x)·((int32_t)·__builtin_bswap32·((uint32_t)·x)).33 #define·ENDSWAP_32(x)·((int32_t)·__builtin_bswap32·((uint32_t)·x))
42 #endif.34 #endif
43 \xd 
44 #if·__has_builtin·(__builtin_bswap64).35 #if·__has_builtin·(__builtin_bswap64)
45 #define·ENDSWAP_64(x)·((int64_t)·__builtin_bswap64·((uint64_t)·x)).36 #define·ENDSWAP_64(x)·((int64_t)·__builtin_bswap64·((uint64_t)·x))
46 #endif.37 #endif
47 \xd 
48 #elif·COMPILER_IS_GCC.38 #elif·COMPILER_IS_GCC
49 \xd 
50 #if·CPU_IS_X86.39 #if·CPU_IS_X86
51 \xd 
52 static·inline·int16_t.40 static·inline·int16_t
53 ENDSWAP_16X·(int16_t·x).41 ENDSWAP_16X·(int16_t·x)
54 {»      int16_t·y·;.42 {»      int16_t·y·;
55 »       __asm__·("rorw·$8,·%w0"·:·"=r"·(y)·:·"0"·(x)·:·"cc")·;.43 »       __asm__·("rorw·$8,·%w0"·:·"=r"·(y)·:·"0"·(x)·:·"cc")·;
56 »       return·y·;.44 »       return·y·;
57 }·/*·ENDSWAP_16·*/.45 }·/*·ENDSWAP_16·*/
58 \xd 
59 static·inline·int32_t.46 static·inline·int32_t
60 ENDSWAP_32X·(int32_t·x).47 ENDSWAP_32X·(int32_t·x)
61 {»      int32_t·y·;.48 {»      int32_t·y·;
62 »       __asm__·("bswap·%0"·:·"=r"·(y)·:·"0"·(x))·;.49 »       __asm__·("bswap·%0"·:·"=r"·(y)·:·"0"·(x))·;
63 »       return·y·;.50 »       return·y·;
64 }·/*·ENDSWAP_32·*/.51 }·/*·ENDSWAP_32·*/
65 \xd 
66 #define·ENDSWAP_16·ENDSWAP_16X.52 #define·ENDSWAP_16·ENDSWAP_16X
67 #define·ENDSWAP_32·ENDSWAP_32X.53 #define·ENDSWAP_32·ENDSWAP_32X
68 \xd 
69 #endif.54 #endif
70 \xd 
71 #if·CPU_IS_X86_64.55 #if·CPU_IS_X86_64
72 \xd 
73 static·inline·int64_t.56 static·inline·int64_t
74 ENDSWAP_64X·(int64_t·x).57 ENDSWAP_64X·(int64_t·x)
75 {»      int64_t·y·;.58 {»      int64_t·y·;
76 »       __asm__·("bswap·%q0"·:·"=r"·(y)·:·"0"·(x))·;.59 »       __asm__·("bswap·%q0"·:·"=r"·(y)·:·"0"·(x))·;
77 »       return·y·;.60 »       return·y·;
78 }·/*·ENDSWAP_64X·*/.61 }·/*·ENDSWAP_64X·*/
79 \xd 
80 #define·ENDSWAP_64·ENDSWAP_64X.62 #define·ENDSWAP_64·ENDSWAP_64X
81 \xd 
82 #endif.63 #endif
83 \xd 
84 #elif·defined·_MSC_VER.64 #elif·defined·_MSC_VER
85 #include·<stdlib.h>.65 #include·<stdlib.h>
86 \xd 
87 #define»ENDSWAP_16(x)»   »   (_byteswap_ushort·(x)).66 #define»ENDSWAP_16(x)»   »   (_byteswap_ushort·(x))
88 #define»ENDSWAP_32(x)»   »   (_byteswap_ulong·(x)).67 #define»ENDSWAP_32(x)»   »   (_byteswap_ulong·(x))
89 #define»ENDSWAP_64(x)»   »   (_byteswap_uint64·(x)).68 #define»ENDSWAP_64(x)»   »   (_byteswap_uint64·(x))
90 \xd 
91 #endif.69 #endif
92 \xd 
93 #ifndef·ENDSWAP_16.70 #ifndef·ENDSWAP_16
94 #define»ENDSWAP_16(x)»   »   ((((x)·>>·8)·&·0xFF)·+·(((x)·&·0xFF)·<<·8)).71 #define»ENDSWAP_16(x)»   »   ((((x)·>>·8)·&·0xFF)·+·(((x)·&·0xFF)·<<·8))
95 #endif.72 #endif
96 \xd 
97 #ifndef·ENDSWAP_32.73 #ifndef·ENDSWAP_32
98 #define»ENDSWAP_32(x)»   »   ((((x)·>>·24)·&·0xFF)·+·(((x)·>>·8)·&·0xFF00)·+·(((x)·&·0xFF00)·<<·8)·+·(((x)·&·0xFF)·<<·24)).74 #define»ENDSWAP_32(x)»   »   ((((x)·>>·24)·&·0xFF)·+·(((x)·>>·8)·&·0xFF00)·+·(((x)·&·0xFF00)·<<·8)·+·(((x)·&·0xFF)·<<·24))
99 #endif.75 #endif
100 \xd 
101 #ifndef·ENDSWAP_64.76 #ifndef·ENDSWAP_64
102 static·inline·uint64_t.77 static·inline·uint64_t
103 ENDSWAP_64·(uint64_t·x).78 ENDSWAP_64·(uint64_t·x)
104 {»      union.79 {»      union
105 »       {»      uint32_t·parts·[2]·;.80 »       {»      uint32_t·parts·[2]·;
106 »       »       uint64_t·whole·;.81 »       »       uint64_t·whole·;
107 »       }·u·;.82 »       }·u·;
108 »       uint32_t·temp·;.83 »       uint32_t·temp·;
109 \xd 
110 »       u.whole·=·x·;.84 »       u.whole·=·x·;
111 »       temp·=·u.parts·[0]·;.85 »       temp·=·u.parts·[0]·;
112 »       u.parts·[0]·=·ENDSWAP_32·(u.parts·[1])·;.86 »       u.parts·[0]·=·ENDSWAP_32·(u.parts·[1])·;
113 »       u.parts·[1]·=·ENDSWAP_32·(temp)·;.87 »       u.parts·[1]·=·ENDSWAP_32·(temp)·;
114 »       return·u.whole·;.88 »       return·u.whole·;
115 }.89 }
116 #endif.90 #endif
117 \xd 
118 /*.91 /*
119 **·Many·file·types·(ie·WAV,·AIFF)·use·sets·of·four·consecutive·bytes·as·a.92 **·Many·file·types·(ie·WAV,·AIFF)·use·sets·of·four·consecutive·bytes·as·a
120 **·marker·indicating·different·sections·of·the·file..93 **·marker·indicating·different·sections·of·the·file.
121 **·The·following·MAKE_MARKER·macro·allows·th·creation·of·integer·constants.94 **·The·following·MAKE_MARKER·macro·allows·th·creation·of·integer·constants
122 **·for·these·markers..95 **·for·these·markers.
123 */.96 */
124 \xd 
125 #if·(CPU_IS_LITTLE_ENDIAN·==·1).97 #if·(CPU_IS_LITTLE_ENDIAN·==·1)
126 »       #define»MAKE_MARKER(a,·b,·c,·d)»    »    ((uint32_t)·((a)·|·((b)·<<·8)·|·((c)·<<·16)·|·(((uint32_t)·(d))·<<·24))).98 »       #define»MAKE_MARKER(a,·b,·c,·d)»    »    ((uint32_t)·((a)·|·((b)·<<·8)·|·((c)·<<·16)·|·(((uint32_t)·(d))·<<·24)))
127 #elif·(CPU_IS_BIG_ENDIAN·==·1).99 #elif·(CPU_IS_BIG_ENDIAN·==·1)
Max diff block lines reached; -1/20810 bytes (-0.00%) of diff not shown.
5.62 KB
libsndfile-1.0.30/src/sf_unistd.h
    
Offset 1, 112 lines modifiedOffset 1, 112 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2002-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2002-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 /*·Microsoft·declares·some·'unistd.h'·functions·in·'io.h'.·*/.18 /*·Microsoft·declares·some·'unistd.h'·functions·in·'io.h'.·*/
20 \xd 
21 #include·<sys/stat.h>.19 #include·<sys/stat.h>
22 #ifdef·HAVE_IO_H.20 #ifdef·HAVE_IO_H
23 #include·<io.h>.21 #include·<io.h>
24 #endif.22 #endif
25 \xd 
26 /*·Some·defines·that·microsoft·'forgot'·to·implement.·*/.23 /*·Some·defines·that·microsoft·'forgot'·to·implement.·*/
27 \xd 
28 #ifndef·R_OK.24 #ifndef·R_OK
29 #define·R_OK»    4»   »   /*·Test·for·read·permission.··*/.25 #define·R_OK»    4»   »   /*·Test·for·read·permission.··*/
30 #endif.26 #endif
31 \xd 
32 #ifndef·W_OK.27 #ifndef·W_OK
33 #define·W_OK»    2»   »   /*·Test·for·write·permission.··*/.28 #define·W_OK»    2»   »   /*·Test·for·write·permission.··*/
34 #endif.29 #endif
35 \xd 
36 #ifndef·X_OK.30 #ifndef·X_OK
37 #ifdef·_WIN32.31 #ifdef·_WIN32
38 #define»X_OK»    0.32 #define»X_OK»    0
39 #else.33 #else
40 #define»X_OK»    1»   »   /*·execute·permission·-·unsupported·in·windows*/.34 #define»X_OK»    1»   »   /*·execute·permission·-·unsupported·in·windows*/
41 #endif.35 #endif
42 #endif.36 #endif
43 \xd 
44 #ifndef·F_OK.37 #ifndef·F_OK
45 #define»F_OK»    0»   »   /*·Test·for·existence.··*/.38 #define»F_OK»    0»   »   /*·Test·for·existence.··*/
46 #endif.39 #endif
47 \xd 
48 #ifndef·S_IRWXU.40 #ifndef·S_IRWXU
49 #define»S_IRWXU·» 0000700»  /*·rwx,·owner·*/.41 #define»S_IRWXU·» 0000700»  /*·rwx,·owner·*/
50 #endif.42 #endif
51 \xd 
52 #ifndef»»S_IRUSR.43 #ifndef»»S_IRUSR
53 #define»»S_IRUSR» 0000400»  /*·read·permission,·owner·*/.44 #define»»S_IRUSR» 0000400»  /*·read·permission,·owner·*/
54 #endif.45 #endif
55 \xd 
56 #ifndef»»S_IWUSR.46 #ifndef»»S_IWUSR
57 #define»»S_IWUSR» 0000200»  /*·write·permission,·owner·*/.47 #define»»S_IWUSR» 0000200»  /*·write·permission,·owner·*/
58 #endif.48 #endif
59 \xd 
60 #ifndef»»S_IXUSR.49 #ifndef»»S_IXUSR
61 #define»»S_IXUSR» 0000100»  /*·execute/search·permission,·owner·*/.50 #define»»S_IXUSR» 0000100»  /*·execute/search·permission,·owner·*/
62 #endif.51 #endif
63 \xd 
64 /*·Windows·(except·MinGW)·doesn't·have·group·permissions·so·set·all·these·to·zero.·*/.52 /*·Windows·(except·MinGW)·doesn't·have·group·permissions·so·set·all·these·to·zero.·*/
65 #ifndef·S_IRWXG.53 #ifndef·S_IRWXG
66 #define·S_IRWXG» » 0»/*·rwx,·group·*/.54 #define·S_IRWXG» » 0»/*·rwx,·group·*/
67 #endif.55 #endif
68 \xd 
69 #ifndef·S_IRGRP.56 #ifndef·S_IRGRP
70 #define·S_IRGRP» » 0»/*·read·permission,·group·*/.57 #define·S_IRGRP» » 0»/*·read·permission,·group·*/
71 #endif.58 #endif
72 \xd 
73 #ifndef·S_IWGRP.59 #ifndef·S_IWGRP
74 #define·S_IWGRP» » 0»/*·write·permission,·grougroup·*/.60 #define·S_IWGRP» » 0»/*·write·permission,·grougroup·*/
75 #endif.61 #endif
76 \xd 
77 #ifndef·S_IXGRP.62 #ifndef·S_IXGRP
78 #define·S_IXGRP» » 0»/*·execute/search·permission,·group·*/.63 #define·S_IXGRP» » 0»/*·execute/search·permission,·group·*/
79 #endif.64 #endif
80 \xd 
81 /*·Windows·(except·MinGW)·doesn't·have·others·permissions·so·set·all·these·to·zero.·*/.65 /*·Windows·(except·MinGW)·doesn't·have·others·permissions·so·set·all·these·to·zero.·*/
82 #ifndef·S_IRWXO.66 #ifndef·S_IRWXO
83 #define·S_IRWXO» » 0»/*·rwx,·other·*/.67 #define·S_IRWXO» » 0»/*·rwx,·other·*/
84 #endif.68 #endif
85 \xd 
86 #ifndef·S_IROTH.69 #ifndef·S_IROTH
87 #define·S_IROTH» » 0»/*·read·permission,·other·*/.70 #define·S_IROTH» » 0»/*·read·permission,·other·*/
88 #endif.71 #endif
89 \xd 
90 #ifndef·S_IWOTH.72 #ifndef·S_IWOTH
91 #define·S_IWOTH» » 0»/*·write·permission,·other·*/.73 #define·S_IWOTH» » 0»/*·write·permission,·other·*/
92 #endif.74 #endif
93 \xd 
94 #ifndef·S_IXOTH.75 #ifndef·S_IXOTH
95 #define·S_IXOTH» » 0»/*·execute/search·permission,·other·*/.76 #define·S_IXOTH» » 0»/*·execute/search·permission,·other·*/
96 #endif.77 #endif
97 \xd 
98 #ifndef·S_ISFIFO.78 #ifndef·S_ISFIFO
99 #define·S_ISFIFO(mode)»  (((mode)·&·_S_IFMT)·==·_S_IFIFO).79 #define·S_ISFIFO(mode)»  (((mode)·&·_S_IFMT)·==·_S_IFIFO)
100 #endif.80 #endif
101 \xd 
102 #ifndef·S_ISREG.81 #ifndef·S_ISREG
103 #define»S_ISREG(mode)»   (((mode)·&·_S_IFREG)·==·_S_IFREG).82 #define»S_ISREG(mode)»   (((mode)·&·_S_IFREG)·==·_S_IFREG)
104 #endif.83 #endif
105 \xd 
106 /*.84 /*
107 **»     Don't·know·if·these·are·still·needed..85 **»     Don't·know·if·these·are·still·needed.
108 **.86 **
109 **»     #define»      _IFMT» » _S_IFMT.87 **»     #define»      _IFMT» » _S_IFMT
110 **»     #define·_IFREG»»_S_IFREG.88 **»     #define·_IFREG»»_S_IFREG
111 */.89 */
112 \xd 
195 KB
libsndfile-1.0.30/src/sndfile.c
    
Offset 1, 3359 lines modifiedOffset 1, 3359 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·Lesser·General·Public·License·for·more·details..12 **·GNU·Lesser·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include»       "sfconfig.h".18 #include»       "sfconfig.h"
20 \xd 
21 #include»       <stdlib.h>.19 #include»       <stdlib.h>
22 #include»       <string.h>.20 #include»       <string.h>
23 #include»       <ctype.h>.21 #include»       <ctype.h>
24 #include»       <assert.h>.22 #include»       <assert.h>
25 \xd 
26 #include»       "sndfile.h".23 #include»       "sndfile.h"
27 #include»       "sfendian.h".24 #include»       "sfendian.h"
28 #include»       "common.h".25 #include»       "common.h"
29 \xd 
30 #if·HAVE_UNISTD_H.26 #if·HAVE_UNISTD_H
31 #include·<unistd.h>.27 #include·<unistd.h>
32 #elif·defined·_WIN32.28 #elif·defined·_WIN32
33 #include·<io.h>.29 #include·<io.h>
34 #endif.30 #endif
35 \xd 
36 #define»»SNDFILE_MAGICK»  0x1234C0DE.31 #define»»SNDFILE_MAGICK»  0x1234C0DE
37 \xd 
38 #ifdef·__APPLE__.32 #ifdef·__APPLE__
39 »       /*.33 »       /*
40 »       **»     Detect·if·a·compile·for·a·universal·binary·is·being·attempted·and·barf·if·it·is..34 »       **»     Detect·if·a·compile·for·a·universal·binary·is·being·attempted·and·barf·if·it·is.
41 »       **»     See·the·URL·below·for·the·rationale..35 »       **»     See·the·URL·below·for·the·rationale.
42 »       */.36 »       */
43 »       #ifdef·__BIG_ENDIAN__.37 »       #ifdef·__BIG_ENDIAN__
44 »       »       #if·(CPU_IS_LITTLE_ENDIAN·==·1).38 »       »       #if·(CPU_IS_LITTLE_ENDIAN·==·1)
45 »       »       »       #error·"Universal·binary·compile·detected.·See·http://www.mega-nerd.com/libsndfile/FAQ.html#Q018".39 »       »       »       #error·"Universal·binary·compile·detected.·See·http://www.mega-nerd.com/libsndfile/FAQ.html#Q018"
46 »       »       #endif.40 »       »       #endif
47 »       #endif.41 »       #endif
48 \xd 
49 »       #ifdef·__LITTLE_ENDIAN__.42 »       #ifdef·__LITTLE_ENDIAN__
50 »       »       #if·(CPU_IS_BIG_ENDIAN·==·1).43 »       »       #if·(CPU_IS_BIG_ENDIAN·==·1)
51 »       »       »       #error·"Universal·binary·compile·detected.·See·http://www.mega-nerd.com/libsndfile/FAQ.html#Q018".44 »       »       »       #error·"Universal·binary·compile·detected.·See·http://www.mega-nerd.com/libsndfile/FAQ.html#Q018"
52 »       »       #endif.45 »       »       #endif
53 »       #endif.46 »       #endif
54 #endif.47 #endif
55 \xd 
56 \xd 
57 typedef·struct.48 typedef·struct
58 {»      int·»   »   error·;.49 {»      int·»   »   error·;
59 »       const·char»      *str·;.50 »       const·char»      *str·;
60 }·ErrorStruct·;.51 }·ErrorStruct·;
61 \xd 
62 static.52 static
63 ErrorStruct·SndfileErrors·[]·=.53 ErrorStruct·SndfileErrors·[]·=
64 {.54 {
65 »       /*·Public·error·values·and·their·associated·strings.·*/.55 »       /*·Public·error·values·and·their·associated·strings.·*/
66 »       {»      SF_ERR_NO_ERROR»       »       »       »       ,·"No·Error."·},.56 »       {»      SF_ERR_NO_ERROR»       »       »       »       ,·"No·Error."·},
67 »       {»      SF_ERR_UNRECOGNISED_FORMAT»    ,·"Format·not·recognised."·},.57 »       {»      SF_ERR_UNRECOGNISED_FORMAT»    ,·"Format·not·recognised."·},
68 »       {»      SF_ERR_SYSTEM» » » » ,·"System·error."·/*·Often·replaced.·*/·»},.58 »       {»      SF_ERR_SYSTEM» » » » ,·"System·error."·/*·Often·replaced.·*/·»},
69 »       {»      SF_ERR_MALFORMED_FILE» » ,·"Supported·file·format·but·file·is·malformed."·},.59 »       {»      SF_ERR_MALFORMED_FILE» » ,·"Supported·file·format·but·file·is·malformed."·},
70 »       {»      SF_ERR_UNSUPPORTED_ENCODING»   ,·"Supported·file·format·but·unsupported·encoding."·},.60 »       {»      SF_ERR_UNSUPPORTED_ENCODING»   ,·"Supported·file·format·but·unsupported·encoding."·},
71 \xd 
72 »       /*·Private·error·values·and·their·associated·strings.·*/.61 »       /*·Private·error·values·and·their·associated·strings.·*/
73 »       {»      SFE_ZERO_MAJOR_FORMAT» ,·"Error·:·major·format·is·0."·},.62 »       {»      SFE_ZERO_MAJOR_FORMAT» ,·"Error·:·major·format·is·0."·},
74 »       {»      SFE_ZERO_MINOR_FORMAT» ,·"Error·:·minor·format·is·0."·},.63 »       {»      SFE_ZERO_MINOR_FORMAT» ,·"Error·:·minor·format·is·0."·},
75 »       {»      SFE_BAD_FILE»  »  »  ,·"File·does·not·exist·or·is·not·a·regular·file·(possibly·a·pipe?)."·},.64 »       {»      SFE_BAD_FILE»  »  »  ,·"File·does·not·exist·or·is·not·a·regular·file·(possibly·a·pipe?)."·},
76 »       {»      SFE_BAD_FILE_READ»     »     ,·"File·exists·but·no·data·could·be·read."·},.65 »       {»      SFE_BAD_FILE_READ»     »     ,·"File·exists·but·no·data·could·be·read."·},
77 »       {»      SFE_OPEN_FAILED»       »       »       ,·"Could·not·open·file."·},.66 »       {»      SFE_OPEN_FAILED»       »       »       ,·"Could·not·open·file."·},
78 »       {»      SFE_BAD_SNDFILE_PTR»   »   ,·"Not·a·valid·SNDFILE*·pointer."·},.67 »       {»      SFE_BAD_SNDFILE_PTR»   »   ,·"Not·a·valid·SNDFILE*·pointer."·},
79 »       {»      SFE_BAD_SF_INFO_PTR»   »   ,·"NULL·SF_INFO·pointer·passed·to·libsndfile."·},.68 »       {»      SFE_BAD_SF_INFO_PTR»   »   ,·"NULL·SF_INFO·pointer·passed·to·libsndfile."·},
80 »       {»      SFE_BAD_SF_INCOMPLETE» ,·"SF_PRIVATE·struct·incomplete·and·end·of·header·parsing."·},.69 »       {»      SFE_BAD_SF_INCOMPLETE» ,·"SF_PRIVATE·struct·incomplete·and·end·of·header·parsing."·},
81 »       {»      SFE_BAD_FILE_PTR»      »      ,·"Bad·FILE·pointer."·},.70 »       {»      SFE_BAD_FILE_PTR»      »      ,·"Bad·FILE·pointer."·},
82 »       {»      SFE_BAD_INT_PTR»       »       »       ,·"Internal·error,·Bad·pointer."·},.71 »       {»      SFE_BAD_INT_PTR»       »       »       ,·"Internal·error,·Bad·pointer."·},
83 »       {»      SFE_BAD_STAT_SIZE»     »     ,·"Error·:·software·was·misconfigured·at·compile·time·(sizeof·statbuf.st_size)."·},.72 »       {»      SFE_BAD_STAT_SIZE»     »     ,·"Error·:·software·was·misconfigured·at·compile·time·(sizeof·statbuf.st_size)."·},
84 »       {»      SFE_NO_TEMP_DIR»       »       »       ,·"Error·:·Could·not·file·temp·dir."·},.73 »       {»      SFE_NO_TEMP_DIR»       »       »       ,·"Error·:·Could·not·file·temp·dir."·},
85 \xd 
86 »       {»      SFE_MALLOC_FAILED»     »     ,·"Internal·malloc·()·failed."·},.74 »       {»      SFE_MALLOC_FAILED»     »     ,·"Internal·malloc·()·failed."·},
87 »       {»      SFE_UNIMPLEMENTED»     »     ,·"File·contains·data·in·an·unimplemented·format."·},.75 »       {»      SFE_UNIMPLEMENTED»     »     ,·"File·contains·data·in·an·unimplemented·format."·},
88 »       {»      SFE_BAD_READ_ALIGN»    »    ,·"Attempt·to·read·a·non-integer·number·of·channels."·},.76 »       {»      SFE_BAD_READ_ALIGN»    »    ,·"Attempt·to·read·a·non-integer·number·of·channels."·},
89 »       {»      SFE_BAD_WRITE_ALIGN·»   ,·"Attempt·to·write·a·non-integer·number·of·channels."·},.77 »       {»      SFE_BAD_WRITE_ALIGN·»   ,·"Attempt·to·write·a·non-integer·number·of·channels."·},
90 »       {»      SFE_NOT_READMODE»      »      ,·"Read·attempted·on·file·currently·open·for·write."·},.78 »       {»      SFE_NOT_READMODE»      »      ,·"Read·attempted·on·file·currently·open·for·write."·},
91 »       {»      SFE_NOT_WRITEMODE»     »     ,·"Write·attempted·on·file·currently·open·for·read."·},.79 »       {»      SFE_NOT_WRITEMODE»     »     ,·"Write·attempted·on·file·currently·open·for·read."·},
92 »       {»      SFE_BAD_MODE_RW»       »       »       ,·"Error·:·This·file·format·does·not·support·read/write·mode."·},.80 »       {»      SFE_BAD_MODE_RW»       »       »       ,·"Error·:·This·file·format·does·not·support·read/write·mode."·},
93 »       {»      SFE_BAD_SF_INFO»       »       »       ,·"Internal·error·:·SF_INFO·struct·incomplete."·},.81 »       {»      SFE_BAD_SF_INFO»       »       »       ,·"Internal·error·:·SF_INFO·struct·incomplete."·},
94 »       {»      SFE_BAD_OFFSET»»»,·"Error·:·supplied·offset·beyond·end·of·file."·},.82 »       {»      SFE_BAD_OFFSET»»»,·"Error·:·supplied·offset·beyond·end·of·file."·},
95 »       {»      SFE_NO_EMBED_SUPPORT»  ,·"Error·:·embedding·not·supported·for·this·file·format."·},.83 »       {»      SFE_NO_EMBED_SUPPORT»  ,·"Error·:·embedding·not·supported·for·this·file·format."·},
96 »       {»      SFE_NO_EMBEDDED_RDWR»  ,·"Error·:·cannot·open·embedded·file·read/write."·},.84 »       {»      SFE_NO_EMBEDDED_RDWR»  ,·"Error·:·cannot·open·embedded·file·read/write."·},
97 »       {»      SFE_NO_PIPE_WRITE»     »     ,·"Error·:·this·file·format·does·not·support·pipe·write."·},.85 »       {»      SFE_NO_PIPE_WRITE»     »     ,·"Error·:·this·file·format·does·not·support·pipe·write."·},
98 »       {»      SFE_BAD_VIRTUAL_IO»    »    ,·"Error·:·bad·pointer·on·SF_VIRTUAL_IO·struct."·},.86 »       {»      SFE_BAD_VIRTUAL_IO»    »    ,·"Error·:·bad·pointer·on·SF_VIRTUAL_IO·struct."·},
99 »       {»      SFE_BAD_BROADCAST_INFO_SIZE.87 »       {»      SFE_BAD_BROADCAST_INFO_SIZE
100 »       »       »       »       »       »       »       »       ,·"Error·:·bad·coding_history_size·in·SF_BROADCAST_INFO·struct."·},.88 »       »       »       »       »       »       »       »       ,·"Error·:·bad·coding_history_size·in·SF_BROADCAST_INFO·struct."·},
101 »       {»      SFE_BAD_BROADCAST_INFO_TOO_BIG.89 »       {»      SFE_BAD_BROADCAST_INFO_TOO_BIG
102 »       »       »       »       »       »       »       »       ,·"Error·:·SF_BROADCAST_INFO·struct·too·large."·},.90 »       »       »       »       »       »       »       »       ,·"Error·:·SF_BROADCAST_INFO·struct·too·large."·},
103 »       {»      SFE_BAD_CART_INFO_SIZE»»»»,·"Error:·SF_CART_INFO·struct·too·large."·},.91 »       {»      SFE_BAD_CART_INFO_SIZE»»»»,·"Error:·SF_CART_INFO·struct·too·large."·},
104 »       {»      SFE_BAD_CART_INFO_TOO_BIG»     »     »     ,·"Error:·bad·tag_text_size·in·SF_CART_INFO·struct."·},.92 »       {»      SFE_BAD_CART_INFO_TOO_BIG»     »     »     ,·"Error:·bad·tag_text_size·in·SF_CART_INFO·struct."·},
105 »       {»      SFE_INTERLEAVE_MODE»   »   ,·"Attempt·to·write·to·file·with·non-interleaved·data."·},.93 »       {»      SFE_INTERLEAVE_MODE»   »   ,·"Attempt·to·write·to·file·with·non-interleaved·data."·},
106 »       {»      SFE_INTERLEAVE_SEEK»   »   ,·"Bad·karma·in·seek·during·interleave·read·operation."·},.94 »       {»      SFE_INTERLEAVE_SEEK»   »   ,·"Bad·karma·in·seek·during·interleave·read·operation."·},
107 »       {»      SFE_INTERLEAVE_READ»   »   ,·"Bad·karma·in·read·during·interleave·read·operation."·},.95 »       {»      SFE_INTERLEAVE_READ»   »   ,·"Bad·karma·in·read·during·interleave·read·operation."·},
108 \xd 
109 »       {»      SFE_INTERNAL»  »  »  ,·"Unspecified·internal·error."·},.96 »       {»      SFE_INTERNAL»  »  »  ,·"Unspecified·internal·error."·},
110 »       {»      SFE_BAD_COMMAND_PARAM» ,·"Bad·parameter·passed·to·function·sf_command."·},.97 »       {»      SFE_BAD_COMMAND_PARAM» ,·"Bad·parameter·passed·to·function·sf_command."·},
111 »       {»      SFE_BAD_ENDIAN»»»,·"Bad·endian-ness.·Try·default·endian-ness"·},.98 »       {»      SFE_BAD_ENDIAN»»»,·"Bad·endian-ness.·Try·default·endian-ness"·},
112 »       {»      SFE_CHANNEL_COUNT_ZERO»,·"Channel·count·is·zero."·},.99 »       {»      SFE_CHANNEL_COUNT_ZERO»,·"Channel·count·is·zero."·},
113 »       {»      SFE_CHANNEL_COUNT»     »     ,·"Too·many·channels·specified."·},.100 »       {»      SFE_CHANNEL_COUNT»     »     ,·"Too·many·channels·specified."·},
114 »       {»      SFE_CHANNEL_COUNT_BAD» ,·"Bad·channel·count."·},.101 »       {»      SFE_CHANNEL_COUNT_BAD» ,·"Bad·channel·count."·},
115 \xd 
116 »       {»      SFE_BAD_SEEK»  »  »  ,·"Internal·psf_fseek()·failed."·},.102 »       {»      SFE_BAD_SEEK»  »  »  ,·"Internal·psf_fseek()·failed."·},
117 »       {»      SFE_NOT_SEEKABLE»      »      ,·"Seek·attempted·on·unseekable·file·type."·},.103 »       {»      SFE_NOT_SEEKABLE»      »      ,·"Seek·attempted·on·unseekable·file·type."·},
118 »       {»      SFE_AMBIGUOUS_SEEK»    »    ,·"Error·:·combination·of·file·open·mode·and·seek·command·is·ambiguous."·},.104 »       {»      SFE_AMBIGUOUS_SEEK»    »    ,·"Error·:·combination·of·file·open·mode·and·seek·command·is·ambiguous."·},
119 »       {»      SFE_WRONG_SEEK»»»,·"Error·:·invalid·seek·parameters."·},.105 »       {»      SFE_WRONG_SEEK»»»,·"Error·:·invalid·seek·parameters."·},
120 »       {»      SFE_SEEK_FAILED»       »       »       ,·"Error·:·parameters·OK,·but·psf_seek()·failed."·},.106 »       {»      SFE_SEEK_FAILED»       »       »       ,·"Error·:·parameters·OK,·but·psf_seek()·failed."·},
121 \xd 
122 »       {»      SFE_BAD_OPEN_MODE»     »     ,·"Error·:·bad·mode·parameter·for·file·open."·},.107 »       {»      SFE_BAD_OPEN_MODE»     »     ,·"Error·:·bad·mode·parameter·for·file·open."·},
123 »       {»      SFE_OPEN_PIPE_RDWR»    »    ,·"Error·:·attempt·to·open·a·pipe·in·read/write·mode."·},.108 »       {»      SFE_OPEN_PIPE_RDWR»    »    ,·"Error·:·attempt·to·open·a·pipe·in·read/write·mode."·},
124 »       {»      SFE_RDWR_POSITION»     »     ,·"Error·on·RDWR·position·(cryptic)."·},.109 »       {»      SFE_RDWR_POSITION»     »     ,·"Error·on·RDWR·position·(cryptic)."·},
125 »       {»      SFE_RDWR_BAD_HEADER»   »   ,·"Error·:·Cannot·open·file·in·read/write·mode·due·to·string·data·in·header."·},.110 »       {»      SFE_RDWR_BAD_HEADER»   »   ,·"Error·:·Cannot·open·file·in·read/write·mode·due·to·string·data·in·header."·},
126 »       {»      SFE_CMD_HAS_DATA»      »      ,·"Error·:·Command·fails·because·file·already·has·audio·data."·},.111 »       {»      SFE_CMD_HAS_DATA»      »      ,·"Error·:·Command·fails·because·file·already·has·audio·data."·},
127 \xd 
Max diff block lines reached; -1/199177 bytes (-0.00%) of diff not shown.
99.7 KB
libsndfile-1.0.30/src/wavlike.c
    
Offset 1, 1339 lines modifiedOffset 1, 1339 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2020·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **·Copyright·(C)·2004-2005·David·Viens·<davidv@plogue.com>.3 **·Copyright·(C)·2004-2005·David·Viens·<davidv@plogue.com>
4 **.4 **
5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·Lesser·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or.7 **·the·Free·Software·Foundation;·either·version·2.1·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
13 **·GNU·Lesser·General·Public·License·for·more·details..13 **·GNU·Lesser·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public·License
16 **·along·with·this·program;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 #include»       "sfconfig.h".19 #include»       "sfconfig.h"
21 \xd 
22 #include»       <stdio.h>.20 #include»       <stdio.h>
23 #include»       <string.h>.21 #include»       <string.h>
24 #include»       <ctype.h>.22 #include»       <ctype.h>
25 #include»       <time.h>.23 #include»       <time.h>
26 \xd 
27 #include»       "sndfile.h".24 #include»       "sndfile.h"
28 #include»       "sfendian.h".25 #include»       "sfendian.h"
29 #include»       "common.h".26 #include»       "common.h"
30 #include»       "wavlike.h".27 #include»       "wavlike.h"
31 \xd 
32 \xd 
33 #define·WAV_BEXT_MIN_CHUNK_SIZE» » 602.28 #define·WAV_BEXT_MIN_CHUNK_SIZE» » 602
34 #define·WAV_BEXT_MAX_CHUNK_SIZE» » (10·*·1024).29 #define·WAV_BEXT_MAX_CHUNK_SIZE» » (10·*·1024)
35 \xd 
36 #define·WAV_CART_MIN_CHUNK_SIZE» » 2048.30 #define·WAV_CART_MIN_CHUNK_SIZE» » 2048
37 #define·WAV_CART_MAX_CHUNK_SIZE» » 0xffffffff.31 #define·WAV_CART_MAX_CHUNK_SIZE» » 0xffffffff
38 \xd 
39 \xd 
40 static·int·»      exif_subchunk_parse»   (SF_PRIVATE·*psf,·uint32_t·length)·;.32 static·int·»      exif_subchunk_parse»   (SF_PRIVATE·*psf,·uint32_t·length)·;
41 \xd 
42 \xd 
43 /*··Known·WAVEFORMATEXTENSIBLE·GUIDS.··*/.33 /*··Known·WAVEFORMATEXTENSIBLE·GUIDS.··*/
44 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_PCM·=.34 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_PCM·=
45 {»      0x00000001,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}.35 {»      0x00000001,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}
46 }·;.36 }·;
47 \xd 
48 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_MS_ADPCM·=.37 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_MS_ADPCM·=
49 {»      0x00000002,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}.38 {»      0x00000002,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}
50 }·;.39 }·;
51 \xd 
52 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_IEEE_FLOAT·=.40 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_IEEE_FLOAT·=
53 {»      0x00000003,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}.41 {»      0x00000003,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}
54 }·;.42 }·;
55 \xd 
56 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_ALAW·=.43 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_ALAW·=
57 {»      0x00000006,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}.44 {»      0x00000006,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}
58 }·;.45 }·;
59 \xd 
60 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_MULAW·=.46 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_MULAW·=
61 {»      0x00000007,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}.47 {»      0x00000007,·0x0000,·0x0010,·{»    0x80,·0x00,·0x00,·0xaa,·0x00,·0x38,·0x9b,·0x71·}
62 }·;.48 }·;
63 \xd 
64 /*.49 /*
65 **·the·next·two·are·from.50 **·the·next·two·are·from
66 **·http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html.51 **·http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html
67 */.52 */
68 \xd 
69 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM·=.53 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM·=
70 {»      0x00000001,·0x0721,·0x11d3,·{»    0x86,·0x44,·0xc8,·0xc1,·0xca,·0x00,·0x00,·0x00·}.54 {»      0x00000001,·0x0721,·0x11d3,·{»    0x86,·0x44,·0xc8,·0xc1,·0xca,·0x00,·0x00,·0x00·}
71 }·;.55 }·;
72 \xd 
73 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT·=.56 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT·=
74 {»      0x00000003,·0x0721,·0x11d3,·{»    0x86,·0x44,·0xc8,·0xc1,·0xca,·0x00,·0x00,·0x00·}.57 {»      0x00000003,·0x0721,·0x11d3,·{»    0x86,·0x44,·0xc8,·0xc1,·0xca,·0x00,·0x00,·0x00·}
75 }·;.58 }·;
76 \xd 
77 \xd 
78 #if·0.59 #if·0
79 /*·maybe·interesting·one·day·to·read·the·following·through·sf_read_raw·*/.60 /*·maybe·interesting·one·day·to·read·the·following·through·sf_read_raw·*/
80 /*·http://www.bath.ac.uk/~masrwd/pvocex/pvocex.html·*/.61 /*·http://www.bath.ac.uk/~masrwd/pvocex/pvocex.html·*/
81 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_PVOCEX·=.62 static·const·EXT_SUBFORMAT·MSGUID_SUBTYPE_PVOCEX·=
82 {»      0x8312b9c2,·0x2e6e,·0x11d4,·{»    0xa8,·0x24,·0xde,·0x5b,·0x96,·0xc3,·0xab,·0x21·}.63 {»      0x8312b9c2,·0x2e6e,·0x11d4,·{»    0xa8,·0x24,·0xde,·0x5b,·0x96,·0xc3,·0xab,·0x21·}
83 }·;.64 }·;
84 #endif.65 #endif
85 \xd 
86 /*·This·stores·which·bit·in·dwChannelMask·maps·to·which·channel·*/.66 /*·This·stores·which·bit·in·dwChannelMask·maps·to·which·channel·*/
87 static·const·struct·chanmap_s.67 static·const·struct·chanmap_s
88 {»      int·id·;.68 {»      int·id·;
89 »       const·char·*·name·;.69 »       const·char·*·name·;
90 }·channel_mask_bits·[]·=.70 }·channel_mask_bits·[]·=
91 {»      /*·WAVEFORMATEXTENSIBLE·doesn't·distuingish·FRONT_LEFT·from·LEFT·*/.71 {»      /*·WAVEFORMATEXTENSIBLE·doesn't·distuingish·FRONT_LEFT·from·LEFT·*/
92 »       {»      SF_CHANNEL_MAP_LEFT,·"L"·},.72 »       {»      SF_CHANNEL_MAP_LEFT,·"L"·},
93 »       {»      SF_CHANNEL_MAP_RIGHT,·"R"·},.73 »       {»      SF_CHANNEL_MAP_RIGHT,·"R"·},
94 »       {»      SF_CHANNEL_MAP_CENTER,·"C"·},.74 »       {»      SF_CHANNEL_MAP_CENTER,·"C"·},
95 »       {»      SF_CHANNEL_MAP_LFE,·"LFE"·},.75 »       {»      SF_CHANNEL_MAP_LFE,·"LFE"·},
96 »       {»      SF_CHANNEL_MAP_REAR_LEFT,·"Ls"·},.76 »       {»      SF_CHANNEL_MAP_REAR_LEFT,·"Ls"·},
97 »       {»      SF_CHANNEL_MAP_REAR_RIGHT,·"Rs"·},.77 »       {»      SF_CHANNEL_MAP_REAR_RIGHT,·"Rs"·},
98 »       {»      SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,·"Lc"·},.78 »       {»      SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER,·"Lc"·},
99 »       {»      SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,·"Rc"·},.79 »       {»      SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER,·"Rc"·},
100 »       {»      SF_CHANNEL_MAP_REAR_CENTER,·"Cs"·},.80 »       {»      SF_CHANNEL_MAP_REAR_CENTER,·"Cs"·},
101 »       {»      SF_CHANNEL_MAP_SIDE_LEFT,·"Sl"·},.81 »       {»      SF_CHANNEL_MAP_SIDE_LEFT,·"Sl"·},
102 »       {»      SF_CHANNEL_MAP_SIDE_RIGHT,·"Sr"·},.82 »       {»      SF_CHANNEL_MAP_SIDE_RIGHT,·"Sr"·},
103 »       {»      SF_CHANNEL_MAP_TOP_CENTER,·"Tc"·},.83 »       {»      SF_CHANNEL_MAP_TOP_CENTER,·"Tc"·},
104 »       {»      SF_CHANNEL_MAP_TOP_FRONT_LEFT,·"Tfl"·},.84 »       {»      SF_CHANNEL_MAP_TOP_FRONT_LEFT,·"Tfl"·},
105 »       {»      SF_CHANNEL_MAP_TOP_FRONT_CENTER,·"Tfc"·},.85 »       {»      SF_CHANNEL_MAP_TOP_FRONT_CENTER,·"Tfc"·},
106 »       {»      SF_CHANNEL_MAP_TOP_FRONT_RIGHT,·"Tfr"·},.86 »       {»      SF_CHANNEL_MAP_TOP_FRONT_RIGHT,·"Tfr"·},
107 »       {»      SF_CHANNEL_MAP_TOP_REAR_LEFT,·"Trl"·},.87 »       {»      SF_CHANNEL_MAP_TOP_REAR_LEFT,·"Trl"·},
108 »       {»      SF_CHANNEL_MAP_TOP_REAR_CENTER,·"Trc"·},.88 »       {»      SF_CHANNEL_MAP_TOP_REAR_CENTER,·"Trc"·},
109 »       {»      SF_CHANNEL_MAP_TOP_REAR_RIGHT,·"Trr"·},.89 »       {»      SF_CHANNEL_MAP_TOP_REAR_RIGHT,·"Trr"·},
110 }·;.90 }·;
111 \xd 
112 /*------------------------------------------------------------------------------.91 /*------------------------------------------------------------------------------
113 ·*·Private·static·functions..92 ·*·Private·static·functions.
114 ·*/.93 ·*/
115 \xd 
116 static·int.94 static·int
117 wavex_guid_equal·(const·EXT_SUBFORMAT·*·first,·const·EXT_SUBFORMAT·*·second).95 wavex_guid_equal·(const·EXT_SUBFORMAT·*·first,·const·EXT_SUBFORMAT·*·second)
118 {»      return·!memcmp·(first,·second,·sizeof·(EXT_SUBFORMAT))·;.96 {»      return·!memcmp·(first,·second,·sizeof·(EXT_SUBFORMAT))·;
119 }·/*·wavex_guid_equal·*/.97 }·/*·wavex_guid_equal·*/
120 \xd 
121 \xd 
122 \xd 
123 int.98 int
124 wavlike_read_fmt_chunk·(SF_PRIVATE·*psf,·int·fmtsize).99 wavlike_read_fmt_chunk·(SF_PRIVATE·*psf,·int·fmtsize)
125 {»      WAVLIKE_PRIVATE·*·wpriv·;.100 {»      WAVLIKE_PRIVATE·*·wpriv·;
126 »       WAV_FMT·*wav_fmt·;.101 »       WAV_FMT·*wav_fmt·;
127 »       int»    bytesread,·k,·bytespersec·=·0·;.102 »       int»    bytesread,·k,·bytespersec·=·0·;
Max diff block lines reached; -1/102027 bytes (-0.00%) of diff not shown.
32.8 KB
libsndfile-1.0.30/tests/misc_test.c
    
Offset 1, 533 lines modifiedOffset 1, 533 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2001-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2001-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software·;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation·;·either·version·2·of·the·License,·or.6 **·the·Free·Software·Foundation·;·either·version·2·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY·;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·General·Public·License·for·more·details..12 **·GNU·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program·;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include·"sfconfig.h".18 #include·"sfconfig.h"
20 \xd 
21 #include·<stdio.h>.19 #include·<stdio.h>
22 #include·<stdlib.h>.20 #include·<stdlib.h>
23 #include·<string.h>.21 #include·<string.h>
24 #include·<errno.h>.22 #include·<errno.h>
25 #include·<inttypes.h>.23 #include·<inttypes.h>
26 \xd 
27 #include·<sys/stat.h>.24 #include·<sys/stat.h>
28 #include·<math.h>.25 #include·<math.h>
29 \xd 
30 #if·HAVE_UNISTD_H.26 #if·HAVE_UNISTD_H
31 #include·<unistd.h>.27 #include·<unistd.h>
32 #endif.28 #endif
33 \xd 
34 #if·(HAVE_DECL_S_IRGRP·==·0).29 #if·(HAVE_DECL_S_IRGRP·==·0)
35 #include·<sf_unistd.h>.30 #include·<sf_unistd.h>
36 #endif.31 #endif
37 \xd 
38 #if·(defined·(WIN32)·||·defined·(_WIN32)).32 #if·(defined·(WIN32)·||·defined·(_WIN32))
39 #include·<io.h>.33 #include·<io.h>
40 #include·<direct.h>.34 #include·<direct.h>
41 #endif.35 #endif
42 \xd 
43 #include»       <sndfile.h>.36 #include»       <sndfile.h>
44 \xd 
45 #include»       "utils.h".37 #include»       "utils.h"
46 \xd 
47 #define»BUFFER_LEN»      »      (1·<<·10).38 #define»BUFFER_LEN»      »      (1·<<·10)
48 #define·LOG_BUFFER_SIZE» 1024.39 #define·LOG_BUFFER_SIZE» 1024
49 \xd 
50 static·void»     zero_data_test·(const·char·*filename,·int·format)·;.40 static·void»     zero_data_test·(const·char·*filename,·int·format)·;
51 static·void»     filesystem_full_test·(int·format)·;.41 static·void»     filesystem_full_test·(int·format)·;
52 static·void»     permission_test·(const·char·*filename,·int·typemajor)·;.42 static·void»     permission_test·(const·char·*filename,·int·typemajor)·;
53 static·void»     wavex_amb_test·(const·char·*filename)·;.43 static·void»     wavex_amb_test·(const·char·*filename)·;
54 static·void·rf64_downgrade_test·(const·char·*filename)·;.44 static·void·rf64_downgrade_test·(const·char·*filename)·;
55 static·void·rf64_long_file_downgrade_test·(const·char·*filename)·;.45 static·void·rf64_long_file_downgrade_test·(const·char·*filename)·;
56 \xd 
57 int.46 int
58 main·(int·argc,·char·*argv·[]).47 main·(int·argc,·char·*argv·[])
59 {»      int»   »   do_all·=·0·;.48 {»      int»   »   do_all·=·0·;
60 »       int»    »    test_count·=·0·;.49 »       int»    »    test_count·=·0·;
61 \xd 
62 »       if·(argc·!=·2).50 »       if·(argc·!=·2)
63 »       {»      printf·("Usage·:·%s·<test>\n",·argv·[0])·;.51 »       {»      printf·("Usage·:·%s·<test>\n",·argv·[0])·;
64 »       »       printf·("····Where·<test>·is·one·of·the·following:\n")·;.52 »       »       printf·("····Where·<test>·is·one·of·the·following:\n")·;
65 »       »       printf·("···········wav··-·test·WAV·file·peak·chunk\n")·;.53 »       »       printf·("···········wav··-·test·WAV·file·peak·chunk\n")·;
66 »       »       printf·("···········aiff·-·test·AIFF·file·PEAK·chunk\n")·;.54 »       »       printf·("···········aiff·-·test·AIFF·file·PEAK·chunk\n")·;
67 »       »       printf·("···········all··-·perform·all·tests\n")·;.55 »       »       printf·("···········all··-·perform·all·tests\n")·;
68 »       »       exit·(1)·;.56 »       »       exit·(1)·;
69 »       »       }·;.57 »       »       }·;
70 \xd 
71 »       do_all·=·!·strcmp·(argv·[1],·"all")·;.58 »       do_all·=·!·strcmp·(argv·[1],·"all")·;
72 \xd 
73 »       if·(do_all·||·!·strcmp·(argv·[1],·"wav")).59 »       if·(do_all·||·!·strcmp·(argv·[1],·"wav"))
74 »       {»      zero_data_test·("zerolen.wav",·SF_FORMAT_WAV·|·SF_FORMAT_PCM_16)·;.60 »       {»      zero_data_test·("zerolen.wav",·SF_FORMAT_WAV·|·SF_FORMAT_PCM_16)·;
75 »       »       filesystem_full_test·(SF_FORMAT_WAV·|·SF_FORMAT_PCM_16)·;.61 »       »       filesystem_full_test·(SF_FORMAT_WAV·|·SF_FORMAT_PCM_16)·;
76 »       »       permission_test·("readonly.wav",·SF_FORMAT_WAV)·;.62 »       »       permission_test·("readonly.wav",·SF_FORMAT_WAV)·;
77 »       »       wavex_amb_test·("ambisonic.wav")·;.63 »       »       wavex_amb_test·("ambisonic.wav")·;
78 »       »       test_count++·;.64 »       »       test_count++·;
79 »       »       }·;.65 »       »       }·;
80 \xd 
81 »       if·(do_all·||·!·strcmp·(argv·[1],·"aiff")).66 »       if·(do_all·||·!·strcmp·(argv·[1],·"aiff"))
82 »       {»      zero_data_test·("zerolen.aiff",·SF_FORMAT_AIFF·|·SF_FORMAT_PCM_16)·;.67 »       {»      zero_data_test·("zerolen.aiff",·SF_FORMAT_AIFF·|·SF_FORMAT_PCM_16)·;
83 »       »       filesystem_full_test·(SF_FORMAT_AIFF·|·SF_FORMAT_PCM_16)·;.68 »       »       filesystem_full_test·(SF_FORMAT_AIFF·|·SF_FORMAT_PCM_16)·;
84 »       »       permission_test·("readonly.aiff",·SF_FORMAT_AIFF)·;.69 »       »       permission_test·("readonly.aiff",·SF_FORMAT_AIFF)·;
85 »       »       test_count++·;.70 »       »       test_count++·;
86 »       »       }·;.71 »       »       }·;
87 \xd 
88 »       if·(do_all·||·!·strcmp·(argv·[1],·"au")).72 »       if·(do_all·||·!·strcmp·(argv·[1],·"au"))
89 »       {»      zero_data_test·("zerolen.au",·SF_FORMAT_AU·|·SF_FORMAT_PCM_16)·;.73 »       {»      zero_data_test·("zerolen.au",·SF_FORMAT_AU·|·SF_FORMAT_PCM_16)·;
90 »       »       filesystem_full_test·(SF_FORMAT_AU·|·SF_FORMAT_PCM_16)·;.74 »       »       filesystem_full_test·(SF_FORMAT_AU·|·SF_FORMAT_PCM_16)·;
91 »       »       permission_test·("readonly.au",·SF_FORMAT_AU)·;.75 »       »       permission_test·("readonly.au",·SF_FORMAT_AU)·;
92 »       »       test_count++·;.76 »       »       test_count++·;
93 »       »       }·;.77 »       »       }·;
94 \xd 
95 »       if·(do_all·||·!·strcmp·(argv·[1],·"caf")).78 »       if·(do_all·||·!·strcmp·(argv·[1],·"caf"))
96 »       {»      zero_data_test·("zerolen.caf",·SF_FORMAT_CAF·|·SF_FORMAT_PCM_16)·;.79 »       {»      zero_data_test·("zerolen.caf",·SF_FORMAT_CAF·|·SF_FORMAT_PCM_16)·;
97 »       »       filesystem_full_test·(SF_FORMAT_CAF·|·SF_FORMAT_PCM_16)·;.80 »       »       filesystem_full_test·(SF_FORMAT_CAF·|·SF_FORMAT_PCM_16)·;
98 »       »       permission_test·("readonly.caf",·SF_FORMAT_CAF)·;.81 »       »       permission_test·("readonly.caf",·SF_FORMAT_CAF)·;
99 »       »       test_count++·;.82 »       »       test_count++·;
100 »       »       }·;.83 »       »       }·;
101 \xd 
102 »       if·(do_all·||·!·strcmp·(argv·[1],·"svx")).84 »       if·(do_all·||·!·strcmp·(argv·[1],·"svx"))
103 »       {»      zero_data_test·("zerolen.svx",·SF_FORMAT_SVX·|·SF_FORMAT_PCM_16)·;.85 »       {»      zero_data_test·("zerolen.svx",·SF_FORMAT_SVX·|·SF_FORMAT_PCM_16)·;
104 »       »       filesystem_full_test·(SF_FORMAT_SVX·|·SF_FORMAT_PCM_16)·;.86 »       »       filesystem_full_test·(SF_FORMAT_SVX·|·SF_FORMAT_PCM_16)·;
105 »       »       permission_test·("readonly.svx",·SF_FORMAT_SVX)·;.87 »       »       permission_test·("readonly.svx",·SF_FORMAT_SVX)·;
106 »       »       test_count++·;.88 »       »       test_count++·;
107 »       »       }·;.89 »       »       }·;
108 \xd 
109 »       if·(do_all·||·!·strcmp·(argv·[1],·"nist")).90 »       if·(do_all·||·!·strcmp·(argv·[1],·"nist"))
110 »       {»      zero_data_test·("zerolen.nist",·SF_FORMAT_NIST·|·SF_FORMAT_PCM_16)·;.91 »       {»      zero_data_test·("zerolen.nist",·SF_FORMAT_NIST·|·SF_FORMAT_PCM_16)·;
111 »       »       filesystem_full_test·(SF_FORMAT_NIST·|·SF_FORMAT_PCM_16)·;.92 »       »       filesystem_full_test·(SF_FORMAT_NIST·|·SF_FORMAT_PCM_16)·;
112 »       »       permission_test·("readonly.nist",·SF_FORMAT_NIST)·;.93 »       »       permission_test·("readonly.nist",·SF_FORMAT_NIST)·;
113 »       »       test_count++·;.94 »       »       test_count++·;
114 »       »       }·;.95 »       »       }·;
115 \xd 
116 »       if·(do_all·||·!·strcmp·(argv·[1],·"paf")).96 »       if·(do_all·||·!·strcmp·(argv·[1],·"paf"))
117 »       {»      zero_data_test·("zerolen.paf",·SF_FORMAT_PAF·|·SF_FORMAT_PCM_16)·;.97 »       {»      zero_data_test·("zerolen.paf",·SF_FORMAT_PAF·|·SF_FORMAT_PCM_16)·;
118 »       »       filesystem_full_test·(SF_FORMAT_PAF·|·SF_FORMAT_PCM_16)·;.98 »       »       filesystem_full_test·(SF_FORMAT_PAF·|·SF_FORMAT_PCM_16)·;
119 »       »       permission_test·("readonly.paf",·SF_FORMAT_PAF)·;.99 »       »       permission_test·("readonly.paf",·SF_FORMAT_PAF)·;
120 »       »       test_count++·;.100 »       »       test_count++·;
121 »       »       }·;.101 »       »       }·;
122 \xd 
123 »       if·(do_all·||·!·strcmp·(argv·[1],·"ircam")).102 »       if·(do_all·||·!·strcmp·(argv·[1],·"ircam"))
124 »       {»      zero_data_test·("zerolen.ircam",·SF_FORMAT_IRCAM·|·SF_FORMAT_PCM_16)·;.103 »       {»      zero_data_test·("zerolen.ircam",·SF_FORMAT_IRCAM·|·SF_FORMAT_PCM_16)·;
125 »       »       filesystem_full_test·(SF_FORMAT_IRCAM·|·SF_FORMAT_PCM_16)·;.104 »       »       filesystem_full_test·(SF_FORMAT_IRCAM·|·SF_FORMAT_PCM_16)·;
126 »       »       permission_test·("readonly.ircam",·SF_FORMAT_IRCAM)·;.105 »       »       permission_test·("readonly.ircam",·SF_FORMAT_IRCAM)·;
127 »       »       test_count++·;.106 »       »       test_count++·;
Max diff block lines reached; -1/33485 bytes (-0.00%) of diff not shown.
110 KB
libsndfile-1.0.30/tests/pcm_test.c
    
Offset 1, 1715 lines modifiedOffset 1, 1715 lines modified
1 /*.1 /*
2 **·Copyright·(C)·1999-2013·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·1999-2013·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·General·Public·License·for·more·details..12 **·GNU·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 #include·"sfconfig.h".18 #include·"sfconfig.h"
20 \xd 
21 #include·<stdio.h>.19 #include·<stdio.h>
22 #include·<stdlib.h>.20 #include·<stdlib.h>
23 #include·<string.h>.21 #include·<string.h>
24 #include·<math.h>.22 #include·<math.h>
25 #include·<inttypes.h>.23 #include·<inttypes.h>
26 \xd 
27 #if·HAVE_UNISTD_H.24 #if·HAVE_UNISTD_H
28 #include·<unistd.h>.25 #include·<unistd.h>
29 #else.26 #else
30 #include·"sf_unistd.h".27 #include·"sf_unistd.h"
31 #endif.28 #endif
32 \xd 
33 #include·<sndfile.h>.29 #include·<sndfile.h>
34 \xd 
35 #include·"utils.h".30 #include·"utils.h"
36 \xd 
37 #define»BUFFER_SIZE»     »     (1·<<·12).31 #define»BUFFER_SIZE»     »     (1·<<·12)
38 \xd 
39 static·void»     lrintf_test·(void)·;.32 static·void»     lrintf_test·(void)·;
40 \xd 
41 static·void»     pcm_test_bits_8»      (const·char·*filename,·int·filetype,·uint64_t·hash)·;.33 static·void»     pcm_test_bits_8»      (const·char·*filename,·int·filetype,·uint64_t·hash)·;
42 static·void»     pcm_test_bits_16»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;.34 static·void»     pcm_test_bits_16»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;
43 static·void»     pcm_test_bits_24»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;.35 static·void»     pcm_test_bits_24»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;
44 static·void»     pcm_test_bits_32»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;.36 static·void»     pcm_test_bits_32»     (const·char·*filename,·int·filetype,·uint64_t·hash)·;
45 \xd 
46 static·void·pcm_test_float»       (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;.37 static·void·pcm_test_float»       (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;
47 static·void·pcm_test_double»      (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;.38 static·void·pcm_test_double»      (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;
48 \xd 
49 typedef·union.39 typedef·union
50 {»      double»d·[BUFFER_SIZE·+·1]·;.40 {»      double»d·[BUFFER_SIZE·+·1]·;
51 »       float»  f·[BUFFER_SIZE·+·1]·;.41 »       float»  f·[BUFFER_SIZE·+·1]·;
52 »       int»    »    i·[BUFFER_SIZE·+·1]·;.42 »       int»    »    i·[BUFFER_SIZE·+·1]·;
53 »       short»  s·[BUFFER_SIZE·+·1]·;.43 »       short»  s·[BUFFER_SIZE·+·1]·;
54 }·BUFFER·;.44 }·BUFFER·;
55 \xd 
56 /*·Data·written·to·the·file.·*/.45 /*·Data·written·to·the·file.·*/
57 static» BUFFER»   data_out·;.46 static» BUFFER»   data_out·;
58 \xd 
59 /*·Data·read·back·from·the·file.·*/.47 /*·Data·read·back·from·the·file.·*/
60 static» BUFFER»   data_in·;.48 static» BUFFER»   data_in·;
61 \xd 
62 int.49 int
63 main·(void).50 main·(void)
64 {.51 {
65 »       lrintf_test·()·;.52 »       lrintf_test·()·;
66 \xd 
67 »       pcm_test_bits_8»("pcm-s8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_S8,·0xa335091249dbfLL)·;.53 »       pcm_test_bits_8»("pcm-s8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_S8,·0xa335091249dbfLL)·;
68 »       pcm_test_bits_8»("pcm-u8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_U8,·0x48c433d695f3fLL)·;.54 »       pcm_test_bits_8»("pcm-u8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_U8,·0x48c433d695f3fLL)·;
69 \xd 
70 »       pcm_test_bits_16·("le-pcm16.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0xb956c881ebf08LL)·;.55 »       pcm_test_bits_16·("le-pcm16.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0xb956c881ebf08LL)·;
71 »       pcm_test_bits_16·("be-pcm16.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0x2f840c55750f8LL)·;.56 »       pcm_test_bits_16·("be-pcm16.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0x2f840c55750f8LL)·;
72 \xd 
73 »       pcm_test_bits_24·("le-pcm24.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xb6a759ab496f8LL)·;.57 »       pcm_test_bits_24·("le-pcm24.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xb6a759ab496f8LL)·;
74 »       pcm_test_bits_24·("be-pcm24.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xf3eaf9c30b6f8LL)·;.58 »       pcm_test_bits_24·("be-pcm24.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xf3eaf9c30b6f8LL)·;
75 \xd 
76 »       pcm_test_bits_32·("le-pcm32.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0xaece1c1c17f08LL)·;.59 »       pcm_test_bits_32·("le-pcm32.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0xaece1c1c17f08LL)·;
77 »       pcm_test_bits_32·("be-pcm32.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0x9ddf142d0b0f8LL)·;.60 »       pcm_test_bits_32·("be-pcm32.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0x9ddf142d0b0f8LL)·;
78 \xd 
79 »       /*·Lite·remove·start·*/.61 »       /*·Lite·remove·start·*/
80 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_FALSE)·;.62 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_FALSE)·;
81 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_FALSE)·;.63 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_FALSE)·;
82 \xd 
83 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_FALSE)·;.64 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_FALSE)·;
84 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_FALSE)·;.65 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_FALSE)·;
85 \xd 
86 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_TRUE)·;.66 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_TRUE)·;
87 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_TRUE)·;.67 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_TRUE)·;
88 \xd 
89 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_TRUE)·;.68 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_TRUE)·;
90 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_TRUE)·;.69 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_TRUE)·;
91 »       /*·Lite·remove·end·*/.70 »       /*·Lite·remove·end·*/
92 \xd 
93 »       return·0·;.71 »       return·0·;
94 }·/*·main·*/.72 }·/*·main·*/
95 \xd 
96 /*============================================================================================.73 /*============================================================================================
97 **»     Here·are·the·test·functions..74 **»     Here·are·the·test·functions.
98 */.75 */
99 \xd 
100 static·void.76 static·void
101 lrintf_test·(void).77 lrintf_test·(void)
102 {»      int·k,·items·;.78 {»      int·k,·items·;
103 »       float»  *float_data·;.79 »       float»  *float_data·;
104 »       int»    »    *int_data·;.80 »       int»    »    *int_data·;
105 \xd 
106 »       print_test_name·("lrintf_test",·"")·;.81 »       print_test_name·("lrintf_test",·"")·;
107 \xd 
108 »       items·=·1024·;.82 »       items·=·1024·;
109 \xd 
110 »       float_data·=·data_out.f·;.83 »       float_data·=·data_out.f·;
111 »       int_data·=·data_in.i·;.84 »       int_data·=·data_in.i·;
112 \xd 
113 »       for·(k·=·0·;·k·<·items·;·k++).85 »       for·(k·=·0·;·k·<·items·;·k++)
114 »       »       float_data·[k]·=·(k·*·((k·%·2)·?·333333.0·:·-333333.0))·;.86 »       »       float_data·[k]·=·(k·*·((k·%·2)·?·333333.0·:·-333333.0))·;
115 \xd 
116 »       for·(k·=·0·;·k·<·items·;·k++).87 »       for·(k·=·0·;·k·<·items·;·k++)
117 »       »       int_data·[k]·=·lrintf·(float_data·[k])·;.88 »       »       int_data·[k]·=·lrintf·(float_data·[k])·;
118 \xd 
119 »       for·(k·=·0·;·k·<·items·;·k++).89 »       for·(k·=·0·;·k·<·items·;·k++)
120 »       »       if·(fabs·(int_data·[k]·-·float_data·[k])·>·1.0).90 »       »       if·(fabs·(int_data·[k]·-·float_data·[k])·>·1.0)
121 »       »       {»      printf·("\n\nLine·%d:·float·:·Incorrect·sample·(#%d·:·%f·=>·%d).\n",·__LINE__,·k,·float_data·[k],·int_data·[k])·;.91 »       »       {»      printf·("\n\nLine·%d:·float·:·Incorrect·sample·(#%d·:·%f·=>·%d).\n",·__LINE__,·k,·float_data·[k],·int_data·[k])·;
122 »       »       »       exit·(1)·;.92 »       »       »       exit·(1)·;
123 »       »       »       }·;.93 »       »       »       }·;
124 \xd 
125 »       printf·("ok\n")·;.94 »       printf·("ok\n")·;
126 }·/*·lrintf_test·*/.95 }·/*·lrintf_test·*/
127 \xd 
Max diff block lines reached; -1/112757 bytes (-0.00%) of diff not shown.
62.7 KB
libsndfile-1.0.30/tests/pcm_test.tpl
    
Offset 1, 919 lines modifiedOffset 1, 919 lines modified
1 [+·AutoGen5·template·c·+].1 [+·AutoGen5·template·c·+]
2 /*.2 /*
3 **·Copyright·(C)·1999-2013·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.3 **·Copyright·(C)·1999-2013·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
4 **.4 **
5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or.7 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
13 **·GNU·General·Public·License·for·more·details..13 **·GNU·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
16 **·along·with·this·program;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 #include·"sfconfig.h".19 #include·"sfconfig.h"
21 \xd 
22 #include·<stdio.h>.20 #include·<stdio.h>
23 #include·<stdlib.h>.21 #include·<stdlib.h>
24 #include·<string.h>.22 #include·<string.h>
25 #include·<math.h>.23 #include·<math.h>
26 #include·<inttypes.h>.24 #include·<inttypes.h>
27 \xd 
28 #if·HAVE_UNISTD_H.25 #if·HAVE_UNISTD_H
29 #include·<unistd.h>.26 #include·<unistd.h>
30 #else.27 #else
31 #include·"sf_unistd.h".28 #include·"sf_unistd.h"
32 #endif.29 #endif
33 \xd 
34 #include·<sndfile.h>.30 #include·<sndfile.h>
35 \xd 
36 #include·"utils.h".31 #include·"utils.h"
37 \xd 
38 #define»BUFFER_SIZE»     »     (1·<<·12).32 #define»BUFFER_SIZE»     »     (1·<<·12)
39 \xd 
40 static·void»     lrintf_test·(void)·;.33 static·void»     lrintf_test·(void)·;
41 \xd 
42 [+·FOR·data_type.34 [+·FOR·data_type
43 +]static·void»   pcm_test_[+·(get·"name")·+]»   (const·char·*filename,·int·filetype,·uint64_t·hash)·;.35 +]static·void»   pcm_test_[+·(get·"name")·+]»   (const·char·*filename,·int·filetype,·uint64_t·hash)·;
44 [+·ENDFOR·data_type.36 [+·ENDFOR·data_type
45 +].37 +]
46 static·void·pcm_test_float»       (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;.38 static·void·pcm_test_float»       (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;
47 static·void·pcm_test_double»      (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;.39 static·void·pcm_test_double»      (const·char·*filename,·int·filetype,·uint64_t·hash,·int·replace_float)·;
48 \xd 
49 typedef·union.40 typedef·union
50 {»      double»d·[BUFFER_SIZE·+·1]·;.41 {»      double»d·[BUFFER_SIZE·+·1]·;
51 »       float»  f·[BUFFER_SIZE·+·1]·;.42 »       float»  f·[BUFFER_SIZE·+·1]·;
52 »       int»    »    i·[BUFFER_SIZE·+·1]·;.43 »       int»    »    i·[BUFFER_SIZE·+·1]·;
53 »       short»  s·[BUFFER_SIZE·+·1]·;.44 »       short»  s·[BUFFER_SIZE·+·1]·;
54 }·BUFFER·;.45 }·BUFFER·;
55 \xd 
56 /*·Data·written·to·the·file.·*/.46 /*·Data·written·to·the·file.·*/
57 static» BUFFER»   data_out·;.47 static» BUFFER»   data_out·;
58 \xd 
59 /*·Data·read·back·from·the·file.·*/.48 /*·Data·read·back·from·the·file.·*/
60 static» BUFFER»   data_in·;.49 static» BUFFER»   data_in·;
61 \xd 
62 int.50 int
63 main·(void).51 main·(void)
64 {.52 {
65 »       lrintf_test·()·;.53 »       lrintf_test·()·;
66 \xd 
67 »       pcm_test_bits_8»("pcm-s8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_S8,·0xa335091249dbfLL)·;.54 »       pcm_test_bits_8»("pcm-s8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_S8,·0xa335091249dbfLL)·;
68 »       pcm_test_bits_8»("pcm-u8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_U8,·0x48c433d695f3fLL)·;.55 »       pcm_test_bits_8»("pcm-u8.raw",·SF_FORMAT_RAW·|·SF_FORMAT_PCM_U8,·0x48c433d695f3fLL)·;
69 \xd 
70 »       pcm_test_bits_16·("le-pcm16.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0xb956c881ebf08LL)·;.56 »       pcm_test_bits_16·("le-pcm16.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0xb956c881ebf08LL)·;
71 »       pcm_test_bits_16·("be-pcm16.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0x2f840c55750f8LL)·;.57 »       pcm_test_bits_16·("be-pcm16.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_16,·0x2f840c55750f8LL)·;
72 \xd 
73 »       pcm_test_bits_24·("le-pcm24.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xb6a759ab496f8LL)·;.58 »       pcm_test_bits_24·("le-pcm24.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xb6a759ab496f8LL)·;
74 »       pcm_test_bits_24·("be-pcm24.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xf3eaf9c30b6f8LL)·;.59 »       pcm_test_bits_24·("be-pcm24.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_24,·0xf3eaf9c30b6f8LL)·;
75 \xd 
76 »       pcm_test_bits_32·("le-pcm32.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0xaece1c1c17f08LL)·;.60 »       pcm_test_bits_32·("le-pcm32.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0xaece1c1c17f08LL)·;
77 »       pcm_test_bits_32·("be-pcm32.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0x9ddf142d0b0f8LL)·;.61 »       pcm_test_bits_32·("be-pcm32.raw",·SF_ENDIAN_BIG»  »  |·SF_FORMAT_RAW·|·SF_FORMAT_PCM_32,·0x9ddf142d0b0f8LL)·;
78 \xd 
79 »       /*·Lite·remove·start·*/.62 »       /*·Lite·remove·start·*/
80 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_FALSE)·;.63 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_FALSE)·;
81 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_FALSE)·;.64 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_FALSE)·;
82 \xd 
83 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_FALSE)·;.65 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_FALSE)·;
84 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_FALSE)·;.66 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_FALSE)·;
85 \xd 
86 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_TRUE)·;.67 »       pcm_test_float» ("le-float.raw",·SF_ENDIAN_LITTLE» |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xad04f7554267aLL,·SF_TRUE)·;
87 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_TRUE)·;.68 »       pcm_test_float» ("be-float.raw",·SF_ENDIAN_BIG»    »    |·SF_FORMAT_RAW·|·SF_FORMAT_FLOAT,·0xde3e248fa9186LL,·SF_TRUE)·;
88 \xd 
89 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_TRUE)·;.69 »       pcm_test_double»("le-double.raw",·SF_ENDIAN_LITTLE»       |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x2726f958f669cLL,·SF_TRUE)·;
90 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_TRUE)·;.70 »       pcm_test_double»("be-double.raw",·SF_ENDIAN_BIG»  |·SF_FORMAT_RAW·|·SF_FORMAT_DOUBLE,·0x3583f8ee51164LL,·SF_TRUE)·;
91 »       /*·Lite·remove·end·*/.71 »       /*·Lite·remove·end·*/
92 \xd 
93 »       return·0·;.72 »       return·0·;
94 }·/*·main·*/.73 }·/*·main·*/
95 \xd 
96 /*============================================================================================.74 /*============================================================================================
97 **»     Here·are·the·test·functions..75 **»     Here·are·the·test·functions.
98 */.76 */
99 \xd 
100 static·void.77 static·void
101 lrintf_test·(void).78 lrintf_test·(void)
102 {»      int·k,·items·;.79 {»      int·k,·items·;
103 »       float»  *float_data·;.80 »       float»  *float_data·;
104 »       int»    »    *int_data·;.81 »       int»    »    *int_data·;
105 \xd 
106 »       print_test_name·("lrintf_test",·"")·;.82 »       print_test_name·("lrintf_test",·"")·;
107 \xd 
108 »       items·=·1024·;.83 »       items·=·1024·;
109 \xd 
110 »       float_data·=·data_out.f·;.84 »       float_data·=·data_out.f·;
111 »       int_data·=·data_in.i·;.85 »       int_data·=·data_in.i·;
112 \xd 
113 »       for·(k·=·0·;·k·<·items·;·k++).86 »       for·(k·=·0·;·k·<·items·;·k++)
114 »       »       float_data·[k]·=·(k·*·((k·%·2)·?·333333.0·:·-333333.0))·;.87 »       »       float_data·[k]·=·(k·*·((k·%·2)·?·333333.0·:·-333333.0))·;
115 \xd 
116 »       for·(k·=·0·;·k·<·items·;·k++).88 »       for·(k·=·0·;·k·<·items·;·k++)
117 »       »       int_data·[k]·=·lrintf·(float_data·[k])·;.89 »       »       int_data·[k]·=·lrintf·(float_data·[k])·;
118 \xd 
119 »       for·(k·=·0·;·k·<·items·;·k++).90 »       for·(k·=·0·;·k·<·items·;·k++)
120 »       »       if·(fabs·(int_data·[k]·-·float_data·[k])·>·1.0).91 »       »       if·(fabs·(int_data·[k]·-·float_data·[k])·>·1.0)
121 »       »       {»      printf·("\n\nLine·%d:·float·:·Incorrect·sample·(#%d·:·%f·=>·%d).\n",·__LINE__,·k,·float_data·[k],·int_data·[k])·;.92 »       »       {»      printf·("\n\nLine·%d:·float·:·Incorrect·sample·(#%d·:·%f·=>·%d).\n",·__LINE__,·k,·float_data·[k],·int_data·[k])·;
122 »       »       »       exit·(1)·;.93 »       »       »       exit·(1)·;
123 »       »       »       }·;.94 »       »       »       }·;
124 \xd 
125 »       printf·("ok\n")·;.95 »       printf·("ok\n")·;
126 }·/*·lrintf_test·*/.96 }·/*·lrintf_test·*/
127 \xd 
Max diff block lines reached; -1/64125 bytes (-0.00%) of diff not shown.
4.49 KB
libsndfile-1.0.30/tests/pedantic-header-test.sh.in
    
Offset 1, 58 lines modifiedOffset 1, 58 lines modified
1 #!/bin/bash.1 #!/bin/bash
2 \xd 
3 #·Copyright·(C)·2010-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 #·Copyright·(C)·2010-2017·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
4 #.3 #
5 #·All·rights·reserved..4 #·All·rights·reserved.
6 #.5 #
7 #·Redistribution·and·use·in·source·and·binary·forms,·with·or·without.6 #·Redistribution·and·use·in·source·and·binary·forms,·with·or·without
8 #·modification,·are·permitted·provided·that·the·following·conditions·are.7 #·modification,·are·permitted·provided·that·the·following·conditions·are
9 #·met:.8 #·met:
10 #.9 #
11 #·····*·Redistributions·of·source·code·must·retain·the·above·copyright.10 #·····*·Redistributions·of·source·code·must·retain·the·above·copyright
12 #·······notice,·this·list·of·conditions·and·the·following·disclaimer..11 #·······notice,·this·list·of·conditions·and·the·following·disclaimer.
13 #·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright.12 #·····*·Redistributions·in·binary·form·must·reproduce·the·above·copyright
14 #·······notice,·this·list·of·conditions·and·the·following·disclaimer·in.13 #·······notice,·this·list·of·conditions·and·the·following·disclaimer·in
15 #·······the·documentation·and/or·other·materials·provided·with·the.14 #·······the·documentation·and/or·other·materials·provided·with·the
16 #·······distribution..15 #·······distribution.
17 #·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used.16 #·····*·Neither·the·author·nor·the·names·of·any·contributors·may·be·used
18 #·······to·endorse·or·promote·products·derived·from·this·software·without.17 #·······to·endorse·or·promote·products·derived·from·this·software·without
19 #·······specific·prior·written·permission..18 #·······specific·prior·written·permission.
20 #.19 #
21 #·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS.20 #·THIS·SOFTWARE·IS·PROVIDED·BY·THE·COPYRIGHT·HOLDERS·AND·CONTRIBUTORS
22 #·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED.21 #·"AS·IS"·AND·ANY·EXPRESS·OR·IMPLIED·WARRANTIES,·INCLUDING,·BUT·NOT·LIMITED
23 #·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR.22 #·TO,·THE·IMPLIED·WARRANTIES·OF·MERCHANTABILITY·AND·FITNESS·FOR·A·PARTICULAR
24 #·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR.23 #·PURPOSE·ARE·DISCLAIMED.·IN·NO·EVENT·SHALL·THE·COPYRIGHT·OWNER·OR
25 #·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,.24 #·CONTRIBUTORS·BE·LIABLE·FOR·ANY·DIRECT,·INDIRECT,·INCIDENTAL,·SPECIAL,
26 #·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,.25 #·EXEMPLARY,·OR·CONSEQUENTIAL·DAMAGES·(INCLUDING,·BUT·NOT·LIMITED·TO,
27 #·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;.26 #·PROCUREMENT·OF·SUBSTITUTE·GOODS·OR·SERVICES;·LOSS·OF·USE,·DATA,·OR·PROFITS;
28 #·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,.27 #·OR·BUSINESS·INTERRUPTION)·HOWEVER·CAUSED·AND·ON·ANY·THEORY·OF·LIABILITY,
29 #·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR.28 #·WHETHER·IN·CONTRACT,·STRICT·LIABILITY,·OR·TORT·(INCLUDING·NEGLIGENCE·OR
30 #·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF.29 #·OTHERWISE)·ARISING·IN·ANY·WAY·OUT·OF·THE·USE·OF·THIS·SOFTWARE,·EVEN·IF
31 #·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE..30 #·ADVISED·OF·THE·POSSIBILITY·OF·SUCH·DAMAGE.
32 \xd 
33 \xd 
34 if·test·!·-f·@top_srcdir@/tests/sfversion.c·;·then.31 if·test·!·-f·@top_srcdir@/tests/sfversion.c·;·then
35 »       exit·0.32 »       exit·0
36 »       fi.33 »       fi
37 \xd 
38 echo·-n·"····Pedantic·header·test···········:·".34 echo·-n·"····Pedantic·header·test···········:·"
39 \xd 
40 #·Only·do·this·if·the·compiler·is·GCC..35 #·Only·do·this·if·the·compiler·is·GCC.
41 if·test·-n·"@GCC_MAJOR_VERSION@"·;·then.36 if·test·-n·"@GCC_MAJOR_VERSION@"·;·then
42 \xd 
43 »       CC=`echo·"@CC@"·|·sed·"s/.*shave·cc·//"`.37 »       CC=`echo·"@CC@"·|·sed·"s/.*shave·cc·//"`
44 »       #·Compile·with·-Werror·and·-pedantic..38 »       #·Compile·with·-Werror·and·-pedantic.
45 »       $CC·-std=c99·-Werror·-pedantic·-I@top_srcdir@/src·-I@abs_top_builddir@/src·-I@abs_top_builddir@/include·-c·@top_srcdir@/tests/sfversion.c·-o·/dev/null.39 »       $CC·-std=c99·-Werror·-pedantic·-I@top_srcdir@/src·-I@abs_top_builddir@/src·-I@abs_top_builddir@/include·-c·@top_srcdir@/tests/sfversion.c·-o·/dev/null
46 \xd 
47 »       #·Check·compiler·return·status..40 »       #·Check·compiler·return·status.
48 »       if·test·$?·-ne·0·;·then.41 »       if·test·$?·-ne·0·;·then
49 »       »       echo.42 »       »       echo
50 »       »       exit·1.43 »       »       exit·1
51 »       »       fi.44 »       »       fi
52 \xd 
53 »       echo·"ok".45 »       echo·"ok"
54 else.46 else
55 »       echo·"n/a".47 »       echo·"n/a"
56 »       fi.48 »       fi
57 \xd 
58 exit·0.49 exit·0
59.2 KB
libsndfile-1.0.30/tests/utils.c
    
Offset 1, 1174 lines modifiedOffset 1, 1174 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·General·Public·License·for·more·details..12 **·GNU·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 /*.18 /*
20 **»     Utility·functions·to·make·writing·the·test·suite·easier..19 **»     Utility·functions·to·make·writing·the·test·suite·easier.
21 **.20 **
22 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from.21 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from
23 **»     the·files·utils.def·and·utils.tpl..22 **»     the·files·utils.def·and·utils.tpl.
24 */.23 */
25 \xd 
26 \xd 
27 \xd 
28 #include·"sfconfig.h".24 #include·"sfconfig.h"
29 \xd 
30 #include·<stdio.h>.25 #include·<stdio.h>
31 #include·<stdlib.h>.26 #include·<stdlib.h>
32 #include·<inttypes.h>.27 #include·<inttypes.h>
33 \xd 
34 #if·HAVE_UNISTD_H.28 #if·HAVE_UNISTD_H
35 #include·<unistd.h>.29 #include·<unistd.h>
36 #endif.30 #endif
37 \xd 
38 #if·(HAVE_DECL_S_IRGRP·==·0).31 #if·(HAVE_DECL_S_IRGRP·==·0)
39 #include·<sf_unistd.h>.32 #include·<sf_unistd.h>
40 #endif.33 #endif
41 \xd 
42 #include·<errno.h>.34 #include·<errno.h>
43 #include·<string.h>.35 #include·<string.h>
44 #include·<ctype.h>.36 #include·<ctype.h>
45 #include·<math.h>.37 #include·<math.h>
46 #include·<fcntl.h>.38 #include·<fcntl.h>
47 #include·<sys/stat.h>.39 #include·<sys/stat.h>
48 \xd 
49 #include·<sndfile.h>.40 #include·<sndfile.h>
50 \xd 
51 #include·"utils.h".41 #include·"utils.h"
52 \xd 
53 #ifndef»M_PI.42 #ifndef»M_PI
54 #define»M_PI»    »    3.14159265358979323846264338.43 #define»M_PI»    »    3.14159265358979323846264338
55 #endif.44 #endif
56 \xd 
57 #define»LOG_BUFFER_SIZE» » 4096.45 #define»LOG_BUFFER_SIZE» » 4096
58 \xd 
59 /*.46 /*
60 **»     Neat·solution·to·the·Win32/OS2·binary·file·flage·requirement..47 **»     Neat·solution·to·the·Win32/OS2·binary·file·flage·requirement.
61 **»     If·O_BINARY·isn't·already·defined·by·the·inclusion·of·the·system.48 **»     If·O_BINARY·isn't·already·defined·by·the·inclusion·of·the·system
62 **»     headers,·set·it·to·zero..49 **»     headers,·set·it·to·zero.
63 */.50 */
64 #ifndef·O_BINARY.51 #ifndef·O_BINARY
65 #define·O_BINARY·0.52 #define·O_BINARY·0
66 #endif.53 #endif
67 \xd 
68 \xd 
69 void.54 void
70 gen_windowed_sine_float·(float·*data,·int·len,·double·maximum).55 gen_windowed_sine_float·(float·*data,·int·len,·double·maximum)
71 {»      int·k·;.56 {»      int·k·;
72 \xd 
73 »       memset·(data,·0,·len·*·sizeof·(float))·;.57 »       memset·(data,·0,·len·*·sizeof·(float))·;
74 \xd 
75 »       len·=·(5·*·len)·/·6·;.58 »       len·=·(5·*·len)·/·6·;
76 \xd 
77 »       for·(k·=·0·;·k·<·len·;·k++).59 »       for·(k·=·0·;·k·<·len·;·k++)
78 »       {»      data·[k]·=·sin·(2.0·*·k·*·M_PI·*·1.0·/·32.0·+·0.4)·;.60 »       {»      data·[k]·=·sin·(2.0·*·k·*·M_PI·*·1.0·/·32.0·+·0.4)·;
79 \xd 
80 »       »       /*·Apply·Hanning·Window.·*/.61 »       »       /*·Apply·Hanning·Window.·*/
81 »       »       data·[k]·*=·maximum·*·(0.5·-·0.5·*·cos·(2.0·*·M_PI·*·k·/·((len)·-·1)))·;.62 »       »       data·[k]·*=·maximum·*·(0.5·-·0.5·*·cos·(2.0·*·M_PI·*·k·/·((len)·-·1)))·;
82 »       »       }.63 »       »       }
83 \xd 
84 »       return·;.64 »       return·;
85 }·/*·gen_windowed_sine_float·*/.65 }·/*·gen_windowed_sine_float·*/
86 \xd 
87 void.66 void
88 gen_windowed_sine_double·(double·*data,·int·len,·double·maximum).67 gen_windowed_sine_double·(double·*data,·int·len,·double·maximum)
89 {»      int·k·;.68 {»      int·k·;
90 \xd 
91 »       memset·(data,·0,·len·*·sizeof·(double))·;.69 »       memset·(data,·0,·len·*·sizeof·(double))·;
92 \xd 
93 »       len·=·(5·*·len)·/·6·;.70 »       len·=·(5·*·len)·/·6·;
94 \xd 
95 »       for·(k·=·0·;·k·<·len·;·k++).71 »       for·(k·=·0·;·k·<·len·;·k++)
96 »       {»      data·[k]·=·sin·(2.0·*·k·*·M_PI·*·1.0·/·32.0·+·0.4)·;.72 »       {»      data·[k]·=·sin·(2.0·*·k·*·M_PI·*·1.0·/·32.0·+·0.4)·;
97 \xd 
98 »       »       /*·Apply·Hanning·Window.·*/.73 »       »       /*·Apply·Hanning·Window.·*/
99 »       »       data·[k]·*=·maximum·*·(0.5·-·0.5·*·cos·(2.0·*·M_PI·*·k·/·((len)·-·1)))·;.74 »       »       data·[k]·*=·maximum·*·(0.5·-·0.5·*·cos·(2.0·*·M_PI·*·k·/·((len)·-·1)))·;
100 »       »       }.75 »       »       }
101 \xd 
102 »       return·;.76 »       return·;
103 }·/*·gen_windowed_sine_double·*/.77 }·/*·gen_windowed_sine_double·*/
104 \xd 
105 \xd 
106 void.78 void
107 create_short_sndfile·(const·char·*filename,·int·format,·int·channels).79 create_short_sndfile·(const·char·*filename,·int·format,·int·channels)
108 {»      short·data·[2·*·3·*·4·*·5·*·6·*·7]·=·{·0,·}·;.80 {»      short·data·[2·*·3·*·4·*·5·*·6·*·7]·=·{·0,·}·;
109 »       SNDFILE·*file·;.81 »       SNDFILE·*file·;
110 »       SF_INFO·sfinfo·;.82 »       SF_INFO·sfinfo·;
111 \xd 
112 »       memset·(&sfinfo,·0,·sizeof·(sfinfo))·;.83 »       memset·(&sfinfo,·0,·sizeof·(sfinfo))·;
113 »       sfinfo.samplerate·=·44100·;.84 »       sfinfo.samplerate·=·44100·;
114 »       sfinfo.channels·=·channels·;.85 »       sfinfo.channels·=·channels·;
115 »       sfinfo.format·=·format·;.86 »       sfinfo.format·=·format·;
116 \xd 
117 »       if·((file·=·sf_open·(filename,·SFM_WRITE,·&sfinfo))·==·NULL).87 »       if·((file·=·sf_open·(filename,·SFM_WRITE,·&sfinfo))·==·NULL)
118 »       {»      printf·("Error·(%s,·%d)·:·sf_open·failed·:·%s\n",·__FILE__,·__LINE__,·sf_strerror·(file))·;.88 »       {»      printf·("Error·(%s,·%d)·:·sf_open·failed·:·%s\n",·__FILE__,·__LINE__,·sf_strerror·(file))·;
119 »       »       exit·(1)·;.89 »       »       exit·(1)·;
120 »       »       }·;.90 »       »       }·;
121 \xd 
122 »       sf_write_short·(file,·data,·ARRAY_LEN·(data))·;.91 »       sf_write_short·(file,·data,·ARRAY_LEN·(data))·;
123 \xd 
124 »       sf_close·(file)·;.92 »       sf_close·(file)·;
125 }·/*·create_short_sndfile·*/.93 }·/*·create_short_sndfile·*/
126 \xd 
127 void.94 void
Max diff block lines reached; -1/60564 bytes (-0.00%) of diff not shown.
13.9 KB
libsndfile-1.0.30/tests/utils.h
    
Offset 1, 203 lines modifiedOffset 1, 203 lines modified
1 /*.1 /*
2 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.2 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
3 **.3 **
4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.4 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.5 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or.6 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or
7 **·(at·your·option)·any·later·version..7 **·(at·your·option)·any·later·version.
8 **.8 **
9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.9 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.10 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.11 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
12 **·GNU·General·Public·License·for·more·details..12 **·GNU·General·Public·License·for·more·details.
13 **.13 **
14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.14 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
15 **·along·with·this·program;·if·not,·write·to·the·Free·Software.15 **·along·with·this·program;·if·not,·write·to·the·Free·Software
16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..16 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
17 */.17 */
18 \xd 
19 /*.18 /*
20 **»     Utility·functions·to·make·writing·the·test·suite·easier..19 **»     Utility·functions·to·make·writing·the·test·suite·easier.
21 **.20 **
22 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from.21 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from
23 **»     the·files·utils.def·and·utils.tpl..22 **»     the·files·utils.def·and·utils.tpl.
24 */.23 */
25 \xd 
26 \xd 
27 \xd 
28 #ifdef·__cplusplus.24 #ifdef·__cplusplus
29 extern·"C"·{.25 extern·"C"·{
30 #endif» /*·__cplusplus·*/.26 #endif» /*·__cplusplus·*/
31 \xd 
32 #include·"sfconfig.h".27 #include·"sfconfig.h"
33 \xd 
34 #include·<stdint.h>.28 #include·<stdint.h>
35 #include·<stdarg.h>.29 #include·<stdarg.h>
36 \xd 
37 #define»ARRAY_LEN(x)»    »    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0]))).30 #define»ARRAY_LEN(x)»    »    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0])))
38 #define·SIGNED_SIZEOF(x)»((int64_t)·(sizeof·(x))).31 #define·SIGNED_SIZEOF(x)»((int64_t)·(sizeof·(x)))
39 #define»NOT(x)»  »  »  »  (!·(x)).32 #define»NOT(x)»  »  »  »  (!·(x))
40 #define»ABS(x)»  »  »  »  ((x)·>=·0·?·(x)·:·-·(x)).33 #define»ABS(x)»  »  »  »  ((x)·>=·0·?·(x)·:·-·(x))
41 \xd 
42 #define»PIPE_INDEX(x)»   ((x)·+·500).34 #define»PIPE_INDEX(x)»   ((x)·+·500)
43 #define»PIPE_TEST_LEN»   12345.35 #define»PIPE_TEST_LEN»   12345
44 \xd 
45 \xd 
46 void·gen_windowed_sine_float·(float·*data,·int·len,·double·maximum)·;.36 void·gen_windowed_sine_float·(float·*data,·int·len,·double·maximum)·;
47 void·gen_windowed_sine_double·(double·*data,·int·len,·double·maximum)·;.37 void·gen_windowed_sine_double·(double·*data,·int·len,·double·maximum)·;
48 \xd 
49 \xd 
50 void»   create_short_sndfile·(const·char·*filename,·int·format,·int·channels)·;.38 void»   create_short_sndfile·(const·char·*filename,·int·format,·int·channels)·;
51 \xd 
52 void»   check_file_hash_or_die»     (const·char·*filename,·uint64_t·target_hash,·int·line_num)·;.39 void»   check_file_hash_or_die»     (const·char·*filename,·uint64_t·target_hash,·int·line_num)·;
53 \xd 
54 void»   print_test_name·(const·char·*test,·const·char·*filename)·;.40 void»   print_test_name·(const·char·*test,·const·char·*filename)·;
55 \xd 
56 void»   dump_data_to_file·(const·char·*filename,·const·void·*data,·unsigned·int·datalen)·;.41 void»   dump_data_to_file·(const·char·*filename,·const·void·*data,·unsigned·int·datalen)·;
57 \xd 
58 void»   write_mono_file·(const·char·*·filename,·int·format,·int·srate,·float·*·output,·int·len)·;.42 void»   write_mono_file·(const·char·*·filename,·int·format,·int·srate,·float·*·output,·int·len)·;
59 \xd 
60 #ifdef·__GNUC__.43 #ifdef·__GNUC__
61 static·inline·void.44 static·inline·void
62 exit_if_true·(int·test,·const·char·*format,·...).45 exit_if_true·(int·test,·const·char·*format,·...)
63 #if·(defined·(__USE_MINGW_ANSI_STDIO)·&&·__USE_MINGW_ANSI_STDIO·&&·!defined·(__clang__)).46 #if·(defined·(__USE_MINGW_ANSI_STDIO)·&&·__USE_MINGW_ANSI_STDIO·&&·!defined·(__clang__))
64 »       __attribute__·((format·(gnu_printf,·2,·3)))·;.47 »       __attribute__·((format·(gnu_printf,·2,·3)))·;
65 #else.48 #else
66 »       __attribute__·((format·(printf,·2,·3)))·;.49 »       __attribute__·((format·(printf,·2,·3)))·;
67 #endif.50 #endif
68 #endif.51 #endif
69 \xd 
70 static·inline·void.52 static·inline·void
71 exit_if_true·(int·test,·const·char·*format,·...).53 exit_if_true·(int·test,·const·char·*format,·...)
72 {»      if·(test).54 {»      if·(test)
73 »       {»      va_list»       argptr·;.55 »       {»      va_list»       argptr·;
74 »       »       va_start·(argptr,·format)·;.56 »       »       va_start·(argptr,·format)·;
75 »       »       vprintf·(format,·argptr)·;.57 »       »       vprintf·(format,·argptr)·;
76 »       »       va_end·(argptr)·;.58 »       »       va_end·(argptr)·;
77 »       »       exit·(1)·;.59 »       »       exit·(1)·;
78 »       »       }·;.60 »       »       }·;
79 }·/*·exit_if_true·*/.61 }·/*·exit_if_true·*/
80 \xd 
81 static·inline·int32_t.62 static·inline·int32_t
82 arith_shift_left·(int32_t·x,·int·shift).63 arith_shift_left·(int32_t·x,·int·shift)
83 {»      return·(int32_t)·(((uint32_t)·x)·<<·shift)·;.64 {»      return·(int32_t)·(((uint32_t)·x)·<<·shift)·;
84 }·/*·arith_shift_left·*/.65 }·/*·arith_shift_left·*/
85 \xd 
86 /*.66 /*
87 **»     Functions·for·saving·two·vectors·of·data·in·an·ascii·text·file·which.67 **»     Functions·for·saving·two·vectors·of·data·in·an·ascii·text·file·which
88 **»     can·then·be·loaded·into·GNU·octave·for·comparison..68 **»     can·then·be·loaded·into·GNU·octave·for·comparison.
89 */.69 */
90 \xd 
91 int»    oct_save_short»      (const·short·*a,·const·short·*b,·int·len)·;.70 int»    oct_save_short»      (const·short·*a,·const·short·*b,·int·len)·;
92 int»    oct_save_int»(const·int·*a,·const·int·*b,·int·len)·;.71 int»    oct_save_int»(const·int·*a,·const·int·*b,·int·len)·;
93 int»    oct_save_float»      (const·float·*a,·const·float·*b,·int·len)·;.72 int»    oct_save_float»      (const·float·*a,·const·float·*b,·int·len)·;
94 int»    oct_save_double»     (const·double·*a,·const·double·*b,·int·len)·;.73 int»    oct_save_double»     (const·double·*a,·const·double·*b,·int·len)·;
95 \xd 
96 \xd 
97 void»   delete_file·(int·format,·const·char·*filename)·;.74 void»   delete_file·(int·format,·const·char·*filename)·;
98 \xd 
99 int»    »    truncate_file_to_zero·(const·char·*fname)·;.75 int»    »    truncate_file_to_zero·(const·char·*fname)·;
100 \xd 
101 void»   count_open_files·(void)·;.76 void»   count_open_files·(void)·;
102 void»   increment_open_file_count·(void)·;.77 void»   increment_open_file_count·(void)·;
103 void»   check_open_file_count_or_die·(int·lineno)·;.78 void»   check_open_file_count_or_die·(int·lineno)·;
104 \xd 
105 #ifdef·SNDFILE_H.79 #ifdef·SNDFILE_H
106 \xd 
107 static·inline·void.80 static·inline·void
108 sf_info_clear·(SF_INFO·*·info).81 sf_info_clear·(SF_INFO·*·info)
109 {»      memset·(info,·0,·sizeof·(SF_INFO))·;.82 {»      memset·(info,·0,·sizeof·(SF_INFO))·;
110 }·/*·sf_info_clear·*/.83 }·/*·sf_info_clear·*/
111 \xd 
112 static·inline·void.84 static·inline·void
113 sf_info_setup·(SF_INFO·*·info,·int·format,·int·samplerate,·int·channels).85 sf_info_setup·(SF_INFO·*·info,·int·format,·int·samplerate,·int·channels)
114 {»      sf_info_clear·(info)·;.86 {»      sf_info_clear·(info)·;
115 \xd 
116 »       info->format·=·format·;.87 »       info->format·=·format·;
117 »       info->samplerate·=·samplerate·;.88 »       info->samplerate·=·samplerate·;
118 »       info->channels·=·channels·;.89 »       info->channels·=·channels·;
119 }·/*·sf_info_setup·*/.90 }·/*·sf_info_setup·*/
120 \xd 
121 \xd 
122 void·»   dump_log_buffer·(SNDFILE·*file)·;.91 void·»   dump_log_buffer·(SNDFILE·*file)·;
123 void·»   check_log_buffer_or_die·(SNDFILE·*file,·int·line_num)·;.92 void·»   check_log_buffer_or_die·(SNDFILE·*file,·int·line_num)·;
124 int·»    string_in_log_buffer·(SNDFILE·*file,·const·char·*s)·;.93 int·»    string_in_log_buffer·(SNDFILE·*file,·const·char·*s)·;
125 void»   hexdump_file·(const·char·*·filename,·sf_count_t·offset,·sf_count_t·length)·;.94 void»   hexdump_file·(const·char·*·filename,·sf_count_t·offset,·sf_count_t·length)·;
126 \xd 
127 void»   test_sf_format_or_die»      (const·SF_INFO·*info,·int·line_num)·;.95 void»   test_sf_format_or_die»      (const·SF_INFO·*info,·int·line_num)·;
Max diff block lines reached; -1/14177 bytes (-0.01%) of diff not shown.
48.7 KB
libsndfile-1.0.30/tests/utils.tpl
    
Offset 1, 927 lines modifiedOffset 1, 927 lines modified
1 [+·AutoGen5·template·h·c·+].1 [+·AutoGen5·template·h·c·+]
2 /*.2 /*
3 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>.3 **·Copyright·(C)·2002-2018·Erik·de·Castro·Lopo·<erikd@mega-nerd.com>
4 **.4 **
5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify.5 **·This·program·is·free·software;·you·can·redistribute·it·and/or·modify
6 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by.6 **·it·under·the·terms·of·the·GNU·General·Public·License·as·published·by
7 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or.7 **·the·Free·Software·Foundation;·either·version·2·of·the·License,·or
8 **·(at·your·option)·any·later·version..8 **·(at·your·option)·any·later·version.
9 **.9 **
10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,.10 **·This·program·is·distributed·in·the·hope·that·it·will·be·useful,
11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of.11 **·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the.12 **·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the
13 **·GNU·General·Public·License·for·more·details..13 **·GNU·General·Public·License·for·more·details.
14 **.14 **
15 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License.15 **·You·should·have·received·a·copy·of·the·GNU·General·Public·License
16 **·along·with·this·program;·if·not,·write·to·the·Free·Software.16 **·along·with·this·program;·if·not,·write·to·the·Free·Software
17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA..17 **·Foundation,·Inc.,·59·Temple·Place·-·Suite·330,·Boston,·MA·02111-1307,·USA.
18 */.18 */
19 \xd 
20 /*.19 /*
21 **»     Utility·functions·to·make·writing·the·test·suite·easier..20 **»     Utility·functions·to·make·writing·the·test·suite·easier.
22 **.21 **
23 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from.22 **»     The·.c·and·.h·files·were·generated·automagically·with·Autogen·from
24 **»     the·files·utils.def·and·utils.tpl..23 **»     the·files·utils.def·and·utils.tpl.
25 */.24 */
26 \xd 
27 [+·CASE·(suffix)·+].25 [+·CASE·(suffix)·+]
28 [+·==··h··+].26 [+·==··h··+]
29 \xd 
30 #ifdef·__cplusplus.27 #ifdef·__cplusplus
31 extern·"C"·{.28 extern·"C"·{
32 #endif» /*·__cplusplus·*/.29 #endif» /*·__cplusplus·*/
33 \xd 
34 #include·"sfconfig.h".30 #include·"sfconfig.h"
35 \xd 
36 #include·<stdint.h>.31 #include·<stdint.h>
37 #include·<stdarg.h>.32 #include·<stdarg.h>
38 \xd 
39 #define»ARRAY_LEN(x)»    »    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0]))).33 #define»ARRAY_LEN(x)»    »    ((int)·(sizeof·(x))·/·(sizeof·((x)·[0])))
40 #define·SIGNED_SIZEOF(x)»((int64_t)·(sizeof·(x))).34 #define·SIGNED_SIZEOF(x)»((int64_t)·(sizeof·(x)))
41 #define»NOT(x)»  »  »  »  (!·(x)).35 #define»NOT(x)»  »  »  »  (!·(x))
42 #define»ABS(x)»  »  »  »  ((x)·>=·0·?·(x)·:·-·(x)).36 #define»ABS(x)»  »  »  »  ((x)·>=·0·?·(x)·:·-·(x))
43 \xd 
44 #define»PIPE_INDEX(x)»   ((x)·+·500).37 #define»PIPE_INDEX(x)»   ((x)·+·500)
45 #define»PIPE_TEST_LEN»   12345.38 #define»PIPE_TEST_LEN»   12345
46 \xd 
47 \xd 
48 [+·FOR·float_type.39 [+·FOR·float_type
49 +]void·gen_windowed_sine_[+·(get·"name")·+]·([+·(get·"name")·+]·*data,·int·len,·double·maximum)·;.40 +]void·gen_windowed_sine_[+·(get·"name")·+]·([+·(get·"name")·+]·*data,·int·len,·double·maximum)·;
50 [+·ENDFOR·float_type.41 [+·ENDFOR·float_type
51 +].42 +]
52 \xd 
53 void»   create_short_sndfile·(const·char·*filename,·int·format,·int·channels)·;.43 void»   create_short_sndfile·(const·char·*filename,·int·format,·int·channels)·;
54 \xd 
55 void»   check_file_hash_or_die»     (const·char·*filename,·uint64_t·target_hash,·int·line_num)·;.44 void»   check_file_hash_or_die»     (const·char·*filename,·uint64_t·target_hash,·int·line_num)·;
56 \xd 
57 void»   print_test_name·(const·char·*test,·const·char·*filename)·;.45 void»   print_test_name·(const·char·*test,·const·char·*filename)·;
58 \xd 
59 void»   dump_data_to_file·(const·char·*filename,·const·void·*data,·unsigned·int·datalen)·;.46 void»   dump_data_to_file·(const·char·*filename,·const·void·*data,·unsigned·int·datalen)·;
60 \xd 
61 void»   write_mono_file·(const·char·*·filename,·int·format,·int·srate,·float·*·output,·int·len)·;.47 void»   write_mono_file·(const·char·*·filename,·int·format,·int·srate,·float·*·output,·int·len)·;
62 \xd 
63 #ifdef·__GNUC__.48 #ifdef·__GNUC__
64 static·inline·void.49 static·inline·void
65 exit_if_true·(int·test,·const·char·*format,·...).50 exit_if_true·(int·test,·const·char·*format,·...)
66 #if·(defined·(__USE_MINGW_ANSI_STDIO)·&&·__USE_MINGW_ANSI_STDIO·&&·!defined·(__clang__)).51 #if·(defined·(__USE_MINGW_ANSI_STDIO)·&&·__USE_MINGW_ANSI_STDIO·&&·!defined·(__clang__))
67 »       __attribute__·((format·(gnu_printf,·2,·3)))·;.52 »       __attribute__·((format·(gnu_printf,·2,·3)))·;
68 #else.53 #else
69 »       __attribute__·((format·(printf,·2,·3)))·;.54 »       __attribute__·((format·(printf,·2,·3)))·;
70 #endif.55 #endif
71 #endif.56 #endif
72 \xd 
73 static·inline·void.57 static·inline·void
74 exit_if_true·(int·test,·const·char·*format,·...).58 exit_if_true·(int·test,·const·char·*format,·...)
75 {»      if·(test).59 {»      if·(test)
76 »       {»      va_list»       argptr·;.60 »       {»      va_list»       argptr·;
77 »       »       va_start·(argptr,·format)·;.61 »       »       va_start·(argptr,·format)·;
78 »       »       vprintf·(format,·argptr)·;.62 »       »       vprintf·(format,·argptr)·;
79 »       »       va_end·(argptr)·;.63 »       »       va_end·(argptr)·;
80 »       »       exit·(1)·;.64 »       »       exit·(1)·;
81 »       »       }·;.65 »       »       }·;
82 }·/*·exit_if_true·*/.66 }·/*·exit_if_true·*/
83 \xd 
84 static·inline·int32_t.67 static·inline·int32_t
85 arith_shift_left·(int32_t·x,·int·shift).68 arith_shift_left·(int32_t·x,·int·shift)
86 {»      return·(int32_t)·(((uint32_t)·x)·<<·shift)·;.69 {»      return·(int32_t)·(((uint32_t)·x)·<<·shift)·;
87 }·/*·arith_shift_left·*/.70 }·/*·arith_shift_left·*/
88 \xd 
89 /*.71 /*
90 **»     Functions·for·saving·two·vectors·of·data·in·an·ascii·text·file·which.72 **»     Functions·for·saving·two·vectors·of·data·in·an·ascii·text·file·which
91 **»     can·then·be·loaded·into·GNU·octave·for·comparison..73 **»     can·then·be·loaded·into·GNU·octave·for·comparison.
92 */.74 */
93 \xd 
94 [+·FOR·io_type.75 [+·FOR·io_type
95 +]int»  oct_save_[+·(get·"io_element")·+]»    (const·[+·(get·"io_element")·+]·*a,·const·[+·(get·"io_element")·+]·*b,·int·len)·;.76 +]int»  oct_save_[+·(get·"io_element")·+]»    (const·[+·(get·"io_element")·+]·*a,·const·[+·(get·"io_element")·+]·*b,·int·len)·;
96 [+·ENDFOR·io_type.77 [+·ENDFOR·io_type
97 +].78 +]
98 \xd 
99 void»   delete_file·(int·format,·const·char·*filename)·;.79 void»   delete_file·(int·format,·const·char·*filename)·;
100 \xd 
101 int»    »    truncate_file_to_zero·(const·char·*fname)·;.80 int»    »    truncate_file_to_zero·(const·char·*fname)·;
102 \xd 
103 void»   count_open_files·(void)·;.81 void»   count_open_files·(void)·;
104 void»   increment_open_file_count·(void)·;.82 void»   increment_open_file_count·(void)·;
105 void»   check_open_file_count_or_die·(int·lineno)·;.83 void»   check_open_file_count_or_die·(int·lineno)·;
106 \xd 
107 #ifdef·SNDFILE_H.84 #ifdef·SNDFILE_H
108 \xd 
109 static·inline·void.85 static·inline·void
110 sf_info_clear·(SF_INFO·*·info).86 sf_info_clear·(SF_INFO·*·info)
111 {»      memset·(info,·0,·sizeof·(SF_INFO))·;.87 {»      memset·(info,·0,·sizeof·(SF_INFO))·;
112 }·/*·sf_info_clear·*/.88 }·/*·sf_info_clear·*/
113 \xd 
114 static·inline·void.89 static·inline·void
115 sf_info_setup·(SF_INFO·*·info,·int·format,·int·samplerate,·int·channels).90 sf_info_setup·(SF_INFO·*·info,·int·format,·int·samplerate,·int·channels)
116 {»      sf_info_clear·(info)·;.91 {»      sf_info_clear·(info)·;
117 \xd 
118 »       info->format·=·format·;.92 »       info->format·=·format·;
119 »       info->samplerate·=·samplerate·;.93 »       info->samplerate·=·samplerate·;
120 »       info->channels·=·channels·;.94 »       info->channels·=·channels·;
121 }·/*·sf_info_setup·*/.95 }·/*·sf_info_setup·*/
122 \xd 
123 \xd 
124 void·»   dump_log_buffer·(SNDFILE·*file)·;.96 void·»   dump_log_buffer·(SNDFILE·*file)·;
125 void·»   check_log_buffer_or_die·(SNDFILE·*file,·int·line_num)·;.97 void·»   check_log_buffer_or_die·(SNDFILE·*file,·int·line_num)·;
126 int·»    string_in_log_buffer·(SNDFILE·*file,·const·char·*s)·;.98 int·»    string_in_log_buffer·(SNDFILE·*file,·const·char·*s)·;
127 void»   hexdump_file·(const·char·*·filename,·sf_count_t·offset,·sf_count_t·length)·;.99 void»   hexdump_file·(const·char·*·filename,·sf_count_t·offset,·sf_count_t·length)·;
Max diff block lines reached; -1/49777 bytes (-0.00%) of diff not shown.