/usr/include/libvisual-0.4/libvisual/lv_bits.h is in libvisual-0.4-dev 0.4.0-11.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /* Libvisual - The audio visualisation framework.
*
* Copyright (C) 2004, 2005, 2006 Dennis Smit <ds@nerds-incorporated.org>
*
* Authors: Dennis Smit <ds@nerds-incorporated.org>
*
* $Id: lv_bits.h,v 1.3 2006/01/22 13:23:37 synap Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LV_ENDIANESS_H
#define _LV_ENDIANESS_H
#include <libvisual/lvconfig.h>
#include <libvisual/lv_defines.h>
VISUAL_BEGIN_DECLS
/**
* Macros to convert LE <-> BE
* 'I' stands for integer here.
*/
#define VISUAL_ENDIAN_LE_BE_I16(w) (\
(((w) & 0xff00) >> 8) |\
(((w) & 0x00ff) << 8) )
#define VISUAL_ENDIAN_LE_BE_I32(w) (\
(((w) & 0x000000ff) << 24) | \
(((w) & 0x0000ff00) << 8) | \
(((w) & 0x00ff0000) >> 8) | \
(((w) & 0xff000000) >> 24) )
#if VISUAL_BIG_ENDIAN & VISUAL_LITTLE_ENDIAN
# error determining system endianess.
#endif
/**
* Arch. dependant definitions
*/
#if VISUAL_BIG_ENDIAN
# define VISUAL_ENDIAN_BEI16(x) (x)
# define VISUAL_ENDIAN_BEI32(x) (x)
# define VISUAL_ENDIAN_LEI16(x) VISUAL_ENDIAN_LE_BE_I16(x)
# define VISUAL_ENDIAN_LEI32(x) VISUAL_ENDIAN_LE_BE_I32(x)
#endif
#if VISUAL_LITTLE_ENDIAN
# define VISUAL_ENDIAN_LEI16(x) (x)
# define VISUAL_ENDIAN_LEI32(x) (x)
# define VISUAL_ENDIAN_BEI16(x) VISUAL_ENDIAN_LE_BE_I16(x)
# define VISUAL_ENDIAN_BEI32(x) VISUAL_ENDIAN_LE_BE_I32(x)
#endif
/**
* Macro to check if 'x' is aligned on 'y' bytes. This macro will fail
* when supplied with '1'. However you wouldn't want to do that anyway.
*/
#define VISUAL_ALIGNED(x, y) (!(((unsigned long) x) & (y - 1)))
VISUAL_END_DECLS
#endif /* _LV_ENDIANESS_H */
|