staging: csr: remove CsrMemSet
[linux-2.6-block.git] / drivers / staging / csr / csr_util.h
1 #ifndef CSR_UTIL_H__
2 #define CSR_UTIL_H__
3 /*****************************************************************************
4
5             (c) Cambridge Silicon Radio Limited 2010
6             All rights reserved and confidential information of CSR
7
8             Refer to LICENSE.txt included with this source for details
9             on the license terms.
10
11 *****************************************************************************/
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 #include <linux/kernel.h>
18 #include <linux/types.h>
19 #include "csr_macro.h"
20
21 /*------------------------------------------------------------------*/
22 /* Base conversion */
23 /*------------------------------------------------------------------*/
24 void CsrUInt16ToHex(u16 number, char *str);
25
26 /*------------------------------------------------------------------*/
27 /* Standard C Library functions */
28 /*------------------------------------------------------------------*/
29 #ifdef CSR_USE_STDC_LIB
30 #define CsrMemCpy memcpy
31 #define CsrMemMove memmove
32 #define CsrStrCpy strcpy
33 #define CsrStrNCpy strncpy
34 #define CsrMemCmp(s1, s2, n) ((s32) memcmp((s1), (s2), (n)))
35 #define CsrStrCmp(s1, s2) ((s32) strcmp((s1), (s2)))
36 #define CsrStrNCmp(s1, s2, n) ((s32) strncmp((s1), (s2), (n)))
37 #define CsrStrChr strchr
38 #define CsrStrLen strlen
39 #else /* !CSR_USE_STDC_LIB */
40 void *CsrMemCpy(void *dest, const void *src, size_t count);
41 void *CsrMemMove(void *dest, const void *src, size_t count);
42 char *CsrStrCpy(char *dest, const char *src);
43 char *CsrStrNCpy(char *dest, const char *src, size_t count);
44 s32 CsrMemCmp(const void *buf1, const void *buf2, size_t count);
45 s32 CsrStrCmp(const char *string1, const char *string2);
46 s32 CsrStrNCmp(const char *string1, const char *string2, size_t count);
47 char *CsrStrChr(const char *string, char c);
48 size_t CsrStrLen(const char *string);
49 #endif /* !CSR_USE_STDC_LIB */
50 s32 CsrVsnprintf(char *string, size_t count, const char *format, va_list args);
51
52 /*------------------------------------------------------------------*/
53 /* Non-standard utility functions */
54 /*------------------------------------------------------------------*/
55 char *CsrStrDup(const char *string);
56
57 #define CsrOffsetOf(st, m)  ((size_t) & ((st *) 0)->m)
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif