]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/Reliance-Edge/include/redutils.h
Minor modification to the WIn32 simple TCP/IP stack example only.
[freertos] / FreeRTOS-Plus / Source / Reliance-Edge / include / redutils.h
1 /*             ----> DO NOT REMOVE THE FOLLOWING NOTICE <----\r
2 \r
3                    Copyright (c) 2014-2015 Datalight, Inc.\r
4                        All Rights Reserved Worldwide.\r
5 \r
6     This program is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; use version 2 of the License.\r
9 \r
10     This program is distributed in the hope that it will be useful,\r
11     but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty\r
12     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13     GNU General Public License for more details.\r
14 \r
15     You should have received a copy of the GNU General Public License along\r
16     with this program; if not, write to the Free Software Foundation, Inc.,\r
17     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 */\r
19 /*  Businesses and individuals that for commercial or other reasons cannot\r
20     comply with the terms of the GPLv2 license may obtain a commercial license\r
21     before incorporating Reliance Edge into proprietary software for\r
22     distribution in any form.  Visit http://www.datalight.com/reliance-edge for\r
23     more information.\r
24 */\r
25 /** @file\r
26 */\r
27 #ifndef REDUTILS_H\r
28 #define REDUTILS_H\r
29 \r
30 \r
31 #if REDCONF_ASSERTS == 1\r
32 #define REDERROR()      RedOsAssertFail(__FILE__, __LINE__)\r
33 #define REDASSERT(EXP)  ((EXP) ? (void)0 : REDERROR())\r
34 #else\r
35 #define REDERROR()      ((void)0)\r
36 #define REDASSERT(EXP)  ((void)0)\r
37 #endif\r
38 \r
39 \r
40 void RedMemCpy(void *pDest, const void *pSrc, uint32_t ulLen);\r
41 void RedMemMove(void *pDest, const void *pSrc, uint32_t ulLen);\r
42 void RedMemSet(void *pDest, uint8_t bVal, uint32_t ulLen);\r
43 int32_t RedMemCmp(const void *pMem1, const void *pMem2, uint32_t ulLen);\r
44 \r
45 uint32_t RedStrLen(const char *pszStr);\r
46 int32_t RedStrCmp(const char *pszStr1, const char *pszStr2);\r
47 int32_t RedStrNCmp(const char *pszStr1, const char *pszStr2, uint32_t ulLen);\r
48 void RedStrNCpy(char *pszDst, const char *pszSrc, uint32_t ulLen);\r
49 \r
50 uint32_t RedCrc32Update(uint32_t ulInitCrc32, const void *pBuffer, uint32_t ulLength);\r
51 uint32_t RedCrcNode(const void *pBuffer);\r
52 \r
53 #if REDCONF_API_POSIX == 1\r
54 uint32_t RedNameLen(const char *pszName);\r
55 #endif\r
56 \r
57 bool RedBitGet(const uint8_t *pbBitmap, uint32_t ulBit);\r
58 void RedBitSet(uint8_t *pbBitmap, uint32_t ulBit);\r
59 void RedBitClear(uint8_t *pbBitmap, uint32_t ulBit);\r
60 \r
61 #ifdef REDCONF_ENDIAN_SWAP\r
62 uint64_t RedRev64(uint64_t ullToRev);\r
63 uint32_t RedRev32(uint32_t ulToRev);\r
64 uint16_t RedRev16(uint16_t uToRev);\r
65 #endif\r
66 \r
67 void RedSignOn(void);\r
68 \r
69 \r
70 #endif\r
71 \r