3 /*****************************************************************************
5 (c) Cambridge Silicon Radio Limited 2010
6 All rights reserved and confidential information of CSR
8 Refer to LICENSE.txt included with this source for details
11 *****************************************************************************/
17 #include <linux/kernel.h>
18 #include <linux/types.h>
19 #include "csr_macro.h"
21 /*------------------------------------------------------------------*/
23 /*------------------------------------------------------------------*/
24 void CsrUInt16ToHex(u16 number, char *str);
26 /*------------------------------------------------------------------*/
27 /* Standard C Library functions */
28 /*------------------------------------------------------------------*/
29 #ifdef CSR_USE_STDC_LIB
30 #define CsrMemCpy memcpy
31 #define CsrStrCpy strcpy
32 #define CsrStrNCpy strncpy
33 #define CsrStrCmp(s1, s2) ((s32) strcmp((s1), (s2)))
34 #define CsrStrNCmp(s1, s2, n) ((s32) strncmp((s1), (s2), (n)))
35 #define CsrStrChr strchr
36 #define CsrStrLen strlen
37 #else /* !CSR_USE_STDC_LIB */
38 void *CsrMemCpy(void *dest, const void *src, size_t count);
39 char *CsrStrCpy(char *dest, const char *src);
40 char *CsrStrNCpy(char *dest, const char *src, size_t count);
41 s32 CsrStrCmp(const char *string1, const char *string2);
42 s32 CsrStrNCmp(const char *string1, const char *string2, size_t count);
43 char *CsrStrChr(const char *string, char c);
44 size_t CsrStrLen(const char *string);
45 #endif /* !CSR_USE_STDC_LIB */
46 s32 CsrVsnprintf(char *string, size_t count, const char *format, va_list args);
48 /*------------------------------------------------------------------*/
49 /* Non-standard utility functions */
50 /*------------------------------------------------------------------*/
51 char *CsrStrDup(const char *string);
53 #define CsrOffsetOf(st, m) ((size_t) & ((st *) 0)->m)