acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
status.h
1#pragma once
2
3
5
6#define MAXIMUM_SYNCHRONIZING_OBJECTS 64
7
8#define STATUS_RANGE 1000 // should be enough for the categorization granularity
9
10#define MKSTATUS_RANGE(previous) ((::i32)(previous) + (::i32)(STATUS_RANGE))
11
12#define STATUS_RANGE_GENERAL ((::i32)(0))
13
14#define STATUS_RANGE_TIME_BAG MKSTATUS_RANGE(STATUS_RANGE_GENERAL)
15
16#define STATUS_RANGE_EXCEPTION MKSTATUS_RANGE(STATUS_RANGE_TIME_BAG)
17
18#define STATUS_RANGE_IO MKSTATUS_RANGE(STATUS_RANGE_EXCEPTION)
19
20#define STATUS_RANGE_FILE MKSTATUS_RANGE(STATUS_RANGE_IO)
21
22#define STATUS_RANGE_NETWORK MKSTATUS_RANGE(STATUS_RANGE_FILE)
23
24#define STATUS_RANGE_HTTP MKSTATUS_RANGE(STATUS_RANGE_NETWORK)
25
26#define STATUS_RANGE_AUTHENTICATION MKSTATUS_RANGE(STATUS_RANGE_HTTP)
27
28#define STATUS_RANGE_DATABASE MKSTATUS_RANGE(STATUS_RANGE_AUTHENTICATION)
29
30#define STATUS_RANGE_MULTIMEDIA MKSTATUS_RANGE(STATUS_RANGE_DATABASE)
31
32#define STATUS_FAILURE (I32_MINIMUM)
33
34#define INT_FAILURE_STATUS(iStatusRange) (((::i64)STATUS_FAILURE + (iStatusRange)))
35
36#define INT_SUCCESS_STATUS(iStatusRange) ((::i64)(iStatusRange))
37
38#define FAILURE_STATUS(iStatusRange) ((::e_status )(::enum_status)INT_FAILURE_STATUS(iStatusRange))
39
40#define SUCCESS_STATUS(iStatusRange) ((::e_status )(::enum_status)INT_SUCCESS_STATUS(iStatusRange))
41
42#define PRIestatus PRIi64
43
44#define DECLARE_SE_EXCEPTION_ERROR(name) IDENTIFIER_CONCATENATE(error_,name)
45
46
47enum enum_status : ::i64
48{
49
50 e_status_none = INT64_MIN,
51
52 e_status_process_result_negative_base = (::i64)I32_MINIMUM - 1,
53
54 error_failed = INT_FAILURE_STATUS(STATUS_RANGE_GENERAL),
55 error_not_set,
56 error_pending,
57 error_multiple,
58 error_null_result,
59 error_status,
60 error_none,
61 error_not_found,
62 error_bad_response,
63 error_no_memory,
64 error_another_installation_already_running,
65 error_warning,
66 error_debug_warning,
67 error_invalid_usage,
68 error_no_devices_found,
69 error_invalid_device_id,
70 error_device_driver,
71 error_system,
72 error_threading,
73 error_would_reach_buffer_limit,
74 error_not_implemented,
75 error_conversion_not_a_number,
76 error_not_valid_email_address,
77 error_not_valid_user_id,
78 error_decryption,
79 error_key_not_found,
80 error_value_not_found,
81 error_wrong_type,
82 error_false,
83 error_no_factory,
84 error_composite_not_composer_member,
85 error_path_not_found,
86 error_invalid_flags,
87 error_insufficient_buffer,
88 error_not_initialized,
89 e_status_no_work,
90 error_not_running,
91 error_no_windowing,
92 error_no_draw2d,
93 error_no_audio,
94 error_no_session,
95 error_no_system,
96 error_no_application,
97 error_no_interface,
98 error_last_error,
99 error_already_working_on_it,
100 error_all_failed,
101 error_resource,
102 error_runtime_check,
103 error_win32,
104 error_not_supported,
105 error_null_pointer,
106 todo,
107 error_what_exclamation_exclamation,
108 error_parsing,
109 error_invalid_character,
110 error_assert,
111 error_exit_start,
112 error_exit_thread,
113 error_exit_application,
114 error_exit_session,
115 error_exit_system,
116 error_exit_end,
117 error_user,
118 error_hresult,
119 error_network_payload_parsing,
120 error_pure_call,
121 error_invalid_operation,
122 error_wait_failed,
123 error_wait_timeout,
124 error_need_restart_application_to_activate_feature,
125 error_function_entry_not_found,
126 error_some_error_has_occurred,
127 error_library_not_found,
128 error_library_not_loaded,
129 error_debug_testing,
130 error_xml_parsing,
131 error_encoding,
132 error_codec_not_found,
133 error_vkresult,
134 error_discontinued,
135 error_operation_not_permitted,
136 error_resource_deadlock_would_occur,
137
138
139error_time_bag = INT_FAILURE_STATUS(STATUS_RANGE_EXCEPTION),
140error_open_failed,
141error_invalid_track,
142error_already_open,
143error_invalid_parameter,
144error_invalid_buffer,
145error_invalid_tk_position,
146error_save_failed,
147error_bad_file_format,
148error_bad_data_format,
149error_unsupported_function,
150error_already_allocated,
151error_already_exists,
152error_already_added,
153error_bad_device_id,
154error_not_ready,
155error_internal,
156error_timeout,
157error_wrong_state,
158error_not_expected,
159//error_midi_player_stop,
160//error_midi_player_close,
161//error_midi_player_save,
162//error_midi_player_preroll_stream_open,
163//error_midi_player_preroll_stream_property,
164//error_midi_player_preroll_no_memory1,
165//error_midi_player_preroll_no_memory2,
167//error_midi_player_preroll_stream_out,
168//error_midi_player_preroll_read_events,
169//error_midi_player_preroll_prepare_header2,
170//error_midi_player_preroll_stream_out2,
171error_midi,
172error_midi_not_prerolled,
173
174
175// RTF library error codes
176error_open_rtf,
177error_close_rtf,
178error_rtf_header,
179error_rtf_document_format,
180error_rtf_section_format,
181error_rtf_paragraph_format,
182error_rtf_image,
183error_rtf_table,
184error_opengl,
185
186
187
188error_exception = INT_FAILURE_STATUS(STATUS_RANGE_EXCEPTION),
189error_standard_exception,
190error_bad_argument,
191error_index_out_of_bounds,
192error_unexpected, // "This shouldn't ever happen"
193error_unexpected_result, // "This shouldn't ever happen" for integer result
194error_interface_only,
195error_cancelled,
196error_catch_all_exception,
197error_overflow,
198error_range,
199error_invalid_type,
200error_invalid_time_type,
201error_invalid_time,
202error_unexpected_situation,
203error_datetime_parser,
204error_invalid_empty_argument,
205error_segmentation_fault,
206DECLARE_SE_EXCEPTION_ERROR(standard_datatype_misalignment),
207DECLARE_SE_EXCEPTION_ERROR(standard_breakpoint),
208DECLARE_SE_EXCEPTION_ERROR(standard_single_step),
209DECLARE_SE_EXCEPTION_ERROR(standard_array_bounds_exceeded),
210DECLARE_SE_EXCEPTION_ERROR(standard_flt_denormal_operand),
211DECLARE_SE_EXCEPTION_ERROR(standard_flt_divide_by_zero),
212DECLARE_SE_EXCEPTION_ERROR(standard_flt_inexact_result),
213DECLARE_SE_EXCEPTION_ERROR(standard_flt_invalid_operation),
214DECLARE_SE_EXCEPTION_ERROR(standard_flt_overflow),
215DECLARE_SE_EXCEPTION_ERROR(standard_flt_stack_check),
216DECLARE_SE_EXCEPTION_ERROR(standard_flt_underflow),
217DECLARE_SE_EXCEPTION_ERROR(standard_int_divide_by_zero),
218DECLARE_SE_EXCEPTION_ERROR(standard_int_overflow),
219DECLARE_SE_EXCEPTION_ERROR(standard_priv_instruction),
220DECLARE_SE_EXCEPTION_ERROR(standard_in_page_error),
221DECLARE_SE_EXCEPTION_ERROR(standard_illegal_instruction),
222DECLARE_SE_EXCEPTION_ERROR(standard_noncontinuable_exception),
223DECLARE_SE_EXCEPTION_ERROR(standard_stack_overflow),
224DECLARE_SE_EXCEPTION_ERROR(standard_invalid_disposition),
225DECLARE_SE_EXCEPTION_ERROR(standard_guard_page),
226DECLARE_SE_EXCEPTION_ERROR(standard_invalid_handle),
227DECLARE_SE_EXCEPTION_ERROR(standard_microsoft_cpp),
228DECLARE_SE_EXCEPTION_ERROR(standard_winrt_originate_error),
229
230
231error_io = INT_FAILURE_STATUS(STATUS_RANGE_IO),
232error_serial,
233error_serial_io,
234error_port_not_opened,
235error_serialization,
236error_premature_end_of_file,
237error_serialization_unexpected_value,
238error_file_open,
239 error_remoting,
240
241 error_file = INT_FAILURE_STATUS(STATUS_RANGE_FILE),
242 error_file_not_found,
243 error_bad_path,
244 error_too_many_open_files,
245 error_file_access_denied,
246 error_invalid_file,
247 error_erase_current_dir,
248 error_directory_full,
249 error_bad_seek,
250 error_hard_io,
251 error_file_sharing_violation,
252 error_file_lock_violation,
253 error_disk_full,
254 error_end_of_file,
255 error_end_of_coding,
256 error_end_of_decoding,
257 error_not_a_directory,
258 error_not_a_file,
259 error_icloud_not_available,
260
261
262 error_network = INT_FAILURE_STATUS(STATUS_RANGE_NETWORK),
263 error_connection_timed_out,
264 error_connection_cancelled,
265 error_on_connection_timeout,
266 error_socket,
267
268 abandoned_base = -0x7FFFFFFE00000000ll,
269 abandoned_end = abandoned_base + MAXIMUM_SYNCHRONIZING_OBJECTS,
270
271 success_login = INT_FAILURE_STATUS(STATUS_RANGE_AUTHENTICATION),
272
273
274 error_http = INT_FAILURE_STATUS(STATUS_RANGE_HTTP),
275
276 error_database = INT_FAILURE_STATUS(STATUS_RANGE_DATABASE),
277 error_dataset,
278 error_dataset_wrong_state,
279 error_dataset_inactive,
280 error_field_not_found,
281
282 undefined = INT_SUCCESS_STATUS(STATUS_RANGE_GENERAL),
283 success,
284 success_true,
285 success_multiple,
286 success_none,
287 success_exit_thread,
288 success_not_found,
289 success_not_ready,
290 success_promise,
291 success_color_index,
292 success_mouse_has_left,
293 partial_one_third_or_less_has_failed, // <= 1/3 success
294 partial_sorf_of_half_has_failed, // ~ 1/2 success (between 1/3 and 2/3)
295 partial_two_thirds_or_more_but_not_all_has_failed, // >= 2/3 success
296 success_hresult,
297 success_not_constructed,
298 success_not_allocated,
299 success_not_created,
300 success_not_composed,
301 success_already_added,
302 success_already_set,
303 success_already_enabled,
304 success_started,
305 success_scheduled,
306 status_quit,
307 status_kick_idle,
308 success_io_completion,
309 success_messages,
310
311
312 success_http = INT_SUCCESS_STATUS(STATUS_RANGE_HTTP),
313 success_http_redirection,
314
315
316 success_dataset_empty = INT_SUCCESS_STATUS(STATUS_RANGE_DATABASE),
317
318
319 success_time_bag = INT_SUCCESS_STATUS(STATUS_RANGE_TIME_BAG),
320 success_event_not_found,
321 success_track_not_found,
322 success_no_found,
323 success_end_of_file,
324 success_reached_tk_max,
325 success_meta_pending,
326 success_no_meta,
327 success_end_of_track,
328 success_skip,
329
330
331#include "status_range_authentication.h"
332
333 e_status_process_result_positive_base = 0x10000000,
334 signaled_base = 0x10000000,
335 signaled_end = signaled_base + MAXIMUM_SYNCHRONIZING_OBJECTS,
336
337};
338
339
340#undef MAXIMUM_SYNCHRONIZING_OBJECTS
341
342
343#if __cplusplus > 202001L
344#define INLINE_CONSTEXPR inline constexpr
345#else
346#define INLINE_CONSTEXPR inline
347#endif
348
349
350//INLINE_CONSTEXPR bool is_exit_exception_status(const ::e_status & estatus)
351//{
352//
353// return estatus > error_exit_start && estatus < error_exit_end;
354//
355//}
356//
357
358
359
360
Definition aaa_todo.h:6