65f321a0254877ff6374416ee40329d0aa7ec33d
[platform/framework/native/appfw.git] / inc / FBaseDataType.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FBaseDataType.h
19  * @brief               This is the header file for the data types.
20  *
21  * This header file defines the data types.
22  */
23 #ifndef _FBASE_DATA_TYPE_H_
24 #define _FBASE_DATA_TYPE_H_
25
26 /**
27  * @c byte is an @c unsigned @c char datatype.
28  * @since 2.0
29  */
30 typedef unsigned char byte;
31
32 /**
33  * @c result is an @c unsigned @c long type and indicates the result of the method execution.
34  * @since 2.0
35  */
36 typedef unsigned long result;
37
38 namespace Tizen { namespace Base
39 {
40 class String;
41 }}
42
43 typedef Tizen::Base::String UserId;
44 typedef Tizen::Base::String LoginId;
45
46 /**
47 * The invocation ID is returned when a request is sent.
48 * @since 2.0
49 */
50 typedef long RequestId;
51 #define INVALID_REQUEST_ID  -1
52
53 // Macro to get the value in byte
54 #define GET_MASK(val, pos, msk) (((val) & ((msk) << (pos))) >> (pos))
55 // Macro to put the value in byte
56 #define PUT_MASK(var, val, pos) ((var) | ((val) << (pos)))
57
58 #ifndef Handle
59 typedef int Handle;
60 #define INVALID_HANDLE  -1
61 #endif // Handle
62
63 #ifndef null
64 #define null    0
65 #endif // null
66
67 #ifndef INFINITE
68 #define INFINITE    0xFFFFFFFF
69 #endif // INFINITE
70
71 #ifndef UUID
72 #ifndef UUID__DEFINED
73 typedef struct UUID_
74 {
75         unsigned long x;
76         unsigned short s1;
77         unsigned short s2;
78         unsigned char c[8];
79 } UUID_;
80
81 #define UUID__DEFINED
82 #define UUID_DEFINED
83 #endif
84
85 #define UUID UUID_
86 #endif // UUID
87
88 #endif // _FBASE_DATA_TYPE_H_