]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/csr/csr_util.h
staging: csr: remove CsrMemMove()
[karo-tx-linux.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 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);
47
48 /*------------------------------------------------------------------*/
49 /* Non-standard utility functions */
50 /*------------------------------------------------------------------*/
51 char *CsrStrDup(const char *string);
52
53 #define CsrOffsetOf(st, m)  ((size_t) & ((st *) 0)->m)
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif