data_types.h revision e9df6ba5a8fcccf306a80b1670b423be8fe7746a
1/******************************************************************************
2 *
3 *  Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 *  Licensed under the Apache License, Version 2.0 (the "License");
6 *  you may not use this file except in compliance with the License.
7 *  You may obtain a copy of the License at:
8 *
9 *  http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *  Unless required by applicable law or agreed to in writing, software
12 *  distributed under the License is distributed on an "AS IS" BASIS,
13 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  See the License for the specific language governing permissions and
15 *  limitations under the License.
16 *
17 ******************************************************************************/
18#ifndef DATA_TYPES_H
19#define DATA_TYPES_H
20
21#ifndef NULL
22#define NULL     0
23#endif
24
25#ifndef FALSE
26#define FALSE  0
27#endif
28
29typedef unsigned char   UINT8;
30typedef unsigned short  UINT16;
31typedef unsigned long   UINT32;
32typedef unsigned long long int UINT64;
33typedef signed   long   INT32;
34typedef signed   char   INT8;
35typedef signed   short  INT16;
36typedef unsigned char   BOOLEAN;
37
38typedef UINT32          TIME_STAMP;
39
40#ifndef TRUE
41#define TRUE   (!FALSE)
42#endif
43
44typedef unsigned char   UBYTE;
45
46#ifdef __arm
47#define PACKED  __packed
48#define INLINE  __inline
49#else
50#define PACKED
51#define INLINE
52#endif
53
54#ifndef BIG_ENDIAN
55#define BIG_ENDIAN FALSE
56#endif
57
58#define UINT16_LOW_BYTE(x)      ((x) & 0xff)
59#define UINT16_HI_BYTE(x)       ((x) >> 8)
60
61/* MACRO definitions for safe string functions */
62/* Replace standard string functions with safe functions if available */
63#define BCM_STRCAT_S(x1,x2,x3)      strcat((x1),(x3))
64#define BCM_STRNCAT_S(x1,x2,x3,x4)  strncat((x1),(x3),(x4))
65#define BCM_STRCPY_S(x1,x2,x3)      strcpy((x1),(x3))
66#define BCM_STRNCPY_S(x1,x2,x3,x4)  strncpy((x1),(x3),(x4))
67#define BCM_SPRINTF_S(x1,x2,x3,x4)  sprintf((x1),(x3),(x4))
68#define BCM_VSPRINTF_S(x1,x2,x3,x4) vsprintf((x1),(x3),(x4))
69
70#endif
71
72