1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 */ 16 17 #ifndef __BLI_ENDIAN_SWITCH_H__ 18 #define __BLI_ENDIAN_SWITCH_H__ 19 20 /** \file 21 * \ingroup bli 22 */ 23 24 #include "BLI_compiler_attrs.h" 25 #include "BLI_utildefines.h" 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 /* BLI_endian_switch_inline.h */ 32 BLI_INLINE void BLI_endian_switch_int16(short *val) ATTR_NONNULL(1); 33 BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val) ATTR_NONNULL(1); 34 BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1); 35 BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val) ATTR_NONNULL(1); 36 BLI_INLINE void BLI_endian_switch_float(float *val) ATTR_NONNULL(1); 37 BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_NONNULL(1); 38 BLI_INLINE void BLI_endian_switch_uint64(uint64_t *val) ATTR_NONNULL(1); 39 BLI_INLINE void BLI_endian_switch_double(double *val) ATTR_NONNULL(1); 40 41 /* endian_switch.c */ 42 void BLI_endian_switch_int16_array(short *val, const int size) ATTR_NONNULL(1); 43 void BLI_endian_switch_uint16_array(unsigned short *val, const int size) ATTR_NONNULL(1); 44 void BLI_endian_switch_int32_array(int *val, const int size) ATTR_NONNULL(1); 45 void BLI_endian_switch_uint32_array(unsigned int *val, const int size) ATTR_NONNULL(1); 46 void BLI_endian_switch_float_array(float *val, const int size) ATTR_NONNULL(1); 47 void BLI_endian_switch_int64_array(int64_t *val, const int size) ATTR_NONNULL(1); 48 void BLI_endian_switch_uint64_array(uint64_t *val, const int size) ATTR_NONNULL(1); 49 void BLI_endian_switch_double_array(double *val, const int size) ATTR_NONNULL(1); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #include "BLI_endian_switch_inline.h" 56 57 #endif /* __BLI_ENDIAN_SWITCH_H__ */ 58