Add TIZEN_ERROR_USB_HOST
[platform/core/api/common.git] / include / tizen_error.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 __TIZEN_COMMON_ERROR_H__
18 #define __TIZEN_COMMON_ERROR_H__
19
20 #include <errno.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @addtogroup CAPI_COMMON_ERROR
28  * @{
29  */
30
31 #define TIZEN_ERROR_MAX_PLATFORM_ERROR 0
32 #define TIZEN_ERROR_MIN_PLATFORM_ERROR (-1073741824LL)  /* = -2147483648 / 2 */
33
34 /* Use this constant macro as the value of the first module specific error */
35 #define TIZEN_ERROR_MIN_MODULE_ERROR (-2147483648LL)
36
37 /* Module errors cannot be greater than the following constant */
38 #define TIZEN_ERROR_MAX_MODULE_ERROR (TIZEN_ERROR_MIN_PLATFORM_ERROR - 1)
39
40 /* Check if error or not */
41 #define TIZEN_ERROR_IS_OK(x) (0 <= (x))
42
43 /* Check if error or not */
44 #define TIZEN_ERROR_IS_ERROR(x) (!TIZEN_ERROR_IS_OK(x))
45
46 /* Check if tizen error or not */
47 #define TIZEN_ERROR_IS_PLATFORM_ERROR(x) (TIZEN_ERROR_MIN_PLATFORM_ERROR <= (x) && (x) < 0)
48
49 /* Application Error Class */
50 #define TIZEN_ERROR_APPLICATION_CLASS -0x00000200
51 /* Base Error Class */
52 #define TIZEN_ERROR_BASE_CLASS -0x00000400
53 /* Content Error Class */
54 #define TIZEN_ERROR_CONTENT_CLASS -0x00000800
55 /* Location Error Class */
56 #define TIZEN_ERROR_LOCATION_CLASS -0x00001000
57 /* Multimedia Error Class */
58 #define TIZEN_ERROR_MULTIMEDIA_CLASS -0x00002000
59 /* Messaging Error Class */
60 #define TIZEN_ERROR_MESSAGING_CLASS -0x00004000
61 /* Network Error Class */
62 #define TIZEN_ERROR_NETWORK_CLASS -0x00008000
63 /* Social Error Class */
64 #define TIZEN_ERROR_SOCIAL_CLASS -0x00010000
65 /* System Error Class */
66 #define TIZEN_ERROR_SYSTEM_CLASS -0x00020000
67 /* Telephony Error Class */
68 #define TIZEN_ERROR_TELEPHONY_CLASS -0x00040000
69 /* UI Error class */
70 #define TIZEN_ERROR_UI_CLASS -0x00080000
71 /* UIX Error class */
72 #define TIZEN_ERROR_UIX_CLASS -0x00100000
73 /* AD Error class */
74 #define TIZEN_ERROR_AD_CLASS -0x00200000
75 /* Web Error class */
76 #define TIZEN_ERROR_WEB_CLASS -0x00400000
77 /* DRM Error class */
78 #define TIZEN_ERROR_DRM_CLASS -0x00800000
79 /* Account Error class */
80 #define TIZEN_ERROR_ACCOUNT_CLASS -0x01000000
81
82 /* Tizen Account Error */
83 #define TIZEN_ERROR_ACCOUNT             -0x01000000
84 /* Tizen Account Oauth Error */
85 #define TIZEN_ERROR_ACCOUNT_OAUTH       -0x01010000
86 /* Tizen SYNC MANAGER Error */
87 #define TIZEN_ERROR_SYNC_MANAGER        -0x01020000
88 /* Tizen FIDO Error */
89 #define TIZEN_ERROR_FIDO                -0x01030000
90 /* Tizen Application Error */
91 #define TIZEN_ERROR_APPLICATION         -0x01100000
92 /* Tizen Application Manager Error */
93 #define TIZEN_ERROR_APPLICATION_MANAGER -0x01110000
94 /* Tizen Badge Error */
95 #define TIZEN_ERROR_BADGE               -0x01120000
96 /* Tizen Message Port Error */
97 #define TIZEN_ERROR_MESSAGE_PORT        -0x01130000
98 /* Tizen Notification Error */
99 #define TIZEN_ERROR_NOTIFICATION        -0x01140000
100 /* Tizen Package Manager Error */
101 #define TIZEN_ERROR_PACKAGE_MANAGER     -0x01150000
102 /* Tizen Shortcut Error */
103 #define TIZEN_ERROR_SHORTCUT            -0x01160000
104 /* Tizen Bundle Error */
105 #define TIZEN_ERROR_BUNDLE              -0x01180000
106 /* Tizen Data Control Error */
107 #define TIZEN_ERROR_DATA_CONTROL        -0x01190000
108 /* Tizen Service Application Error */
109 #define TIZEN_ERROR_SERVICE_APPLICATION  -0x01200000
110 /* Tizen MINICONTROL Error */
111 #define TIZEN_ERROR_MINICONTROL         -0x01210000
112 /* Tizen Utility ICU Error */
113 #define TIZEN_ERROR_UTILITY_ICU         -0x01500000
114 /* Tizen Mime Type Error */
115 #define TIZEN_ERROR_MIME_TYPE           -0x01600000
116 /* Tizen Media Content Error */
117 #define TIZEN_ERROR_MEDIA_CONTENT       -0x01610000
118 /* Tizen Email Service Error */
119 #define TIZEN_ERROR_EMAIL_SERVICE       -0x01700000
120 /* Tizen Messaging Service Error */
121 #define TIZEN_ERROR_MESSAGING_SERVICE   -0x01710000
122 /* Tizen Push Error */
123 #define TIZEN_ERROR_PUSH                -0x01720000
124 /* Tizen Audio IO Error */
125 #define TIZEN_ERROR_AUDIO_IO            -0x01900000
126 /* Tizen Camera Error */
127 #define TIZEN_ERROR_CAMERA              -0x01910000
128 /* Tizen Image Util Error */
129 #define TIZEN_ERROR_IMAGE_UTIL          -0x01920000
130 /* Tizen Metadata Extractor Error */
131 #define TIZEN_ERROR_METADATA_EXTRACTOR  -0x01930000
132 /* Tizen Player Error */
133 #define TIZEN_ERROR_PLAYER              -0x01940000
134 /* Tizen Recorder Error */
135 #define TIZEN_ERROR_RECORDER            -0x01950000
136 /* Tizen Sound Manager Error */
137 #define TIZEN_ERROR_SOUND_MANAGER       -0x01960000
138 /* Tizen Tone Player Error */
139 #define TIZEN_ERROR_TONE_PLAYER         -0x01970000
140 /* Tizen Video Util Error */
141 #define TIZEN_ERROR_VIDEO_UTIL          -0x01980000
142 /* Tizen Wav Player Error */
143 #define TIZEN_ERROR_WAV_PLAYER          -0x01990000
144 /* Tizen Radio Error */
145 #define TIZEN_ERROR_RADIO               -0x019A0000
146 /* Tizen MEDIA CODEC Error */
147 #define TIZEN_ERROR_MEDIACODEC          -0x019B0000
148 /* Tizen Metadata Editor Error */
149 #define TIZEN_ERROR_METADATA_EDITOR     -0x019C0000
150 /* Tizen Vision Error */
151 #define TIZEN_ERROR_MEDIA_VISION        -0x019D0000
152 /* Tizen MEDIA DEMUXER Error */
153 #define TIZEN_ERROR_MEDIA_DEMUXER        -0x019E0000
154 /* Tizen MEDIA MUXER Error */
155 #define TIZEN_ERROR_MEDIA_MUXER        -0x019F0000
156 /* Tizen MEDIA STREAMER Error */
157 #define TIZEN_ERROR_MEDIA_STREAMER        -0x01A00000
158 /* Tizen MEDIA STREAMRECORDER Error */
159 #define TIZEN_ERROR_STREAMRECORDER              -0x01A10000
160 /* Tizen MEDIA STREAMRECORDER Error */
161 #define TIZEN_ERROR_MEDIA_TOOL          -0x01A20000
162 /* Tizen Bluetooth Error */
163 #define TIZEN_ERROR_BLUETOOTH           -0x01C00000
164 /* Tizen Connection Error */
165 #define TIZEN_ERROR_CONNECTION          -0x01C10000
166 /* Tizen NFC Error */
167 #define TIZEN_ERROR_NFC                 -0x01C20000
168 /* Tizen Serial Error */
169 #define TIZEN_ERROR_SERIAL              -0x01C30000
170 /* Tizen Tethering Error */
171 #define TIZEN_ERROR_TETHERING           -0x01C40000
172 /* Tizen Wifi Error */
173 #define TIZEN_ERROR_WIFI                -0x01C50000
174 /* Tizen Wifi Direct Error */
175 #define TIZEN_ERROR_WIFI_DIRECT         -0x01C60000
176 /* Tizen Smart Card Error */
177 #define TIZEN_ERROR_SMARTCARD          -0x01C70000
178 /* Tizen IotCon Error */
179 #define TIZEN_ERROR_IOTCON              -0x01C80000
180 /* Tizen SSDP Error */
181 #define TIZEN_ERROR_SSDP                -0x01C90000
182 /* Tizen DNSSD Error */
183 #define TIZEN_ERROR_DNSSD               -0x01CA0000
184 /* Tizen VPNSVC Error */
185 #define TIZEN_ERROR_VPNSVC              -0x01CB0000
186 /* Tizen MTP Error */
187 #define TIZEN_ERROR_MTP         -0x01CC0000
188 /* Tizen Http Error */
189 #define TIZEN_ERROR_HTTP                -0x01CD0000
190 /* Tizen Wifi Manager Error */
191 #define TIZEN_ERROR_WIFI_MANAGER        -0x01CE0000
192 /* Tizen Privacy Manager Error */
193 #define TIZEN_ERROR_PRIVACY_MANAGER     -0x01E00000
194 /* Tizen Key Manager Error */
195 #define TIZEN_ERROR_KEY_MANAGER         -0x01E10000
196 /* Tizen PRIVILEGE INFO Error */
197 #define TIZEN_ERROR_PRIVILEGE_INFORMATION -0x01E20000
198 /* Tizen CSR Error */
199 #define TIZEN_ERROR_CSR -0x01E30000
200 /* Tizen Calendar Error */
201 #define TIZEN_ERROR_CALENDAR            -0x02000000
202 /* Tizen Contacts Error */
203 #define TIZEN_ERROR_CONTACTS            -0x02010000
204 /* Tizen Phonenumber utils Error */
205 #define TIZEN_ERROR_PHONENUMBER_UTILS           -0x02020000
206 /* Tizen Storage Error */
207 #define TIZEN_ERROR_STORAGE             -0x02200000
208 /* Tizen Vconf Error */
209 #define TIZEN_ERROR_VCONF               -0x02210000
210 /* Tizen Device Error */
211 #define TIZEN_ERROR_DEVICE              -0x02400000
212 /* Tizen Dlog Error */
213 #define TIZEN_ERROR_DLOG                -0x02410000
214 /* Tizen Media Key Error */
215 #define TIZEN_ERROR_MEDIA_KEY           -0x02420000
216 /* Tizen Runetime Info Error */
217 #define TIZEN_ERROR_RUNTIME_INFORMATION -0x02430000
218 /* Tizen Sensor Error */
219 #define TIZEN_ERROR_SENSOR              -0x02440000
220 /* Tizen System Info Error */
221 #define TIZEN_ERROR_SYSTEM_INFORMATION  -0x02450000
222 /* Tizen System Setting Error */
223 #define TIZEN_ERROR_SYSTEM_SETTING      -0x02460000
224 /* Tizen System Resource Error */
225 #define TIZEN_ERROR_SYSTEM_RESOURCE     -0x02470000
226 /* Tizen Context Error */
227 #define TIZEN_ERROR_CONTEXT             -0x02480000
228 /* Tizen Health Error */
229 #define TIZEN_ERROR_HEALTH              -0x02490000
230 /* Tizen Feedback Error */
231 #define TIZEN_ERROR_FEEDBACK            -0x024A0000
232 /* Tizen USB Host Error */
233 #define TIZEN_ERROR_USB_HOST            -0x024B0000
234 /* Tizen Telephony Error */
235 #define TIZEN_ERROR_TELEPHONY           -0x02600000
236 /* Tizen EFL Util Error */
237 #define TIZEN_ERROR_EFL_UTIL            -0x02800000
238 /* Tizen UtilX Error */
239 #define TIZEN_ERROR_UTILX               -0x02810000
240 /* Tizen Native Buffer Error */
241 #define TIZEN_ERROR_NATIVE_BUFFER       -0x02820000
242 /* Tizen Buffer Manager Error */
243 #define TIZEN_ERROR_TBM                 -0x02830000
244 /* Tizen EOM Error */
245 #define TIZEN_ERROR_EOM                 -0x02840000
246 /* Tizen PANEL Error */
247 #define TIZEN_ERROR_PANEL       -0x02850000
248 /* Tizen TZSH Error */
249 #define TIZEN_ERROR_TZSH       -0x02860000
250 /* Tizen Download Error */
251 #define TIZEN_ERROR_DOWNLOAD            -0x02A00000
252 /* Tizen WebView Error */
253 #define TIZEN_ERROR_WEBVIEW             -0x02A10000
254 /* Tizen Location Manager Error */
255 #define TIZEN_ERROR_LOCATION_MANAGER    -0x02C00000
256 /* Tizen Geofence Manager Error */
257 #define TIZEN_ERROR_GEOFENCE_MANAGER    -0x02C10000
258 /* Tizen Maps Service Error */
259 #define TIZEN_ERROR_MAPS_SERVICE -0x02C20000
260 /* Tizen STT Error */
261 #define TIZEN_ERROR_STT                 -0x02F00000
262 /* Tizen TTS Error */
263 #define TIZEN_ERROR_TTS                 -0x02F10000
264 /* Tizen IME Error */
265 #define TIZEN_ERROR_IME                 -0x02F20000
266 /* Tizen Service Adaptor Error */
267 #define TIZEN_ERROR_SERVICE_ADAPTOR     -0x02F30000
268 /* Tizen Widget Error */
269 #define TIZEN_ERROR_WIDGET              -0x02F40000
270 /* Tizen Voice Control Error */
271 #define TIZEN_ERROR_VOICE_CONTROL       -0x02F50000
272
273 /**
274  * @brief Enumeration for tizen errors.
275  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
276  *
277 */
278         typedef enum {
279                 TIZEN_ERROR_NONE = 0,
280                                                   /**< Successful */
281                 TIZEN_ERROR_NOT_PERMITTED = -EPERM,
282                                                                                 /**< Operation not permitted */
283                 TIZEN_ERROR_NO_SUCH_FILE = -ENOENT,
284                                                                                 /**< No such file or directory */
285                 TIZEN_ERROR_NO_SUCH_PROCESS = -ESRCH,
286                                                                                   /**< No such process */
287                 TIZEN_ERROR_INTERRUPTED_SYS_CALL = -EINTR,
288                                                                                            /**< Interrupted system call */
289                 TIZEN_ERROR_IO_ERROR = -EIO,
290                                                                  /**< I/O error */
291                 TIZEN_ERROR_NO_SUCH_DEVICE = -ENXIO,
292                                                                                  /**< No such device or address */
293                 TIZEN_ERROR_ARGUMENT_LIST_TOO_LONG = -E2BIG,
294                                                                                                  /**< Argument list too long */
295                 TIZEN_ERROR_EXEC_FORMAT_ERROR = -ENOEXEC,
296                                                                                           /**< Exec format error */
297                 TIZEN_ERROR_BAD_FILE_NUMBER = -EBADF,
298                                                                                   /**< Bad file number */
299
300                 TIZEN_ERROR_TRY_AGAIN = -EAGAIN,
301                                                                          /**< Try again */
302                 TIZEN_ERROR_OUT_OF_MEMORY = -ENOMEM,
303                                                                                  /**< Out of memory */
304                 TIZEN_ERROR_PERMISSION_DENIED = -EACCES,
305                                                                                          /**< Permission denied */
306                 TIZEN_ERROR_BAD_ADDRESS = -EFAULT,
307                                                                            /**< Bad address */
308                 TIZEN_ERROR_BLOCK_DEVICE_REQUIRED = -ENOTBLK,
309                                                                                                   /**< Block device required */
310                 TIZEN_ERROR_RESOURCE_BUSY = -EBUSY,
311                                                                                 /**< Device or resource busy */
312                 TIZEN_ERROR_FILE_EXISTS = -EEXIST,
313                                                                            /**< File exists */
314                 TIZEN_ERROR_CROSS_DEVICE_LINK = -EXDEV,
315                                                                                         /**< Cross-device link */
316                 TIZEN_ERROR_NOT_A_DIRECTORY = -ENOTDIR,
317                                                                                         /**< Not a directory */
318
319                 TIZEN_ERROR_IS_A_DIRECTORY = -EISDIR,
320                                                                                   /**< Is a directory */
321                 TIZEN_ERROR_INVALID_PARAMETER = -EINVAL,
322                                                                                          /**< Invalid function parameter */
323                 TIZEN_ERROR_FILE_TABLE_OVERFLOW = -ENFILE,
324                                                                                            /**< File table overflow */
325                 TIZEN_ERROR_TOO_MANY_OPEN_FILES = -EMFILE,
326                                                                                            /**< Too many open files */
327                 TIZEN_ERROR_TOO_NOT_A_TERMINAL = -ENOTTY,
328                                                                                           /**< Not a terminal */
329                 TIZEN_ERROR_TOO_TEXT_FILE_BUSY = -ETXTBSY,
330                                                                                            /**< Not a terminal */
331                 TIZEN_ERROR_FILE_TOO_LARGE = -EFBIG,
332                                                                                  /**< File too large */
333                 TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE = -ENOSPC,
334                                                                                                    /**< No space left on device */
335                 TIZEN_ERROR_ILLEGAL_SEEK = -ESPIPE,
336                                                                                 /**< Illegal seek */
337                 TIZEN_ERROR_READ_ONLY_FILESYSTEM = -EROFS,
338                                                                                            /**< Read-only file system */
339                 TIZEN_ERROR_NO_DATA = -ENODATA,
340                                                                         /**< No data available */
341
342                 TIZEN_ERROR_TOO_MANY_LINKS = -EMLINK,
343                                                                                   /**< Too many links */
344                 TIZEN_ERROR_BROKEN_PIPE = -EPIPE,
345                                                                           /**< Broken pipe */
346                 TIZEN_ERROR_ARGUMENT_OUT_OF_DOMAIN = -EDOM,
347                                                                                                 /**< Math argument out of domain of func */
348                 TIZEN_ERROR_RESULT_OUT_OF_RANGE = -ERANGE,
349                                                                                            /**< Math result not representable */
350                 TIZEN_ERROR_WOULD_CAUSE_DEADLOCK = -EDEADLK,
351                                                                                                  /**< Resource deadlock would occur */
352                 TIZEN_ERROR_FILE_NAME_TOO_LONG = -ENAMETOOLONG,
353                                                                                                    /**< File name too long */
354                 TIZEN_ERROR_FILE_NO_LOCKS_AVAILABLE = -ENOLCK,
355                                                                                                    /**< No record locks available */
356                 TIZEN_ERROR_INVALID_OPERATION = -ENOSYS,
357                                                                                          /**< Function not implemented */
358                 TIZEN_ERROR_DIR_NOT_EMPTY = -ENOTEMPTY,
359                                                                                         /**< Directory not empty */
360                 TIZEN_ERROR_TOO_MANY_SYMBOLIC_LINKS = -ELOOP,
361                                                                                                   /**< Too many symbolic links encountered */
362                 TIZEN_ERROR_WOULD_BLOCK = TIZEN_ERROR_TRY_AGAIN,
363                                                                                                          /**< Operation would block */
364                 TIZEN_ERROR_CORRUPTED_SHARED_LIB = -ELIBBAD,
365                                                                                                  /**< Accessing a corrupted shared library */
366                 TIZEN_ERROR_LIB_SECTION_CORRUPTED = -ELIBSCN,
367                                                                                                   /**< .lib section in a.out corrupted */
368                 TIZEN_ERROR_LINK_TOO_MANY_SHARED_LIB = -ELIBMAX,
369                                                                                                          /**< Attempting to link in too many shared libraries */
370                 TIZEN_ERROR_SHARED_LIB_EXEC = -ELIBEXEC,
371                                                                                          /**< Cannot exec a shared library directly */
372                 TIZEN_ERROR_ILLEGAL_BYTE_SEQ = -EILSEQ,
373                                                                                         /**< Illegal byte sequence */
374                 TIZEN_ERROR_SYSTEM_CALL_RESTART = -ERESTART,
375                                                                                                  /**< Interrupted system call should be restarted */
376                 TIZEN_ERROR_STREAMS_PIPE = -ESTRPIPE,
377                                                                                   /**< Streams pipe error */
378                 TIZEN_ERROR_TOO_MANY_USERS = -EUSERS,
379                                                                                   /**< Too many users */
380                 TIZEN_ERROR_NON_SOCKET = -ENOTSOCK,
381                                                                                 /**< Socket operation on non-socket */
382                 TIZEN_ERROR_NO_DEST_ADDRESS = -EDESTADDRREQ,
383                                                                                                  /**< Destination address required */
384                 TIZEN_ERROR_MSG_TOO_LONG = -EMSGSIZE,
385                                                                                   /**< Message too long */
386                 TIZEN_ERROR_PROTOCOL_WRONG_TYPE = -EPROTOTYPE,
387                                                                                                    /**< Protocol wrong type for socket */
388                 TIZEN_ERROR_PROTOCOL_NOT_AVALIABLE = -ENOPROTOOPT,
389                                                                                                            /**< Protocol not available */
390                 TIZEN_ERROR_PROTOCOL_NOT_SUPPORTED = -EPROTONOSUPPORT,
391                                                                                                                    /**< Protocol not supported */
392                 TIZEN_ERROR_SOCKET_TYPE_NOT_SUPPORTED = -ESOCKTNOSUPPORT,
393                                                                                                                           /**< Socket type not supported */
394                 TIZEN_ERROR_ENDPOINT_OPERATIN_NOT_SUPPORTED = -EOPNOTSUPP,
395                                                                                                                            /**< Operation not supported on transport endpoint */
396                 TIZEN_ERROR_PROTOCOL_FAMILY_NOT_SUPPORTED = -EPFNOSUPPORT,
397                                                                                                                            /**< Protocol family not supported */
398                 TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = -EAFNOSUPPORT,
399                                                                                                                           /**< Address family not supported by protocol */
400                 TIZEN_ERROR_ADDRES_IN_USE = -EADDRINUSE,
401                                                                                          /**< Address already in use */
402                 TIZEN_ERROR_CANNOT_ASSIGN_ADDRESS = -EADDRNOTAVAIL,
403                                                                                                                 /**< Cannot assign requested address */
404                 TIZEN_ERROR_NETWORK_DOWN = -ENETDOWN,
405                                                                                   /**< Network is down */
406                 TIZEN_ERROR_NETWORK_UNREACHABLE = -ENETUNREACH,
407                                                                                                         /**< Network is unreachable */
408                 TIZEN_ERROR_NETWORK_RESET = -ENETRESET,
409                                                                                         /**< Network dropped connection because of reset */
410                 TIZEN_ERROR_CONNECTION_ABORTED = -ECONNABORTED,
411                                                                                                         /**< Software caused connection abort */
412                 TIZEN_ERROR_CONNECTION_RESET_BY_PEER = -ECONNRESET,
413                                                                                                                 /**< Connection reset by peer */
414                 TIZEN_ERROR_BUFFER_SPACE = -ENOBUFS,
415                                                                                  /**< No buffer space available */
416                 TIZEN_ERROR_ENDPOINT_CONNECTED = -EISCONN,
417                                                                                            /**< Transport endpoint is already connected */
418                 TIZEN_ERROR_ENDPOINT_NOT_CONNECTED = -ENOTCONN,
419                                                                                                         /**< Transport endpoint is not connected */
420                 TIZEN_ERROR_ENDPOINT_SHUTDOWN = -ESHUTDOWN,
421                                                                                                 /**< Cannot send after transport endpoint shutdown */
422                 TIZEN_ERROR_TOO_MANY_REFERENCES = -ETOOMANYREFS,
423                                                                                                          /**< Too many references: cannot splice */
424                 TIZEN_ERROR_CONNECTION_TIME_OUT = -ETIMEDOUT,
425                                                                                                   /**< Connection timed out */
426                 TIZEN_ERROR_CONNECTION_REFUSED = -ECONNREFUSED,
427                                                                                                         /**< Connection refused */
428                 TIZEN_ERROR_HOST_DOWN = -EHOSTDOWN,
429                                                                                 /**< Host is down */
430                 TIZEN_ERROR_NO_ROUTE_TO_HOST = -EHOSTUNREACH,
431                                                                                                   /**< No route to host */
432                 TIZEN_ERROR_ALREADY_IN_PROGRESS = -EALREADY,
433                                                                                                  /**< Operation already in progress */
434                 TIZEN_ERROR_NOW_IN_PROGRESS = -EINPROGRESS,
435                                                                                                 /**< Operation now in progress */
436                 TIZEN_ERROR_STALE_NFS_FILE_HANDLE = -ESTALE,
437                                                                                                  /**< Stale NFS file handle */
438                 TIZEN_ERROR_STRUCTURE_UNCLEAN = -EUCLEAN,
439                                                                                           /**< Structure needs cleaning */
440                 TIZEN_ERROR_NOT_XENIX_NAMED_TYPE_FILE = -ENOTNAM,
441                                                                                                           /**< Not a XENIX named type file */
442                 TIZEN_ERROR_NO_XENIX_SEMAPHORES_AVAILABLE = -ENAVAIL,
443                                                                                                                   /**< No XENIX semaphores available */
444                 TIZEN_ERROR_IS_NAMED_TYPE_FILE = -EISNAM,
445                                                                                           /**< Is a named type file */
446                 TIZEN_ERROR_REMOTE_IO = -EREMOTEIO,
447                                                                                 /**< Remote I/O error */
448                 TIZEN_ERROR_QUOTA_EXCEEDED = -EDQUOT,
449                                                                                   /**< Quota exceeded */
450                 TIZEN_ERROR_NO_MEDIUM = -ENOMEDIUM,
451                                                                                 /**< No medium found */
452                 TIZEN_ERROR_WRONG_MEDIUM_TYPE = -EMEDIUMTYPE,
453                                                                                                   /**< Wrong medium type */
454                 TIZEN_ERROR_CANCELED = -ECANCELED,
455                                                                            /**< Operation Canceled */
456                 TIZEN_ERROR_KEY_NOT_AVAILABLE = -ENOKEY,
457                                                                                          /**< Required key not available */
458                 TIZEN_ERROR_KEY_EXPIRED = -EKEYEXPIRED,
459                                                                                         /**< Key has expired */
460                 TIZEN_ERROR_KEY_REVOKED = -EKEYREVOKED,
461                                                                                         /**< Key has been revoked */
462                 TIZEN_ERROR_KEY_REJECTED = -EKEYREJECTED,
463                                                                                           /**< Key was rejected by service */
464
465                 TIZEN_ERROR_OWNER_DEAD = -EOWNERDEAD,
466                                                                                   /**< Owner died (for robust mutexes) */
467
468                 TIZEN_ERROR_UNKNOWN = TIZEN_ERROR_MIN_PLATFORM_ERROR,
469                                                                                                                   /**< Unknown error */
470
471                 /* This is a place to add new errors here.
472                  * Do not assign integer values explicitly. Values are auto-assigned.
473                  */
474                 TIZEN_ERROR_TIMED_OUT,
475                                                    /**< Time out */
476                 TIZEN_ERROR_NOT_SUPPORTED,
477                                                            /**< Not supported */
478                 TIZEN_ERROR_USER_NOT_CONSENTED,
479                                                                         /**< Not Consented */
480                 TIZEN_ERROR_DEVICE_POLICY_RESTRICTION,
481                                                                         /**< Restriction by Device Policy */
482                 TIZEN_ERROR_END_OF_COLLECTION,
483         } tizen_error_e;
484
485 /**
486  * @brief Gets the last error code in the thread.
487  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
488  *
489  * @details This function retrieves the last error code which is set by set_last_result()
490  *
491  * @return One of #tizen_error_e 
492  *
493  * @see #tizen_error_e
494  * @see set_last_result()
495 */
496         int get_last_result(void);
497
498 /**
499  * @brief Sets the last error code to be returned in the thread.
500  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
501  *
502  * @param[in] err The error code to be returned
503  *
504  * @see #tizen_error_e
505  * @see get_last_result()
506 */
507         void set_last_result(int err);
508
509 /**
510  * @brief Gets the message for given the error code.
511  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
512  *
513  * @remark This function returns a static pointer; subsequent calls will overwrite it.
514  * @param[in] err The error value to be returned
515  * @return The error's message
516  *
517  * @see #tizen_error_e
518  *
519  * @code
520  *
521  *  char* errMsg;
522  *  location_manager_h location_handle;
523  *  int result = location_manager_create(LOCATION_METHOD_GPS, &location_handle);
524  *
525  *  if (LOCATIONS_ERROR_NONE != result)
526  *  {
527  *    errMsg = get_error_message(result);
528  *    dlog_print(DLOG_INFO, "MyTag", "%s", errMsg);
529  *  }
530  *
531  * @endcode
532  *
533  */
534         char *get_error_message(int err);
535
536 /**
537  * @}
538  */
539 #ifdef __cplusplus
540 }
541 #endif
542 #endif             /**<__TIZEN_COMMON_ERROR_H__ */