digikam
Go to the documentation of this file.
32 #ifndef _NPT_RESULTS_H_
33 #define _NPT_RESULTS_H_
38 #if defined(NPT_DEBUG)
40 #define NPT_CHECK(_x) \
42 NPT_Result _result = (_x); \
43 if (_result != NPT_SUCCESS) { \
44 NPT_Debug("%s(%d): @@@ NPT_CHECK failed, result=%d (%s)\n", __FILE__, __LINE__, _result, NPT_ResultText(_result)); \
48 #define NPT_CHECK_POINTER(_p) \
51 NPT_Debug("%s(%d): @@@ NULL pointer parameter\n", __FILE__, __LINE__); \
52 return NPT_ERROR_INVALID_PARAMETERS; \
55 #define NPT_CHECK_LABEL(_x, label) \
57 NPT_Result _result = (_x); \
58 if (_result != NPT_SUCCESS) { \
59 NPT_Debug("%s(%d): @@@ NPT_CHECK failed, result=%d (%s)\n", __FILE__, __LINE__, _result, NPT_ResultText(_result)); \
63 #define NPT_CHECK_POINTER_LABEL(_p, label) \
66 NPT_Debug("%s(%d): @@@ NULL pointer parameter\n", __FILE__, __LINE__); \
71 #define NPT_CHECK(_x) \
73 NPT_Result _result = (_x); \
74 if (_result != NPT_SUCCESS) { \
78 #define NPT_CHECK_POINTER(_p) \
80 if ((_p) == NULL) return NPT_ERROR_INVALID_PARAMETERS; \
82 #define NPT_CHECK_LABEL(_x, label) \
84 NPT_Result _result = (_x); \
85 if (_result != NPT_SUCCESS) { \
89 #define NPT_CHECK_POINTER_LABEL(_p, label) \
97 #define NPT_FAILED(result) ((result) != NPT_SUCCESS)
98 #define NPT_SUCCEEDED(result) ((result) == NPT_SUCCESS)
104 #define NPT_SUCCESS 0
107 #define NPT_FAILURE (-1)
109 #if !defined(NPT_ERROR_BASE)
110 #define NPT_ERROR_BASE -20000
114 #define NPT_ERROR_BASE_GENERAL (NPT_ERROR_BASE-0)
115 #define NPT_ERROR_BASE_LIST (NPT_ERROR_BASE-100)
116 #define NPT_ERROR_BASE_FILE (NPT_ERROR_BASE-200)
117 #define NPT_ERROR_BASE_IO (NPT_ERROR_BASE-300)
118 #define NPT_ERROR_BASE_SOCKET (NPT_ERROR_BASE-400)
119 #define NPT_ERROR_BASE_INTERFACES (NPT_ERROR_BASE-500)
120 #define NPT_ERROR_BASE_XML (NPT_ERROR_BASE-600)
121 #define NPT_ERROR_BASE_UNIX (NPT_ERROR_BASE-700)
122 #define NPT_ERROR_BASE_HTTP (NPT_ERROR_BASE-800)
123 #define NPT_ERROR_BASE_THREADS (NPT_ERROR_BASE-900)
124 #define NPT_ERROR_BASE_SERIAL_PORT (NPT_ERROR_BASE-1000)
125 #define NPT_ERROR_BASE_TLS (NPT_ERROR_BASE-1100)
128 #define NPT_ERROR_INVALID_PARAMETERS (NPT_ERROR_BASE_GENERAL - 0)
129 #define NPT_ERROR_PERMISSION_DENIED (NPT_ERROR_BASE_GENERAL - 1)
130 #define NPT_ERROR_OUT_OF_MEMORY (NPT_ERROR_BASE_GENERAL - 2)
131 #define NPT_ERROR_NO_SUCH_NAME (NPT_ERROR_BASE_GENERAL - 3)
132 #define NPT_ERROR_NO_SUCH_PROPERTY (NPT_ERROR_BASE_GENERAL - 4)
133 #define NPT_ERROR_NO_SUCH_ITEM (NPT_ERROR_BASE_GENERAL - 5)
134 #define NPT_ERROR_NO_SUCH_CLASS (NPT_ERROR_BASE_GENERAL - 6)
135 #define NPT_ERROR_OVERFLOW (NPT_ERROR_BASE_GENERAL - 7)
136 #define NPT_ERROR_INTERNAL (NPT_ERROR_BASE_GENERAL - 8)
137 #define NPT_ERROR_INVALID_STATE (NPT_ERROR_BASE_GENERAL - 9)
138 #define NPT_ERROR_INVALID_FORMAT (NPT_ERROR_BASE_GENERAL - 10)
139 #define NPT_ERROR_INVALID_SYNTAX (NPT_ERROR_BASE_GENERAL - 11)
140 #define NPT_ERROR_NOT_IMPLEMENTED (NPT_ERROR_BASE_GENERAL - 12)
141 #define NPT_ERROR_NOT_SUPPORTED (NPT_ERROR_BASE_GENERAL - 13)
142 #define NPT_ERROR_TIMEOUT (NPT_ERROR_BASE_GENERAL - 14)
143 #define NPT_ERROR_WOULD_BLOCK (NPT_ERROR_BASE_GENERAL - 15)
144 #define NPT_ERROR_TERMINATED (NPT_ERROR_BASE_GENERAL - 16)
145 #define NPT_ERROR_OUT_OF_RANGE (NPT_ERROR_BASE_GENERAL - 17)
146 #define NPT_ERROR_OUT_OF_RESOURCES (NPT_ERROR_BASE_GENERAL - 18)
147 #define NPT_ERROR_NOT_ENOUGH_SPACE (NPT_ERROR_BASE_GENERAL - 19)
148 #define NPT_ERROR_INTERRUPTED (NPT_ERROR_BASE_GENERAL - 20)
149 #define NPT_ERROR_CANCELLED (NPT_ERROR_BASE_GENERAL - 21)
155 #define NPT_ERROR_BASE_ERRNO (NPT_ERROR_BASE-2000)
156 #define NPT_ERROR_ERRNO(e) (NPT_ERROR_BASE_ERRNO - (e))
163 #endif // _NPT_RESULTS_H_
const char * NPT_ResultText(int result)
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Tue Dec 10 2019 04:05:40 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.