Code Sync up from tizen_2.4
[platform/core/connectivity/mtp-responder.git] / include / mtp_datatype.h
1 /*
2  * Copyright (c) 2012, 2013 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 #ifndef _MTP_DATATYPES_H_
18 #define _MTP_DATATYPES_H_
19
20 #include <stdio.h>
21 #include <stdlib.h>
22
23 #ifndef _MTP_USE_OWNTYPES
24 #define _MTP_USE_OWNTYPES
25 #endif
26 #ifdef _MTP_USE_OWNTYPES
27
28 #define INVALID_FILE            (0)
29
30 typedef unsigned char mtp_byte;
31 typedef unsigned char mtp_bool;
32 typedef unsigned char mtp_uchar;
33 typedef char mtp_char ;
34
35 typedef unsigned short mtp_uint16;
36 typedef unsigned short mtp_word;
37 typedef unsigned short mtp_wchar;
38 typedef short mtp_int16;
39
40 typedef unsigned int mtp_uint32;
41 typedef int mtp_htimer;
42 typedef int mtp_int32;
43
44 typedef unsigned long mtp_ulong ;
45 typedef unsigned long mtp_dword ;
46
47 typedef unsigned long long  mtp_uint64;
48 typedef long long mtp_int64;
49
50 #endif
51
52 #ifndef FALSE
53 #define FALSE  0
54 #endif
55 #ifndef TRUE
56 #define TRUE   1
57 #endif
58
59 typedef enum {
60         MTP_ERROR_NONE = 0,
61         MTP_ERROR_GENERAL = -1,
62         MTP_ERROR_INVALID_STORE = -2,
63         MTP_ERROR_STORE_READ_ONLY = -3,
64         MTP_ERROR_STORE_FULL = -4,
65         MTP_ERROR_INVALID_DATASET = -5,
66         MTP_ERROR_INVALID_OBJECTHANDLE = -6,
67         MTP_ERROR_INVALID_OBJ_PROP_CODE = -7,
68         MTP_ERROR_INVALID_OBJECT_PROP_FORMAT = -8,
69         MTP_ERROR_INVALID_OBJ_PROP_VALUE = -9,
70         MTP_ERROR_INVALID_PARENT = -10,
71         MTP_ERROR_ACCESS_DENIED = -11,
72         MTP_ERROR_STORE_NOT_AVAILABLE = -12,
73         MTP_ERROR_INVALID_PARAM = -13,
74         MTP_ERROR_INVALID_OBJECT_INFO = -14,
75         MTP_ERROR_OBJECT_WRITE_PROTECTED = -15,
76         MTP_ERROR_PARTIAL_DELETION = -16,
77         MTP_ERROR_NO_SPEC_BY_FORMAT = -17,
78         MTP_ERROR_OPERATION_NOT_SUPPORTED = -19,
79         MTP_ERROR_MAX = -20
80 } mtp_err_t;
81
82 #define WCHAR_SIZ       2
83
84 /**
85  * \brief The CharMode enumeration.
86  *
87  * The CharMode enumerates character type by which string is written.
88  * CHAR_TYPE means that one character consists of 8-bits.
89  * WCHAR_TYPE means that one character consists of 16-bits.
90  */
91 typedef enum _char_mode {
92         CHAR_TYPE = 0,
93         WCHAR_TYPE
94 } char_mode_t;
95
96 #endif /* _MTP_DATATYPES_H_ */