ROHC compression/decompression library
rohc_utils.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012,2013 Didier Barvaux
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 /**
00020  * @file   rohc_utils.h
00021  * @brief  Miscellaneous utils for ROHC libraries
00022  * @author Didier Barvaux <didier@barvaux.org>
00023  */
00024 
00025 #ifndef ROHC_UTILS_H
00026 #define ROHC_UTILS_H
00027 
00028 #include <stdint.h>
00029 
00030 #include "dllexport.h"
00031 
00032 /** Get the max value of the 2 given */
00033 #define rohc_max(value1, value2) \
00034         ( ((value1) >= (value2)) ? (value1) : (value2) )
00035 
00036 /** Get the max value of the 2 given */
00037 #define rohc_min(value1, value2) \
00038         ( ((value1) <= (value2)) ? (value1) : (value2) )
00039 
00040 uint32_t ROHC_EXPORT rohc_ntoh32(const uint32_t net32)
00041         __attribute__((warn_unused_result, const));
00042 uint16_t ROHC_EXPORT rohc_ntoh16(const uint16_t net16)
00043         __attribute__((warn_unused_result, const));
00044 uint32_t ROHC_EXPORT rohc_hton32(const uint32_t host32)
00045         __attribute__((warn_unused_result, const));
00046 uint16_t ROHC_EXPORT rohc_hton16(const uint16_t host16)
00047         __attribute__((warn_unused_result, const));
00048 
00049 #endif
00050