FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/inc/stddefs.h @ 316:79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 10 Apr 2014 04:06:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
315:1b4beffc8055 | 316:79080922d8e4 |
---|---|
1 /* | |
2 +------------------------------------------------------------------------------ | |
3 | File: stddefs.h | |
4 +------------------------------------------------------------------------------ | |
5 | Copyright 2002 Texas Instruments Berlin, AG | |
6 | All rights reserved. | |
7 | | |
8 | This file is confidential and a trade secret of Texas | |
9 | Instruments Berlin, AG | |
10 | The receipt of or possession of this file does not convey | |
11 | any rights to reproduce or disclose its contents or to | |
12 | manufacture, use, or sell anything it may describe, in | |
13 | whole, or in part, without the specific written consent of | |
14 | Texas Instruments Berlin, AG. | |
15 +----------------------------------------------------------------------------- | |
16 | Purpose : Old frame standard definitions. | |
17 +----------------------------------------------------------------------------- | |
18 */ | |
19 | |
20 | |
21 #ifndef __STDDEFS_H__ | |
22 #define __STDDEFS_H__ | |
23 | |
24 #ifndef OLD_FRAME | |
25 #ifndef NEW_FRAME | |
26 #define NEW_FRAME | |
27 #endif | |
28 #endif | |
29 | |
30 /*==== CONSTANTS ==================================================*/ | |
31 | |
32 #define FALSE 0 | |
33 #define TRUE 1 | |
34 | |
35 #define BIT123 0x07 | |
36 #define BIT4 0x08 | |
37 #define BIT78 0xC0 | |
38 | |
39 #if defined (USE_DLL) | |
40 #ifdef WIN32 | |
41 #define EXPORT __declspec (dllexport) | |
42 #define IMPORT __declspec (dllimport) | |
43 #endif | |
44 #else | |
45 #define EXPORT GLOBAL | |
46 #define IMPORT EXTERN | |
47 #endif | |
48 | |
49 #ifndef __cplusplus | |
50 #define EXTERN extern | |
51 #else | |
52 #define EXTERN extern "C" | |
53 #endif | |
54 | |
55 /* Horrible handling of GLOBAL and MAINFILE macros | |
56 Documented in BugTrak#DNCL-3PWCL3 */ | |
57 #ifdef L1_LIB | |
58 #ifdef L1_COM_C | |
59 #define GLOBAL | |
60 #define MAINFILE 1 | |
61 #else | |
62 #ifndef __cplusplus | |
63 #define GLOBAL extern | |
64 #else | |
65 #define GLOBAL extern "C" | |
66 #endif | |
67 #endif | |
68 #else | |
69 #define GLOBAL | |
70 #endif | |
71 | |
72 #define LOCAL static | |
73 | |
74 #define AND && | |
75 #define OR || | |
76 #define XOR(A,B) ((!(A) AND (B)) OR ((A) AND !(B))) | |
77 | |
78 #define EQ == | |
79 #define NEQ != | |
80 | |
81 #ifndef NULL | |
82 #define NULL 0 | |
83 #endif | |
84 /*==== TYPES ======================================================*/ | |
85 #ifndef WIN32 | |
86 typedef char BYTE; | |
87 #else | |
88 typedef unsigned char BYTE; | |
89 #endif | |
90 | |
91 #if !defined (NUCLEUS) | |
92 typedef char CHAR; | |
93 #endif | |
94 | |
95 | |
96 | |
97 typedef long LONG; | |
98 typedef unsigned char UBYTE; | |
99 typedef unsigned char UCHAR; | |
100 typedef unsigned short USHORT; | |
101 typedef unsigned long ULONG; | |
102 typedef unsigned short UINT16; | |
103 typedef unsigned long UINT32; | |
104 typedef unsigned short UNSIGNED16; | |
105 | |
106 typedef unsigned long T_VOID_STRUCT; | |
107 | |
108 #ifndef L1_LIB | |
109 typedef short SHORT; | |
110 #ifdef WIN32 | |
111 typedef int BOOL; | |
112 #else | |
113 typedef UBYTE BOOL; | |
114 #endif | |
115 #endif | |
116 | |
117 #if !defined (T_SDU_DEFINED) | |
118 | |
119 #define T_SDU_DEFINED | |
120 | |
121 typedef struct | |
122 { | |
123 USHORT l_buf; | |
124 USHORT o_buf; | |
125 UBYTE buf[1]; | |
126 } T_sdu; | |
127 | |
128 #endif /* T_SDU_DEFINED */ | |
129 | |
130 | |
131 #if !defined (T_FRAME_DESC_DEFINED) | |
132 | |
133 #define T_FRAME_DESC_DEFINED | |
134 | |
135 typedef struct | |
136 { | |
137 UBYTE *Adr[2]; | |
138 USHORT Len[2]; | |
139 } T_FRAME_DESC; | |
140 | |
141 #endif /* T_FRAME_DESC_DEFINED */ | |
142 | |
143 | |
144 /* | |
145 * for definitions of jumptables | |
146 */ | |
147 #ifndef NEW_ENTITY | |
148 typedef void (*T_VOID_FUNC)(); | |
149 typedef short (*T_SHORT_FUNC)(); | |
150 #endif | |
151 typedef USHORT (*T_USHORT_FUNC)(); | |
152 | |
153 /* SDU_TRAIL denotes the memory size starting at 'buf' to the end of T_sdu */ | |
154 | |
155 #define SDU_TRAIL ((char*)(((T_sdu*)0)+1)-(char*)(((T_sdu*)0)->buf)) | |
156 | |
157 /*==== EXPORT =====================================================*/ | |
158 #define MAXIMUM(A,B) (((A)>(B))?(A):(B)) | |
159 | |
160 #define MINIMUM(A,B) (((A)<(B))?(A):(B)) | |
161 | |
162 #define _STR(x) __STR(x) | |
163 #define __STR(x) #x | |
164 | |
165 #define ALERT(CONDITION,TEXT) \ | |
166 { \ | |
167 if (!(CONDITION)) \ | |
168 ext_abort (#TEXT "\n" __FILE__ ", line " _STR(__LINE__)); \ | |
169 } | |
170 | |
171 | |
172 /*==== MISC =======================================================*/ | |
173 | |
174 | |
175 #endif | |
176 |