Wasabi ExpressPlay SDK for Desktop Systems  1.23.0
ShiResults.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Sushi - Result Codes
4 |
5 | $Id: ShiResults.h 8252 2017-06-20 14:16:33Z smohan $
6 | Original author: Gilles Boccon-Gibod
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2005-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
21 #ifndef _SHI_RESULTS_H_
22 #define _SHI_RESULTS_H_
23 
24 /*----------------------------------------------------------------------
25 | macros
26 +---------------------------------------------------------------------*/
27 #define SHI_SUCCESS 0
28 #define SHI_FAILURE (-1)
29 
30 #define SHI_FAILED(_result) ((_result) != SHI_SUCCESS)
31 #define SHI_SUCCEEDED(_result) ((_result) == SHI_SUCCESS)
32 
33 #define SHI_CHECK_POINTER_SEVERE(_p) do { \
34  if ((_p) == NULL) NPT_CHECK_SEVERE(SHI_ERROR_OUT_OF_MEMORY); \
35 } while(0)
36 
37 #define SHI_CHECK_POINTER_LABEL_SEVERE(_p, _result, _label) do { \
38  if ((_p) == NULL) { \
39  _result = SHI_ERROR_OUT_OF_MEMORY; \
40  NPT_CHECK_LABEL_SEVERE(_result, _label); \
41  } \
42 } while(0)
43 
44 /*----------------------------------------------------------------------
45 | error code bases
46 +---------------------------------------------------------------------*/
47 #if !defined(SHI_ERROR_BASE)
48 #define SHI_ERROR_BASE (-50000)
49 #endif
50 
51 /* error codes bases for the external API */
52 #define SHI_ERROR_BASE_GENERAL (SHI_ERROR_BASE - 0 )
53 #define SHI_ERROR_BASE_API (SHI_ERROR_BASE - 5000)
54 
55 #define SHI_ERROR_BASE_API_APPLICATION (SHI_ERROR_BASE_API - 0)
56 #define SHI_ERROR_BASE_API_ENGINE (SHI_ERROR_BASE_API - 100)
57 #define SHI_ERROR_BASE_API_NETWORK (SHI_ERROR_BASE_API - 200)
58 #define SHI_ERROR_BASE_API_LICENSE (SHI_ERROR_BASE_API - 300)
59 #define SHI_ERROR_BASE_API_FINGERPRINT (SHI_ERROR_BASE_API - 400)
60 #define SHI_ERROR_BASE_API_TRANSACTION (SHI_ERROR_BASE_API - 500)
61 
62 /* general error codes */
63 #define SHI_ERROR_OUT_OF_MEMORY (SHI_ERROR_BASE_GENERAL - 0)
64 #define SHI_ERROR_OUT_OF_RESOURCES (SHI_ERROR_BASE_GENERAL - 1)
65 #define SHI_ERROR_INTERNAL (SHI_ERROR_BASE_GENERAL - 2)
66 #define SHI_ERROR_INVALID_PARAMETERS (SHI_ERROR_BASE_GENERAL - 3)
67 #define SHI_ERROR_INVALID_STATE (SHI_ERROR_BASE_GENERAL - 4)
68 #define SHI_ERROR_NOT_IMPLEMENTED (SHI_ERROR_BASE_GENERAL - 5)
69 #define SHI_ERROR_OUT_OF_RANGE (SHI_ERROR_BASE_GENERAL - 6)
70 #define SHI_ERROR_ACCESS_DENIED (SHI_ERROR_BASE_GENERAL - 7)
71 #define SHI_ERROR_INVALID_SYNTAX (SHI_ERROR_BASE_GENERAL - 8)
72 #define SHI_ERROR_NOT_SUPPORTED (SHI_ERROR_BASE_GENERAL - 9)
73 #define SHI_ERROR_INVALID_FORMAT (SHI_ERROR_BASE_GENERAL - 10)
74 #define SHI_ERROR_NOT_ENOUGH_SPACE (SHI_ERROR_BASE_GENERAL - 11)
75 #define SHI_ERROR_NO_SUCH_ITEM (SHI_ERROR_BASE_GENERAL - 12)
76 #define SHI_ERROR_NO_SUCH_INTERFACE (SHI_ERROR_BASE_GENERAL - 13)
77 #define SHI_ERROR_NOT_AVAILABLE (SHI_ERROR_BASE_GENERAL - 14)
78 #define SHI_ERROR_TIMEOUT (SHI_ERROR_BASE_GENERAL - 15)
79 #define SHI_ERROR_WRONG_THREAD (SHI_ERROR_BASE_GENERAL - 16)
80 #define SHI_ERROR_THREAD_LOCAL_FAILURE (SHI_ERROR_BASE_GENERAL - 17)
81 #define SHI_ERROR_DB_CONSTRAINT (SHI_ERROR_BASE_GENERAL - 18)
82 #define SHI_ERROR_INVALID_STOP_EVENT (SHI_ERROR_BASE_GENERAL - 19)
83 #define SHI_ERROR_METERING_FAILURE (SHI_ERROR_BASE_GENERAL - 20)
84 #define SHI_ERROR_ILLEGAL_URL (SHI_ERROR_BASE_GENERAL - 21)
85 
86 /* standard error codes */
87 /* these are special codes to convey an errno */
88 /* the error code is (SHI_ERROR_BASE_ERRNO - errno) */
89 /* where errno is the positive integer from errno.h */
90 #define SHI_ERROR_BASE_ERRNO (SHI_ERROR_BASE-4000)
91 #define SHI_ERROR_ERRNO(e) (SHI_ERROR_BASE_ERRNO - (e))
92 
93 #endif /* _SHI_RESULTS_H_ */