Parent Directory
|
Revision Log
1.2.1 release
1 /* 2 DDS GIMP plugin 3 4 Copyright (C) 2004 Shawn Kirst <skirst@fuse.net>, 5 with parts (C) 2003 Arne Reuter <homepage@arnereuter.de> where specified. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public 9 License as published by the Free Software Foundation; either 10 version 2 of the License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; see the file COPYING. If not, write to 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 Boston, MA 02111-1307, USA. 21 */ 22 23 #ifndef __ENDIAN_H 24 #define __ENDIAN_H 25 26 #define GETL64(buf) \ 27 (((unsigned long long)(buf)[0] ) | \ 28 ((unsigned long long)(buf)[1] << 8) | \ 29 ((unsigned long long)(buf)[2] << 16) | \ 30 ((unsigned long long)(buf)[3] << 24) | \ 31 ((unsigned long long)(buf)[4] << 32) | \ 32 ((unsigned long long)(buf)[5] << 40) | \ 33 ((unsigned long long)(buf)[6] << 48) | \ 34 ((unsigned long long)(buf)[7] << 56)) 35 36 #define GETL32(buf) \ 37 (((unsigned int)(buf)[0] ) | \ 38 ((unsigned int)(buf)[1] << 8) | \ 39 ((unsigned int)(buf)[2] << 16) | \ 40 ((unsigned int)(buf)[3] << 24)) 41 42 #define GETL16(buf) \ 43 (((unsigned short)(buf)[0] ) | \ 44 ((unsigned short)(buf)[1] << 8)) 45 46 #define CHAR32(c0, c1, c2, c3) \ 47 ((unsigned int)(((c0) & 0xff) ) | \ 48 (((c1) & 0xff) << 8) | \ 49 (((c2) & 0xff) << 16) | \ 50 (((c3) & 0xff) << 24)) 51 52 #define PUTL32(buf, l) \ 53 (buf)[0] = ((l) & 0x000000FF);\ 54 (buf)[1] = ((l) & 0x0000FF00) >> 8;\ 55 (buf)[2] = ((l) & 0x00FF0000) >> 16;\ 56 (buf)[3] = ((l) & 0xFF000000) >> 24; 57 58 #endif
| ViewVC Help | |
| Powered by ViewVC 1.0.4 |