agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
error.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 ykat UG (haftungsbeschraenkt) - All Rights Reserved
3  *
4  * Permission for non-commercial use is hereby granted,
5  * free of charge, without warranty of any kind.
6  */
7 #ifndef ZRTOS_ERROR_H
8 #define ZRTOS_ERROR_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 
14 #include <limits.h>
15 #include <stdbool.h>
16 
17 #include <zrtos/assert.h>
18 
19 
20 typedef enum{
21  ZRTOS_ERROR__MIN = INT_MIN ///< Minimum value of zrtos_error_t
22  ,ZRTOS_ERROR__SUCCESS = 0 ///< Successful program execution status
23  ,ZRTOS_ERROR__ERROR = -1 ///< Unsuccessful program execution status
24  ,ZRTOS_ERROR__FIRST = -1 ///< Smallest error code
25  ,ZRTOS_ERROR__PERM = -1 ///< Operation not permitted
26  ,ZRTOS_ERROR__NOENT = -2 ///< No such file or directory
27  ,ZRTOS_ERROR__SRCH = -3 ///< No such process
28  ,ZRTOS_ERROR__INTR = -4 ///< Interrupted system call
29  ,ZRTOS_ERROR__IO = -5 ///< I/O error
30  ,ZRTOS_ERROR__NXIO = -6 ///< No such device or address
31  ,ZRTOS_ERROR__2BIG = -7 ///< Arg list too long
32  ,ZRTOS_ERROR__NOEXEC = -8 ///< Exec format error
33  ,ZRTOS_ERROR__BADF = -9 ///< Bad file number
34  ,ZRTOS_ERROR__CHILD = -10 ///< No child processes
35  ,ZRTOS_ERROR__AGAIN = -11 ///< Try again
36  ,ZRTOS_ERROR__NOMEM = -12 ///< Out of memory
37  ,ZRTOS_ERROR__ACCES = -13 ///< Permission denied
38  ,ZRTOS_ERROR__FAULT = -14 ///< Bad address
39  ,ZRTOS_ERROR__NOTBLK = -15 ///< Block device required
40  ,ZRTOS_ERROR__BUSY = -16 ///< Device or resource busy
41  ,ZRTOS_ERROR__EXIST = -17 ///< File exists
42  ,ZRTOS_ERROR__XDEV = -18 ///< Cross-device link
43  ,ZRTOS_ERROR__NODEV = -19 ///< No such device
44  ,ZRTOS_ERROR__NOTDIR = -20 ///< Not a directory
45  ,ZRTOS_ERROR__ISDIR = -21 ///< Is a directory
46  ,ZRTOS_ERROR__INVAL = -22 ///< Invalid argument
47  ,ZRTOS_ERROR__NFILE = -23 ///< File table overflow
48  ,ZRTOS_ERROR__MFILE = -24 ///< Too many open files
49  ,ZRTOS_ERROR__NOTTY = -25 ///< Not a typewriter
50  ,ZRTOS_ERROR__TXTBSY = -26 ///< Text file busy
51  ,ZRTOS_ERROR__FBIG = -27 ///< File too large
52  ,ZRTOS_ERROR__NOSPC = -28 ///< No space left on device
53  ,ZRTOS_ERROR__SPIPE = -29 ///< Illegal seek
54  ,ZRTOS_ERROR__ROFS = -30 ///< Read-only file system
55  ,ZRTOS_ERROR__MLINK = -31 ///< Too many links
56  ,ZRTOS_ERROR__PIPE = -32 ///< Broken pipe
57  ,ZRTOS_ERROR__DOM = -33 ///< Math argument out of domain of func
58  ,ZRTOS_ERROR__RANGE = -34 ///< Math result not representable
59  ,ZRTOS_ERROR__DEADLK = -35 ///< Resource deadlock would occur
60  ,ZRTOS_ERROR__NAMETOOLONG = -36 ///< File name too long
61  ,ZRTOS_ERROR__NOLCK = -37 ///< No record locks available
62  ,ZRTOS_ERROR__NOSYS = -38 ///< Function not implemented
63  ,ZRTOS_ERROR__NOTEMPTY = -39 ///< Directory not empty
64  ,ZRTOS_ERROR__LOOP = -40 ///< Too many symbolic links encountered
65  ,ZRTOS_ERROR__WOULDBLOCK = -41 ///< Operation would block
66  ,ZRTOS_ERROR__NOMSG = -42 ///< No message of desired type
67  ,ZRTOS_ERROR__IDRM = -43 ///< Identifier removed
68  ,ZRTOS_ERROR__CHRNG = -44 ///< Channel number out of range
69  ,ZRTOS_ERROR__L2NSYNC = -45 ///< Level 2 not synchronized
70  ,ZRTOS_ERROR__L3HLT = -46 ///< Level 3 halted
71  ,ZRTOS_ERROR__L3RST = -47 ///< Level 3 reset
72  ,ZRTOS_ERROR__LNRNG = -48 ///< Link number out of range
73  ,ZRTOS_ERROR__UNATCH = -49 ///< Protocol driver not attached
74  ,ZRTOS_ERROR__NOCSI = -50 ///< No CSI structure available
75  ,ZRTOS_ERROR__L2HLT = -51 ///< Level 2 halted
76  ,ZRTOS_ERROR__BADE = -52 ///< Invalid exchange
77  ,ZRTOS_ERROR__BADR = -53 ///< Invalid request descriptor
78  ,ZRTOS_ERROR__XFULL = -54 ///< Exchange full
79  ,ZRTOS_ERROR__NOANO = -55 ///< No anode
80  ,ZRTOS_ERROR__BADRQC = -56 ///< Invalid request code
81  ,ZRTOS_ERROR__BADSLT = -57 ///< Invalid slot
82  ,ZRTOS_ERROR__DEADLOCK = -58 ///< File locking deadlock error
83  ,ZRTOS_ERROR__BFONT = -59 ///< Bad font file format
84  ,ZRTOS_ERROR__NOSTR = -60 ///< Device not a stream
85  ,ZRTOS_ERROR__NODATA = -61 ///< No data available
86  ,ZRTOS_ERROR__TIME = -62 ///< Timer expired
87  ,ZRTOS_ERROR__NOSR = -63 ///< Out of streams resources
88  ,ZRTOS_ERROR__NONET = -64 ///< Machine is not on the network
89  ,ZRTOS_ERROR__NOPKG = -65 ///< Package not installed
90  ,ZRTOS_ERROR__REMOTE = -66 ///< Object is remote
91  ,ZRTOS_ERROR__NOLINK = -67 ///< Link has been severed
92  ,ZRTOS_ERROR__ADV = -68 ///< Advertise error
93  ,ZRTOS_ERROR__SRMNT = -69 ///< Srmount error
94  ,ZRTOS_ERROR__COMM = -70 ///< Communication error on send
95  ,ZRTOS_ERROR__PROTO = -71 ///< Protocol error
96  ,ZRTOS_ERROR__MULTIHOP = -72 ///< Multihop attempted
97  ,ZRTOS_ERROR__DOTDOT = -73 ///< RFS specific error
98  ,ZRTOS_ERROR__BADMSG = -74 ///< Not a data message
99  ,ZRTOS_ERROR__OVERFLOW = -75 ///< Value too large for defined data type
100  ,ZRTOS_ERROR__NOTUNIQ = -76 ///< Name not unique on network
101  ,ZRTOS_ERROR__BADFD = -77 ///< File descriptor in bad state
102  ,ZRTOS_ERROR__REMCHG = -78 ///< Remote address changed
103  ,ZRTOS_ERROR__LIBACC = -79 ///< Can not access a needed shared library
104  ,ZRTOS_ERROR__LIBBAD = -80 ///< Accessing a corrupted shared library
105  ,ZRTOS_ERROR__LIBSCN = -81 ///< .lib section in a.out corrupted
106  ,ZRTOS_ERROR__LIBMAX = -82 ///< Attempting to link in too many shared libraries
107  ,ZRTOS_ERROR__LIBEXEC = -83 ///< Cannot exec a shared library directly
108  ,ZRTOS_ERROR__ILSEQ = -84 ///< Illegal byte sequence
109  ,ZRTOS_ERROR__RESTART = -85 ///< Interrupted system call should be restarted
110  ,ZRTOS_ERROR__STRPIPE = -86 ///< Streams pipe error
111  ,ZRTOS_ERROR__USERS = -87 ///< Too many users
112  ,ZRTOS_ERROR__NOTSOCK = -88 ///< Socket operation on non-socket
113  ,ZRTOS_ERROR__DESTADDRREQ = -89 ///< Destination address required
114  ,ZRTOS_ERROR__MSGSIZE = -90 ///< Message too long
115  ,ZRTOS_ERROR__PROTOTYPE = -91 ///< Protocol wrong type for socket
116  ,ZRTOS_ERROR__NOPROTOOPT = -92 ///< Protocol not available
117  ,ZRTOS_ERROR__PROTONOSUPPORT = -93 ///< Protocol not supported
118  ,ZRTOS_ERROR__SOCKTNOSUPPORT = -94 ///< Socket type not supported
119  ,ZRTOS_ERROR__OPNOTSUPP = -95 ///< Operation not supported on transport endpoint
120  ,ZRTOS_ERROR__PFNOSUPPORT = -96 ///< Protocol family not supported
121  ,ZRTOS_ERROR__AFNOSUPPORT = -97 ///< Address family not supported by protocol
122  ,ZRTOS_ERROR__ADDRINUSE = -98 ///< Address already in use
123  ,ZRTOS_ERROR__ADDRNOTAVAIL = -99 ///< Cannot assign requested address
124  ,ZRTOS_ERROR__NETDOWN = -100 ///< Network is down
125  ,ZRTOS_ERROR__NETUNREACH = -101 ///< Network is unreachable
126  ,ZRTOS_ERROR__NETRESET = -102 ///< Network dropped connection because of reset
127  ,ZRTOS_ERROR__CONNABORTED = -103 ///< Software caused connection abort
128  ,ZRTOS_ERROR__CONNRESET = -104 ///< Connection reset by peer
129  ,ZRTOS_ERROR__NOBUFS = -105 ///< No buffer space available
130  ,ZRTOS_ERROR__ISCONN = -106 ///< Transport endpoint is already connected
131  ,ZRTOS_ERROR__NOTCONN = -107 ///< Transport endpoint is not connected
132  ,ZRTOS_ERROR__SHUTDOWN = -108 ///< Cannot send after transport endpoint shutdown
133  ,ZRTOS_ERROR__TOOMANYREFS = -109 ///< Too many references: cannot splice
134  ,ZRTOS_ERROR__TIMEDOUT = -110 ///< Connection timed out
135  ,ZRTOS_ERROR__CONNREFUSED = -111 ///< Connection refused
136  ,ZRTOS_ERROR__HOSTDOWN = -112 ///< Host is down
137  ,ZRTOS_ERROR__HOSTUNREACH = -113 ///< No route to host
138  ,ZRTOS_ERROR__ALREADY = -114 ///< Operation already in progress
139  ,ZRTOS_ERROR__INPROGRESS = -115 ///< Operation now in progress
140  ,ZRTOS_ERROR__STALE = -116 ///< Stale NFS file handle
141  ,ZRTOS_ERROR__UCLEAN = -117 ///< Structure needs cleaning
142  ,ZRTOS_ERROR__NOTNAM = -118 ///< Not a XENIX named type file
143  ,ZRTOS_ERROR__NAVAIL = -119 ///< No XENIX semaphores available
144  ,ZRTOS_ERROR__ISNAM = -120 ///< Is a named type file
145  ,ZRTOS_ERROR__REMOTEIO = -121 ///< Remote I/O error
146  ,ZRTOS_ERROR__LAST = -121 ///< Greatest error code
147  ,ZRTOS_ERROR__MAX = INT_MAX ///< Maximum value of zrtos_error_t
149 
150 ZRTOS_ASSERT__STATIC(sizeof(zrtos_error_t) == sizeof(int));
151 
152 bool zrtos_error__is_success(zrtos_error_t thiz){
153  return thiz >= 0;
154 }
155 
156 bool zrtos_error__is_error(zrtos_error_t thiz){
157  return thiz < 0;
158 }
159 
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 #endif
No such device or address.
Definition: error.h:30
Level 2 halted.
Definition: error.h:75
Stale NFS file handle.
Definition: error.h:140
Attempting to link in too many shared libraries.
Definition: error.h:106
No data available.
Definition: error.h:85
Too many links.
Definition: error.h:55
Unsuccessful program execution status.
Definition: error.h:23
Level 3 halted.
Definition: error.h:70
Exchange full.
Definition: error.h:78
Network dropped connection because of reset.
Definition: error.h:126
Broken pipe.
Definition: error.h:56
.lib section in a.out corrupted
Definition: error.h:105
Text file busy.
Definition: error.h:50
Illegal byte sequence.
Definition: error.h:108
File locking deadlock error.
Definition: error.h:82
Smallest error code.
Definition: error.h:24
Exec format error.
Definition: error.h:32
Try again.
Definition: error.h:35
Too many users.
Definition: error.h:111
Transport endpoint is already connected.
Definition: error.h:130
File name too long.
Definition: error.h:60
No XENIX semaphores available.
Definition: error.h:143
Structure needs cleaning.
Definition: error.h:141
No such file or directory.
Definition: error.h:26
Block device required.
Definition: error.h:39
Read-only file system.
Definition: error.h:54
Connection reset by peer.
Definition: error.h:128
No CSI structure available.
Definition: error.h:74
Level 3 reset.
Definition: error.h:71
No route to host.
Definition: error.h:137
Maximum value of zrtos_error_t.
Definition: error.h:147
File descriptor in bad state.
Definition: error.h:101
Streams pipe error.
Definition: error.h:110
Interrupted system call should be restarted.
Definition: error.h:109
No child processes.
Definition: error.h:34
Not a data message.
Definition: error.h:98
Package not installed.
Definition: error.h:89
Invalid request code.
Definition: error.h:80
Not a typewriter.
Definition: error.h:49
Advertise error.
Definition: error.h:92
Permission denied.
Definition: error.h:37
Host is down.
Definition: error.h:136
Message too long.
Definition: error.h:114
Invalid exchange.
Definition: error.h:76
Protocol not available.
Definition: error.h:116
Communication error on send.
Definition: error.h:94
Too many open files.
Definition: error.h:48
Remote I/O error.
Definition: error.h:145
Cannot exec a shared library directly.
Definition: error.h:107
Is a named type file.
Definition: error.h:144
Invalid request descriptor.
Definition: error.h:77
No buffer space available.
Definition: error.h:129
Level 2 not synchronized.
Definition: error.h:69
Address family not supported by protocol.
Definition: error.h:121
bool zrtos_error__is_error(zrtos_error_t thiz)
Definition: error.h:156
File exists.
Definition: error.h:41
Not a XENIX named type file.
Definition: error.h:142
Destination address required.
Definition: error.h:113
Arg list too long.
Definition: error.h:31
Too many symbolic links encountered.
Definition: error.h:64
Greatest error code.
Definition: error.h:146
Math result not representable.
Definition: error.h:58
Protocol wrong type for socket.
Definition: error.h:115
Minimum value of zrtos_error_t.
Definition: error.h:21
No anode.
Definition: error.h:79
Bad font file format.
Definition: error.h:83
Network is down.
Definition: error.h:124
Is a directory.
Definition: error.h:45
Object is remote.
Definition: error.h:90
Network is unreachable.
Definition: error.h:125
Multihop attempted.
Definition: error.h:96
Operation would block.
Definition: error.h:65
Link has been severed.
Definition: error.h:91
Identifier removed.
Definition: error.h:67
ZRTOS_ASSERT__STATIC(sizeof(zrtos_error_t)==sizeof(int))
Interrupted system call.
Definition: error.h:28
bool zrtos_error__is_success(zrtos_error_t thiz)
Definition: error.h:152
Address already in use.
Definition: error.h:122
Cross-device link.
Definition: error.h:42
Invalid slot.
Definition: error.h:81
Link number out of range.
Definition: error.h:72
Bad file number.
Definition: error.h:33
Successful program execution status.
Definition: error.h:22
File too large.
Definition: error.h:51
Bad address.
Definition: error.h:38
Directory not empty.
Definition: error.h:63
Operation not supported on transport endpoint.
Definition: error.h:119
Srmount error.
Definition: error.h:93
Too many references: cannot splice.
Definition: error.h:133
Not a directory.
Definition: error.h:44
Invalid argument.
Definition: error.h:46
Function not implemented.
Definition: error.h:62
Out of memory.
Definition: error.h:36
Operation already in progress.
Definition: error.h:138
Illegal seek.
Definition: error.h:53
Timer expired.
Definition: error.h:86
Operation not permitted.
Definition: error.h:25
Device or resource busy.
Definition: error.h:40
Protocol error.
Definition: error.h:95
No record locks available.
Definition: error.h:61
Protocol driver not attached.
Definition: error.h:73
Can not access a needed shared library.
Definition: error.h:103
RFS specific error.
Definition: error.h:97
Protocol not supported.
Definition: error.h:117
Accessing a corrupted shared library.
Definition: error.h:104
Operation now in progress.
Definition: error.h:139
Name not unique on network.
Definition: error.h:100
Math argument out of domain of func.
Definition: error.h:57
Out of streams resources.
Definition: error.h:87
Protocol family not supported.
Definition: error.h:120
No space left on device.
Definition: error.h:52
I/O error.
Definition: error.h:29
Value too large for defined data type.
Definition: error.h:99
Connection timed out.
Definition: error.h:134
Remote address changed.
Definition: error.h:102
Socket operation on non-socket.
Definition: error.h:112
Connection refused.
Definition: error.h:135
zrtos_error_t
Definition: error.h:20
Cannot send after transport endpoint shutdown.
Definition: error.h:132
Transport endpoint is not connected.
Definition: error.h:131
Device not a stream.
Definition: error.h:84
Software caused connection abort.
Definition: error.h:127
File table overflow.
Definition: error.h:47
Socket type not supported.
Definition: error.h:118
Cannot assign requested address.
Definition: error.h:123
No message of desired type.
Definition: error.h:66
Machine is not on the network.
Definition: error.h:88
Resource deadlock would occur.
Definition: error.h:59
Channel number out of range.
Definition: error.h:68
No such device.
Definition: error.h:43
No such process.
Definition: error.h:27