gnutls_num.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
00003  *
00004  * Author: Nikos Mavrogiannopoulos
00005  *
00006  * This file is part of GNUTLS.
00007  *
00008  * The GNUTLS library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00021  * USA
00022  *
00023  */
00024 
00025 #include <gnutls_int.h>
00026 
00027 #define rotl32(x,n)   (((x) << ((uint16_t)(n))) | ((x) >> (32 - (uint16_t)(n))))
00028 #define rotr32(x,n)   (((x) >> ((uint16_t)(n))) | ((x) << (32 - (uint16_t)(n))))
00029 #define rotl16(x,n)   (((x) << ((uint16_t)(n))) | ((x) >> (16 - (uint16_t)(n))))
00030 #define rotr16(x,n)   (((x) >> ((uint16_t)(n))) | ((x) << (16 - (uint16_t)(n))))
00031 
00032 #define byteswap16(x)  ((rotl16(x, 8) & 0x00ff) | (rotr16(x, 8) & 0xff00))
00033 #define byteswap32(x)  ((rotl32(x, 8) & 0x00ff00ffUL) | (rotr32(x, 8) & 0xff00ff00UL))
00034 
00035 uint32_t MHD_gtls_uint24touint32 (uint24 num);
00036 uint24 MHD_gtls_uint32touint24 (uint32_t num);
00037 uint32_t MHD_gtls_read_uint32 (const opaque * data);
00038 uint16_t MHD_gtls_read_uint16 (const opaque * data);
00039 uint32_t MHD_gtls_conv_uint32 (uint32_t data);
00040 uint16_t MHD_gtls_conv_uint16 (uint16_t data);
00041 uint32_t MHD_gtls_read_uint24 (const opaque * data);
00042 void MHD_gtls_write_uint24 (uint32_t num, opaque * data);
00043 void MHD_gtls_write_uint32 (uint32_t num, opaque * data);
00044 void MHD_gtls_write_uint16 (uint16_t num, opaque * data);
00045 uint32_t MHD_gtls_uint64touint32 (const uint64 *);
00046 
00047 int MHD_gtls_uint64pp (uint64 *);
00048 #define MHD__gnutls_uint64zero(x) x.i[0] = x.i[1] = x.i[2] = x.i[3] = x.i[4] = x.i[5] = x.i[6] = x.i[7] = 0
00049 #define UINT64DATA(x) x.i

Generated on Tue May 19 23:21:08 2009 for GNU libmicrohttpd by  doxygen 1.5.8