src/common.h : Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN.

This commit is contained in:
Erik de Castro Lopo 2008-09-04 09:38:34 +10:00
parent 5967cf587c
commit 34a37d1e90
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-09-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/common.h
Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN useful for splitting format
field of SF_INFO into component parts.
2008-09-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* examples/sndfile-bwf-set.c

View File

@ -104,6 +104,15 @@
#define SF_MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/*
* Macros for spliting the format file of SF_INFI into contrainer type,
** codec type and endian-ness.
*/
#define SF_CONTAINER(x) ((x) & SF_FORMAT_TYPEMASK)
#define SF_CODEC(x) ((x) & SF_FORMAT_SUBMASK)
#define SF_ENDIAN(x) ((x) & SF_FORMAT_ENDMASK)
enum
{ /* PEAK chunk location. */
SF_PEAK_START = 42,