/** * @file endian.c * * * @brief バイトオーダー変換 * * * * @brief Byte order swapping * * * @author Akinobu LEE * @date Thu Feb 17 15:43:46 2005 * * $Revision: 1.5 $ * */ /* * Copyright (c) 1991-2012 Kawahara Lab., Kyoto University * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology * Copyright (c) 2005-2012 Julius project team, Nagoya Institute of Technology * All rights reserved */ #include /** * Generic byte-swapping functions for any size of unit. * * @param buf [i/o] data buffer * @param unitbyte [in] size of unit in bytes * @param unitnum [in] number of unit in the buffer */ void swap_bytes(char *buf, size_t unitbyte, size_t unitnum) { char *p, c; int i, j; p = buf; while (unitnum > 0) { i=0; j=unitbyte-1; while(i