libose
Loading...
Searching...
No Matches
ose_errno.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019-23 John MacCallum Permission is hereby granted,
3 free of charge, to any person obtaining a copy of this software
4 and associated documentation files (the "Software"), to deal in
5 the Software without restriction, including without limitation the
6 rights to use, copy, modify, merge, publish, distribute,
7 sublicense, and/or sell copies of the Software, and to permit
8 persons to whom the Software is furnished to do so, subject to the
9 following conditions:
10
11 The above copyright notice and this permission notice shall be
12 included in all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
22*/
23
24#ifndef OSE_ERRNO
25#define OSE_ERRNO
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
141
159const char *ose_errno_string(enum ose_errno e);
160
164#define ose_errno_set(b, e) ose_context_set_status((b), (e))
165
169#define ose_errno_get(b) (enum ose_errno)ose_context_get_status((b))
170
175#define ose_errno_module_set(b, e) \
176 ose_context_set_status((b), ((e) | ose_err_source_module))
177
181#define ose_errno_source_get(e) \
182 ((e) & ose_err_source_mask)
183
187#define ose_errno_cause_get(e) \
188 ((e) & ose_err_cause_mask)
189
190#ifdef __cplusplus
191}
192#endif
193
194#endif
ose_errno
Definition ose_errno.h:37
@ OSE_ERR_RANGE
Definition ose_errno.h:46
@ OSE_ERR_WILDPTR_CALLED
A wild bound function was applied.
Definition ose_errno.h:96
@ OSE_ERR_FOREIGNFUNC_RAISED
A function outside libose, called through a binding, failed.
Definition ose_errno.h:78
@ OSE_ERR_ITEM_COUNT
Definition ose_errno.h:45
@ OSE_ERR_ITEM_TYPE
Definition ose_errno.h:43
@ OSE_ERR_UNBOUND
Definition ose_errno.h:54
@ OSE_ERR_UNKNOWN_TYPETAG
Definition ose_errno.h:47
@ OSE_ERR_BLOB_CONTENTS
Definition ose_errno.h:49
@ OSE_ERR_MODULE_ABI
Definition ose_errno.h:53
@ OSE_ERR_TYPE
Definition ose_errno.h:41
@ OSE_ERR_ELEM_COUNT
Definition ose_errno.h:44
@ OSE_ERR_REGISTER_EXISTS
A register name that is already live was claimed again.
Definition ose_errno.h:109
@ OSE_ERR_UNTRUSTED_TYPE
Definition ose_errno.h:51
@ OSE_ERR_NONE
Definition ose_errno.h:38
@ OSE_ERR_MALFORMED
Definition ose_errno.h:50
@ OSE_ERR_UNKNOWN_CONTEXT_BUNDLE
Definition ose_errno.h:48
@ OSE_ERR_MODULE_LOAD
Definition ose_errno.h:52
@ OSE_ERR_ELEM_TYPE
Definition ose_errno.h:42
@ OSE_ERR_REGISTER_FULL
A register could not grow, so a write did not happen.
Definition ose_errno.h:134
const char * ose_errno_string(enum ose_errno e)
What an errno means, in words.
Definition ose.c:65