AEESTD
Standard definitions and Error codes
AEEStdDef.h
1 #ifndef AEESTDDEF_H
2 #define AEESTDDEF_H
3 /*
4 =======================================================================
5 
6 FILE: AEEStdDef.h
7 
8 DESCRIPTION: definition of basic types, constants,
9  preprocessor macros
10 
11 =======================================================================
12 */
13 /*==============================================================================
14  Copyright (c) 2005,2007,2012-2013, 2020 Qualcomm Technologies, Inc.
15  All rights reserved.
16  Redistribution and use in source and binary forms, with or without
17  modification, are permitted provided that the following conditions are met:
18 
19  1. Redistributions of source code must retain the above copyright notice,
20  this list of conditions and the following disclaimer.
21 
22  2. Redistributions in binary form must reproduce the above copyright notice,
23  this list of conditions and the following disclaimer in the documentation
24  and/or other materials provided with the distribution.
25 
26  3. Neither the name of the copyright holder nor the names of its contributors
27  may be used to endorse or promote products derived from this software without
28  specific prior written permission.
29 
30  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
34  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40  POSSIBILITY OF SUCH DAMAGE.
41 ==============================================================================*/
42 
43 #include <stdint.h>
44 
45 #if defined(COMDEF_H) /* guards against a known re-definer */
46 #define _BOOLEAN_DEFINED
47 #define _UINT32_DEFINED
48 #define _UINT16_DEFINED
49 #define _UINT8_DEFINED
50 #define _INT32_DEFINED
51 #define _INT16_DEFINED
52 #define _INT8_DEFINED
53 #define _UINT64_DEFINED
54 #define _INT64_DEFINED
55 #define _BYTE_DEFINED
56 #endif /* #if !defined(COMDEF_H) */
57 
58 /* -----------------------------------------------------------------------
59 ** Standard Types
60 ** ----------------------------------------------------------------------- */
61 
62 /* The following definitions are the same accross platforms. This first
63 ** group are the sanctioned types.
64 */
68 #ifndef _BOOLEAN_DEFINED
69 typedef unsigned char boolean;
70 #define _BOOLEAN_DEFINED
71 #endif
72 
73 #ifndef _UINT32_DEFINED
74 typedef uint32_t uint32;
75 #define _UINT32_DEFINED
76 #endif
77 
78 #ifndef _UINT16_DEFINED
79 typedef unsigned short uint16;
80 #define _UINT16_DEFINED
81 #endif
82 
83 #ifndef _UINT8_DEFINED
84 typedef unsigned char uint8;
85 #define _UINT8_DEFINED
86 #endif
87 
88 #ifndef _INT32_DEFINED
89 typedef int32_t int32;
90 #define _INT32_DEFINED
91 #endif
92 
93 #ifndef _INT16_DEFINED
94 typedef signed short int16;
95 #define _INT16_DEFINED
96 #endif
97 
98 #ifndef _INT8_DEFINED
99 typedef signed char int8;
100 #define _INT8_DEFINED
101 #endif
102 
103 #ifndef _INT64_DEFINED
104 #if defined(__GNUC__)
105 #define __int64 long long
106 #endif
107 typedef __int64 int64;
108 #define _INT64_DEFINED
109 #endif
110 
111 #ifndef _UINT64_DEFINED
112 typedef unsigned __int64 uint64;
113 #define _UINT64_DEFINED
114 #endif
115 
116 #ifndef _BYTE_DEFINED
117 typedef unsigned char byte;
118 #define _BYTE_DEFINED
119 #endif
120 
129 #ifndef _AEEUID_DEFINED
131 typedef uint32 AEEUID;
132 #define _AEEUID_DEFINED
133 #endif
134 
135 #ifndef _AEEIID_DEFINED
136 typedef uint32 AEEIID;
137 #define _AEEIID_DEFINED
138 #endif
139 
140 #ifndef _AEECLSID_DEFINED
141 typedef uint32 AEECLSID;
142 #define _AEECLSID_DEFINED
143 #endif
144 
145 #ifndef _AEEPRIVID_DEFINED
146 typedef uint32 AEEPRIVID;
147 #define _AEEPRIVID_DEFINED
148 #endif
149 
150 #ifndef _AECHAR_DEFINED
151 typedef uint16 AECHAR;
152 #define _AECHAR_DEFINED
153 #endif
154 
159 #ifndef _AEERESULT_DEFINED
160 typedef int AEEResult;
161 #define _AEERESULT_DEFINED
162 #endif
163 
169 /* -----------------------------------------------------------------------
170 ** Function Calling Conventions
171 ** ----------------------------------------------------------------------- */
172 
173 #ifndef CDECL
174 #ifdef _MSC_VER
175 #define CDECL __cdecl
176 #else
177 #define CDECL
178 #endif /* _MSC_VER */
179 #endif /* CDECL */
180 
181 /* -----------------------------------------------------------------------
182 ** Constants
183 ** ----------------------------------------------------------------------- */
188 #ifndef TRUE
189 #define TRUE 1
190 #endif
191 
192 #ifndef FALSE
193 #define FALSE 0
194 #endif
195 
196 #ifndef NULL
197 #define NULL 0
198 #endif
199 
200 #ifndef MIN_INT8
201 #define MIN_INT8 -128
202 #endif
203 #ifndef MIN_INT16
204 #define MIN_INT16 -32768
205 #endif
206 #ifndef MIN_INT32
207 #define MIN_INT32 (~0x7fffffff)
208 #endif
209 #ifndef MIN_INT64
210 #define MIN_INT64 (~0x7fffffffffffffffLL)
211 #endif
212 
213 #ifndef MAX_INT8
214 #define MAX_INT8 127
215 #endif
216 #ifndef MAX_INT16
217 #define MAX_INT16 32767
218 #endif
219 #ifndef MAX_INT32
220 #define MAX_INT32 2147483647
221 #endif
222 #ifndef MAX_INT64
223 #define MAX_INT64 9223372036854775807LL
224 #endif
225 
226 #ifndef MAX_UINT8
227 #define MAX_UINT8 255
228 #endif
229 #ifndef MAX_UINT16
230 #define MAX_UINT16 65535
231 #endif
232 #ifndef MAX_UINT32
233 #define MAX_UINT32 4294967295u
234 #endif
235 #ifndef MAX_UINT64
236 #define MAX_UINT64 18446744073709551615uLL
237 #endif
238 
240 #ifndef MIN_AECHAR
241 #define MIN_AECHAR 0
242 #endif
243 
244 #ifndef MAX_AECHAR
245 #define MAX_AECHAR 65535
246 #endif
247 
249 
254 /* -----------------------------------------------------------------------
255 ** Preprocessor helpers
256 ** ----------------------------------------------------------------------- */
257 #define __STR__(x) #x
258 #define __TOSTR__(x) __STR__(x)
259 #define __FILE_LINE__ __FILE__ ":" __TOSTR__(__LINE__)
260 
261 /* -----------------------------------------------------------------------
262 ** Types for code generated from IDL
263 ** ----------------------------------------------------------------------- */
264 
268 #ifndef __QIDL_WCHAR_T_DEFINED__
270 #define __QIDL_WCHAR_T_DEFINED__
271 typedef uint16 _wchar_t;
272 #endif
273 
274 
275 /* __STRING_OBJECT__ will be deprecated in the future */
276 
277 
278 #if !defined(__QIDL_STRING_OBJECT_DEFINED__) && !defined(__STRING_OBJECT__)
279 #define __QIDL_STRING_OBJECT_DEFINED__
280 #define __STRING_OBJECT__
281 
286 typedef struct _cstring_s {
287  char* data;
288  int dataLen;
289  int dataLenReq;
290 } _cstring_t;
291 
297 typedef struct _wstring_s {
298  _wchar_t* data;
299  int dataLen;
300  int dataLenReq;
301 } _wstring_t;
302 #endif /* __QIDL_STRING_OBJECT_DEFINED__ */
303 
307 /*
308 =======================================================================
309  DATA STRUCTURES DOCUMENTATION
310 =======================================================================
311 
312 =======================================================================
313 
314 AEEUID
315 
316 Description:
317  This is a BREW unique ID. Used to express unique types, interfaces, classes
318  groups and privileges. The BREW ClassID Generator generates
319  unique IDs that can be used anywhere you need a new AEEIID, AEECLSID,
320  or AEEPRIVID.
321 
322 Definition:
323  typedef uint32 AEEUID
324 
325 =======================================================================
326 
327 AEEIID
328 
329 Description:
330  This is an interface ID type, used to denote a BREW interface. It is a special case
331  of AEEUID.
332 
333 Definition:
334  typedef uint32 AEEIID
335 
336 =======================================================================
337 
338 AEECLSID
339 
340 Description:
341  This is a classe ID type, used to denote a BREW class. It is a special case
342  of AEEUID.
343 
344 Definition:
345  typedef uint32 AEECLSID
346 
347 =======================================================================
348 
349 AEEPRIVID
350 
351 Description:
352  This is a privilege ID type, used to express a privilege. It is a special case
353  of AEEUID.
354 
355 Definition:
356  typedef uint32 AEEPRIVID
357 
358 =======================================================================
359 
360 AECHAR
361 
362 Description:
363  This is a 16-bit character type.
364 
365 Definition:
366  typedef uint16 AECHAR
367 
368 =======================================================================
369 
370 AEEResult
371 
372 Description:
373  This is the standard result type.
374 
375 Definition:
376  typedef int AEEResult
377 
378 =======================================================================
379 
380 _wchar_t
381 
382 Description:
383  This is a 16-bit character type corresponding to the IDL 'wchar'
384  type.
385 
386 Definition:
387  typedef uint16 _wchar_t
388 
389 See Also:
390  _cstring_t
391  _wstring_t
392 
393 =======================================================================
394 
395 _cstring_t
396 
397 Description:
398  This structure is used to represent an IDL string when used inside a
399  sequence or union.
400 
401 Definition:
402  typedef struct _cstring_s {
403  char* data;
404  int dataLen;
405  int dataLenReq;
406  } _cstring_t;
407 
408 Members:
409  data : A pointer to the NULL-terminated string.
410  dataLen : The size, in chars, of the buffer pointed to by 'data',
411  including the NULL terminator. This member is only used
412  when the structure is part of an rout or inrout
413  parameter, but must be supplied by the caller as an
414  input in these cases.
415  dataLenReq : The size that would have been required to store the
416  entire result string. This member is only used when the
417  structure is part of an rout or inrout parameter, when
418  it is an output value set by the callee. The length of
419  the returned string (including the NULL terminator)
420  after a call is the minimum of dataLen and dataLenReq.
421 
422 See Also:
423  _wchar_t
424  _wstring_t
425 
426 =======================================================================
427 
428 _wstring_t
429 
430 Description:
431  This structure is used to represent an IDL wstring when used inside a
432  sequence or union.
433 
434 Definition:
435  typedef struct _wstring_s {
436  _wchar_t* data;
437  int dataLen;
438  int dataLenReq;
439  } _wstring_t;
440 
441 Members:
442  data : A pointer to the NULL-terminated wide string.
443  dataLen : The size, in 16-bit characters, of the buffer pointed to
444  by 'data', including the NULL terminator. This member
445  is only used when the structure is part of an rout or
446  inrout parameter, but must be supplied by the caller as
447  an input in these cases.
448  dataLenReq : The number of 16-bit characters that would have been
449  required to store the entire result string. This member
450  is only used when the structure is part of an rout or
451  inrout parameter, when it is an output value set by the
452  callee. The length of the returned wstring (including
453  the NULL terminator) after a call is the minimum of
454  dataLen and dataLenReq.
455 
456 See Also:
457  _cstring_t
458  _wchar_t
459 
460 =======================================================================
461 */
462 
463 #endif /* #ifndef AEESTDDEF_H */
464 
unsigned __int64 uint64
Definition: AEEStdDef.h:112
signed short int16
Definition: AEEStdDef.h:94
signed char int8
Definition: AEEStdDef.h:99
int AEEResult
Return value of functions indicating success or failure. return value 0 indicates success...
Definition: AEEStdDef.h:160
__int64 int64
Definition: AEEStdDef.h:107
uint32_t uint32
Definition: AEEStdDef.h:74
int32_t int32
Definition: AEEStdDef.h:89
unsigned short uint16
Definition: AEEStdDef.h:79
unsigned char boolean
Definition: AEEStdDef.h:69
unsigned char byte
Definition: AEEStdDef.h:117
unsigned char uint8
Definition: AEEStdDef.h:84